Skip to content

Commit

Permalink
fix(masthead): correct styling of masthead icons and quickstart menu …
Browse files Browse the repository at this point in the history
…item (#1309)
  • Loading branch information
andrewazores authored Jul 29, 2024
1 parent bb154cd commit da18bc0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
29 changes: 18 additions & 11 deletions src/app/AppLayout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import {
BellIcon,
CaretDownIcon,
CogIcon,
EllipsisVIcon,
ExternalLinkAltIcon,
PlusCircleIcon,
QuestionCircleIcon,
Expand Down Expand Up @@ -297,13 +296,12 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {

const UserInfoToggle = React.useCallback(
(toggleRef: React.Ref<MenuToggleElement>) => (
<MenuToggle ref={toggleRef} onClick={handleUserInfoToggle} icon={CaretDownIcon}>
<MenuToggle variant="plainText" ref={toggleRef} onClick={handleUserInfoToggle} icon={CaretDownIcon}>
{username || (
<Icon size="sm">
<UserIcon color="white" />
</Icon>
)}
<EllipsisVIcon />
</MenuToggle>
),
[username, handleUserInfoToggle],
Expand Down Expand Up @@ -333,8 +331,8 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {

const helpItems = React.useMemo(() => {
return [
<DropdownItem key={'Quickstarts'}>
<NavLink to="/quickstarts">{t('AppLayout.APP_LAUNCHER.QUICKSTARTS')}</NavLink>
<DropdownItem key={'Quickstarts'} component={(props) => <Link {...props} to="/quickstarts" />}>
{t('AppLayout.APP_LAUNCHER.QUICKSTARTS')}
</DropdownItem>,
<DropdownItem key={'Documentation'} onClick={handleOpenDocumentation}>
<span>{t('AppLayout.APP_LAUNCHER.DOCUMENTATION')}</span>
Expand Down Expand Up @@ -398,7 +396,9 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
onClick={handleNotificationCenterToggle}
aria-label="Notifications"
>
<BellIcon />
<Icon>
<BellIcon />
</Icon>
</NotificationBadge>
</ToolbarItem>
<ToolbarItem>
Expand All @@ -409,7 +409,7 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
data-quickstart-id="settings-link"
component={(props) => <Link {...props} to="/settings" />}
>
<Icon size="sm">
<Icon>
<CogIcon />
</Icon>
</Button>
Expand All @@ -421,14 +421,18 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
<MenuToggle
ref={toggleRef}
icon={<QuestionCircleIcon />}
variant="plain"
className="application-launcher"
onClick={() => handleHelpToggle()}
>
<EllipsisVIcon />
<Icon>
<QuestionCircleIcon />
</Icon>
</MenuToggle>
)}
isOpen={showHelpDropdown}
onOpenChange={(v) => setShowHelpDropdown(v)}
onOpenChangeKeys={['Escape']}
popperProps={{
position: 'right',
}}
Expand All @@ -439,10 +443,11 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
</ToolbarGroup>
<ToolbarItem visibility={{ default: 'visible' }}>
<Dropdown
isPlain
onSelect={() => setShowUserInfoDropdown(false)}
toggle={UserInfoToggle}
isOpen={showUserInfoDropdown}
onOpenChange={(v) => setShowUserInfoDropdown(v)}
onOpenChangeKeys={['Escape']}
popperProps={{
position: 'right',
}}
Expand Down Expand Up @@ -483,7 +488,9 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
data-quickstart-id="nav-toggle-btn"
data-tour-id="nav-toggle-btn"
>
<BarsIcon />
<Icon>
<BarsIcon />
</Icon>
</PageToggleButton>
</MastheadToggle>
<MastheadMain>
Expand Down
6 changes: 3 additions & 3 deletions src/app/Settings/Config/FeatureLevels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ const Component = () => {
.filter((v) => typeof v === 'string')
.map((v): { key: string; value: number } => ({ key: String(v), value: FeatureLevel[v] }))
.filter((v) => {
if (!process.env.CRYOSTAT_AUTHORITY) {
return v.value !== FeatureLevel.DEVELOPMENT;
if ((process.env.NODE_ENV ?? '').toLowerCase() === 'development') {
return true;
}
return true;
return v.value !== FeatureLevel.DEVELOPMENT;
})
.map((level) => (
<SelectOption key={level.key} value={level.value}>
Expand Down

0 comments on commit da18bc0

Please sign in to comment.