Skip to content

Commit

Permalink
chore: upgrade v4 components to v5 in demo-app
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Aug 16, 2023
1 parent eea240b commit 2299061
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 139 deletions.
30 changes: 17 additions & 13 deletions packages/demo-app-ts/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,24 @@ import {
Avatar,
Brand,
Radio,
Masthead,
MastheadMain,
MastheadToggle,
MastheadBrand,
NavExpandable,
PageSidebarBody,
MastheadContent,
PageToggleButton,
Toolbar,
ToolbarContent,
ToolbarGroup,
ToolbarItem
ToolbarItem,
Masthead,
MastheadToggle,
PageToggleButton,
MastheadContent,
MastheadBrand,
MastheadMain,
ToolbarContent
} from '@patternfly/react-core';
import { BarsIcon } from '@patternfly/react-icons/dist/esm/icons/bars-icon';
import imgBrand from './assets/images/imgBrand.svg';
import imgAvatar from './assets/images/imgAvatar.svg';
import Demos from './Demos';
import './App.css';
import { BarsIcon } from '@patternfly/react-icons';

interface AppState {
activeItem: number | string;
isNavOpen: boolean;
Expand Down Expand Up @@ -153,13 +152,18 @@ class App extends React.Component<{}, AppState> {
const AppHeader = (
<Masthead>
<MastheadToggle>
<PageToggleButton variant="plain" aria-label="Global navigation">
<PageToggleButton
variant="plain"
aria-label="Global navigation"
isSidebarOpen={isNavOpen}
onSidebarToggle={() => this.setState({ isNavOpen: !isNavOpen })}
>
<BarsIcon />
</PageToggleButton>
</MastheadToggle>
<MastheadMain>
<MastheadBrand>
<Brand src={imgBrand} alt="PatternFly" heights={{ default: '36px' }} />
<MastheadBrand component="a">
<Brand src={imgBrand} alt="Patternfly Logo" heights={{ default: '36px' }} />
</MastheadBrand>
</MastheadMain>
<MastheadContent>{AppToolbar}</MastheadContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const contextMenuItem = (label: string, i: number): React.ReactElement => {

const createContextMenuItems = (...labels: string[]): React.ReactElement[] => labels.map(contextMenuItem);

const defaultMenu = createContextMenuItems('First', 'Second', 'Third', '-', 'Fourth');
const defaultMenu = createContextMenuItems('First', 'Second', 'Third', '-', 'Sub Menu-> Child1, Child2, Child3, -, Child4');

const stylesComponentFactory: ComponentFactory = (
kind: ModelKind,
Expand Down
Loading

0 comments on commit 2299061

Please sign in to comment.