Skip to content

Commit

Permalink
fix(frontend): fix navbar to apply correct logo and position in defau…
Browse files Browse the repository at this point in the history
…lt theme

Signed-off-by: Jenny <[email protected]>

use absolute path
  • Loading branch information
jenny-s51 committed Feb 18, 2025
1 parent 246f41d commit 5e5b140
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
14 changes: 14 additions & 0 deletions clients/ui/frontend/src/app/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from 'react';
import {
Brand,
Dropdown,
DropdownItem,
DropdownList,
Masthead,
MastheadBrand,
MastheadContent,
MastheadLogo,
MastheadMain,
MastheadToggle,
MenuToggle,
Expand All @@ -18,6 +21,8 @@ import {
import { SimpleSelect } from '@patternfly/react-templates';
import { BarsIcon } from '@patternfly/react-icons';
import { NamespaceSelectorContext } from '~/shared/context/NamespaceSelectorContext';
import { isMUITheme } from '~/shared/utilities/const';
import logoDarkTheme from '~/images/logo-dark-theme.svg';

interface NavBarProps {
username?: string;
Expand Down Expand Up @@ -55,6 +60,15 @@ const NavBar: React.FC<NavBarProps> = ({ username, onLogout }) => {
<BarsIcon />
</PageToggleButton>
</MastheadToggle>
{!isMUITheme() ? (
<MastheadBrand>
<MastheadLogo component="a">
<Brand src={logoDarkTheme} alt="Kubeflow" heights={{ default: '36px' }} />
</MastheadLogo>
</MastheadBrand>
) : (
''
)}
</MastheadMain>
<MastheadContent>
<Toolbar>
Expand Down
20 changes: 12 additions & 8 deletions clients/ui/frontend/src/app/NavSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
PageSidebar,
PageSidebarBody,
} from '@patternfly/react-core';
import { LOGO_LIGHT } from '~/shared/utilities/const';
import { isMUITheme, LOGO_LIGHT } from '~/shared/utilities/const';
import { useNavData, isNavDataGroup, NavDataHref, NavDataGroup } from './AppRoutes';

const NavHref: React.FC<{ item: NavDataHref }> = ({ item }) => (
Expand Down Expand Up @@ -48,13 +48,17 @@ const NavSidebar: React.FC = () => {
<PageSidebarBody>
<Nav id="nav-primary-simple">
<NavList id="nav-list-simple">
<NavItem>
<Brand
className="kubeflow_brand"
src={`${window.location.origin}/images/${LOGO_LIGHT}`}
alt="Kubeflow Logo"
/>
</NavItem>
{isMUITheme() ? (
<NavItem>
<Brand
className="kubeflow_brand"
src={`${window.location.origin}/images/${LOGO_LIGHT}`}
alt="Kubeflow Logo"
/>
</NavItem>
) : (
''
)}
{navData.map((item) =>
isNavDataGroup(item) ? (
<NavGroup key={item.label} item={item} />
Expand Down

0 comments on commit 5e5b140

Please sign in to comment.