Skip to content

Commit bfee0dc

Browse files
committed
Fix UI bugs in PF Theme
Signed-off-by: Jenny <[email protected]> remove diff file Signed-off-by: Jenny <[email protected]> fix toolbar filter component structure format document
1 parent ff713aa commit bfee0dc

File tree

6 files changed

+84
-19
lines changed

6 files changed

+84
-19
lines changed

workspaces/frontend/src/app/App.tsx

+13
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,15 @@ const App: React.FC = () => {
3741
<BarsIcon />
3842
</PageToggleButton>
3943
</MastheadToggle>
44+
{!isMUITheme() ? (
45+
<MastheadBrand>
46+
<MastheadLogo component="a">
47+
<Brand src={logoDarkTheme} alt="Kubeflow" heights={{ default: '36px' }} />
48+
</MastheadLogo>
49+
</MastheadBrand>
50+
) : (
51+
''
52+
)}
4053
</MastheadMain>
4154
<MastheadContent>
4255
<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

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ export enum Theme {
77
}
88

99
export const isMUITheme = (): boolean => STYLE_THEME === Theme.MUI;
10-
const STYLE_THEME = process.env.STYLE_THEME || Theme.MUI;
10+
const STYLE_THEME = process.env.STYLE_THEME || Theme.Default;
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

workspaces/frontend/src/shared/components/Filter.tsx

+10-8
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,17 @@ const Filter: React.FC<FilterProps> = ({ id, onFilter, columnNames }) => {
199199
>
200200
<ToolbarContent>
201201
<ToolbarToggleGroup toggleIcon={<FilterIcon />} breakpoint="xl">
202-
<ToolbarItem id={`${id}-dropdown`}>{filterDropdown}</ToolbarItem>
203202
<ToolbarGroup variant="filter-group">
203+
<ToolbarItem id={`${id}-dropdown`}>{filterDropdown}</ToolbarItem>
204+
<ToolbarItem>
205+
<SearchInput
206+
id={`${id}-search-input`}
207+
placeholder={`Filter by ${activeFilter.columnName}`}
208+
value={searchValue}
209+
onChange={(_event, value) => onSearchChange(value)}
210+
onClear={() => onSearchChange('')}
211+
/>
212+
</ToolbarItem>
204213
{filters.map((filter) => (
205214
<ToolbarFilter
206215
key={`${filter.columnName}-filter`}
@@ -213,13 +222,6 @@ const Filter: React.FC<FilterProps> = ({ id, onFilter, columnNames }) => {
213222
</ToolbarFilter>
214223
))}
215224
</ToolbarGroup>
216-
<SearchInput
217-
id={`${id}-search-input`}
218-
placeholder={`Filter by ${activeFilter.columnName}`}
219-
value={searchValue}
220-
onChange={(_event, value) => onSearchChange(value)}
221-
onClear={() => onSearchChange('')}
222-
/>
223225
</ToolbarToggleGroup>
224226
</ToolbarContent>
225227
</Toolbar>

0 commit comments

Comments
 (0)