Skip to content

Commit 68e6cab

Browse files
committed
Fix UI bugs in PF Theme
Signed-off-by: Jenny <[email protected]> remove diff file Signed-off-by: Jenny <[email protected]>
1 parent ff713aa commit 68e6cab

File tree

5 files changed

+74
-10
lines changed

5 files changed

+74
-10
lines changed

workspaces/frontend/src/app/App.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import * as React from 'react';
22
import '@patternfly/react-core/dist/styles/base.css';
33
import './app.css';
44
import {
5+
Brand,
56
Flex,
67
Masthead,
8+
MastheadBrand,
79
MastheadContent,
10+
MastheadLogo,
811
MastheadMain,
912
MastheadToggle,
1013
Page,
@@ -18,6 +21,7 @@ import AppRoutes from './AppRoutes';
1821
import NavSidebar from './NavSidebar';
1922
import { NotebookContextProvider } from './context/NotebookContext';
2023
import { isMUITheme, Theme } from './const';
24+
import logoDarkTheme from '~/images/logo-dark-theme.svg';
2125

2226
const App: React.FC = () => {
2327
React.useEffect(() => {
@@ -37,6 +41,16 @@ const App: React.FC = () => {
3741
<BarsIcon />
3842
</PageToggleButton>
3943
</MastheadToggle>
44+
{!isMUITheme() ? (
45+
<MastheadBrand>
46+
<MastheadLogo component="a">
47+
48+
<Brand src={logoDarkTheme} alt="Kubeflow" heights={{ default: '36px' }} />
49+
</MastheadLogo>
50+
</MastheadBrand>
51+
) : (
52+
''
53+
)}
4054
</MastheadMain>
4155
<MastheadContent>
4256
<Flex>

workspaces/frontend/src/app/NavSidebar.tsx

+13-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
PageSidebarBody,
1111
} from '@patternfly/react-core';
1212
import { useNavData, isNavDataGroup, NavDataHref, NavDataGroup } from './AppRoutes';
13+
import { isMUITheme, LOGO_LIGHT } from "./const";
1314

1415
const NavHref: React.FC<{ item: NavDataHref }> = ({ item }) => (
1516
<NavItem key={item.label} data-id={item.label} itemId={item.label}>
@@ -49,13 +50,17 @@ const NavSidebar: React.FC = () => {
4950
<PageSidebarBody>
5051
<Nav id="nav-primary-simple">
5152
<NavList id="nav-list-simple">
52-
<NavItem>
53-
<Brand
54-
className="kubeflow_brand"
55-
src={`${window.location.origin}/images/logo.svg`}
56-
alt="Kubeflow Logo"
57-
/>
58-
</NavItem>
53+
{isMUITheme() ? (
54+
<NavItem>
55+
<Brand
56+
className="kubeflow_brand"
57+
src={`${window.location.origin}/images/${LOGO_LIGHT}`}
58+
alt="Kubeflow Logo"
59+
/>
60+
</NavItem>
61+
) : (
62+
''
63+
)}
5964
{navData.map((item) =>
6065
isNavDataGroup(item) ? (
6166
<NavGroup key={item.label} item={item} />
@@ -70,4 +75,4 @@ const NavSidebar: React.FC = () => {
7075
);
7176
};
7277

73-
export default NavSidebar;
78+
export default NavSidebar;

workspaces/frontend/src/app/const.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ export enum Theme {
88

99
export const isMUITheme = (): boolean => STYLE_THEME === Theme.MUI;
1010
const STYLE_THEME = process.env.STYLE_THEME || Theme.MUI;
11+
12+
export const LOGO_LIGHT = process.env.LOGO || 'logo.svg';

workspaces/frontend/src/app/pages/Workspaces/Creation/WorkspaceCreation.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ const WorkspaceCreation: React.FunctionComponent = () => {
6868

6969
return (
7070
<>
71-
<PageGroup stickyOnBreakpoint={{ default: 'top' }}>
72-
<PageSection isFilled={false}>
71+
<PageGroup isFilled={false} stickyOnBreakpoint={{ default: 'top' }}>
72+
<PageSection>
7373
<Stack hasGutter>
7474
<StackItem>
7575
<Flex>
Loading

0 commit comments

Comments
 (0)