Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade deprecated components in demo-app #93

Merged
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