Skip to content

Commit

Permalink
Merge pull request #93 from jenny-s51/upgradeDeprecatedComponents_dem…
Browse files Browse the repository at this point in the history
…o-app

chore: upgrade deprecated components in demo-app
  • Loading branch information
nicolethoen authored Sep 8, 2023
2 parents 94067ef + 35b5135 commit 1b002e8
Show file tree
Hide file tree
Showing 10 changed files with 265 additions and 200 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 @@ -22,7 +22,7 @@ import CustomPathNode from './CustomPathNode';

const contextMenuItem = (label: string, i: number): React.ReactElement => {
if (label === '-') {
return <ContextMenuSeparator key={`separator:${i.toString()}`} />;
return <ContextMenuSeparator component="li" key={`separator:${i.toString()}`} />;
}
if (label.includes('->')) {
const parent = label.slice(0, label.indexOf('->'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const GROUPED_EDGE_TYPE = 'GROUPED_EDGE';

const contextMenuItem = (label: string, i: number): React.ReactElement => {
if (label === '-') {
return <ContextMenuSeparator key={`separator:${i.toString()}`} />;
return <ContextMenuSeparator component="li" key={`separator:${i.toString()}`} />;
}
return (
// eslint-disable-next-line no-alert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface EdgeProps {

const contextMenuItem = (label: string, i: number): React.ReactElement => {
if (label === '-') {
return <ContextMenuSeparator key={`separator:${i.toString()}`} />;
return <ContextMenuSeparator component="li" key={`separator:${i.toString()}`} />;
}
return (
// eslint-disable-next-line no-alert
Expand Down
2 changes: 1 addition & 1 deletion packages/demo-app-ts/src/demos/ContextMenus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Tab, Tabs, TabTitleText } from '@patternfly/react-core';

const contextMenuItem = (label: string, i: number): React.ReactElement => {
if (label === '-') {
return <ContextMenuSeparator key={`separator:${i.toString()}`} />;
return <ContextMenuSeparator component="li" key={`separator:${i.toString()}`} />;
}
return (
// eslint-disable-next-line no-alert
Expand Down
Loading

0 comments on commit 1b002e8

Please sign in to comment.