Skip to content

Commit 17d6354

Browse files
committed
update packages and run codemods
1 parent 62e92b7 commit 17d6354

File tree

4 files changed

+31
-37
lines changed

4 files changed

+31
-37
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@
7979
"webpack-merge": "^5.8.0"
8080
},
8181
"dependencies": {
82-
"@patternfly/react-core": "^4.181.1",
83-
"@patternfly/react-icons": "^4.32.1",
84-
"@patternfly/react-styles": "^4.31.1",
82+
"@patternfly/react-core": "^5.0.0-prerealse.13",
83+
"@patternfly/react-icons": "^5.0.0-prerealse.7",
84+
"@patternfly/react-styles": "^5.0.0-prerealse.5",
8585
"@storybook/builder-webpack5": "^6.2.9",
86-
"react": "^17.0.2",
87-
"react-dom": "^17.0.2",
86+
"react": "^18",
87+
"react-dom": "^18",
8888
"sirv-cli": "^1.0.12"
8989
}
9090
}

src/app/AppLayout/AppLayout.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import * as React from 'react';
22
import { NavLink, useLocation, useHistory } from 'react-router-dom';
33
import {
4-
Nav,
5-
NavList,
6-
NavItem,
7-
NavExpandable,
8-
Page,
9-
PageHeader,
10-
PageSidebar,
11-
SkipToContent
4+
Nav,
5+
NavList,
6+
NavItem,
7+
NavExpandable,
8+
Page,
9+
PageSidebar,
10+
SkipToContent, PageSidebarBody
1211
} from '@patternfly/react-core';
12+
import {
13+
PageHeader
14+
} from '@patternfly/react-core/deprecated';
1315
import { routes, IAppRoute, IAppRouteGroup } from '@app/routes';
1416
import logo from '@app/bgimages/Patternfly-Logo.svg';
1517

@@ -82,10 +84,11 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({ children }) => {
8284
);
8385

8486
const Sidebar = (
85-
<PageSidebar
86-
theme="dark"
87-
nav={Navigation}
88-
isNavOpen={isMobileView ? isNavOpenMobile : isNavOpen} />
87+
<PageSidebar theme="dark" isSidebarOpen={isMobileView ? isNavOpenMobile : isNavOpen} >
88+
<PageSidebarBody>
89+
{Navigation}
90+
</PageSidebarBody>
91+
</PageSidebar>
8992
);
9093

9194
const pageId = 'primary-app-container';
@@ -104,7 +107,7 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({ children }) => {
104107
mainContainerId={pageId}
105108
header={Header}
106109
sidebar={Sidebar}
107-
onPageResize={onPageResize}
110+
onPageResize={(_event, props: { mobileView: boolean; windowSize: number }) => onPageResize(props)}
108111
skipToContent={PageSkipToContent}>
109112
{children}
110113
</Page>

src/app/NotFound/NotFound.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import * as React from 'react';
22
import { ExclamationTriangleIcon } from '@patternfly/react-icons';
33
import {
44
PageSection,
5-
Title,
65
Button,
76
EmptyState,
87
EmptyStateIcon,
9-
EmptyStateBody,
8+
EmptyStateBody, EmptyStateHeader, EmptyStateFooter,
109
} from '@patternfly/react-core';
1110
import { useHistory } from 'react-router-dom';
1211

@@ -24,15 +23,12 @@ const NotFound: React.FunctionComponent = () => {
2423
return (
2524
<PageSection>
2625
<EmptyState variant="full">
27-
<EmptyStateIcon icon={ExclamationTriangleIcon} />
28-
<Title headingLevel="h1" size="lg">
29-
404 Page not found
30-
</Title>
26+
<EmptyStateHeader titleText="404 Page not found" icon={<EmptyStateIcon icon={ExclamationTriangleIcon} />} headingLevel="h1" />
3127
<EmptyStateBody>
3228
We didn&apos;t find a page that matches the address you navigated to.
33-
</EmptyStateBody>
29+
</EmptyStateBody><EmptyStateFooter>
3430
<GoHomeBtn />
35-
</EmptyState>
31+
</EmptyStateFooter></EmptyState>
3632
</PageSection>
3733
)
3834
};

src/app/Support/Support.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ import * as React from 'react';
22
import { CubesIcon } from '@patternfly/react-icons';
33
import {
44
PageSection,
5-
Title,
65
Button,
76
EmptyState,
87
EmptyStateVariant,
98
EmptyStateIcon,
109
EmptyStateBody,
11-
EmptyStateSecondaryActions,
1210
Text,
1311
TextContent,
14-
TextVariants,
12+
TextVariants, EmptyStateActions, EmptyStateHeader, EmptyStateFooter,
1513
} from '@patternfly/react-core';
1614

1715
export interface ISupportProps {
@@ -22,10 +20,7 @@ export interface ISupportProps {
2220
let Support: React.FunctionComponent<ISupportProps> = () => (
2321
<PageSection>
2422
<EmptyState variant={EmptyStateVariant.full}>
25-
<EmptyStateIcon icon={CubesIcon} />
26-
<Title headingLevel="h1" size="lg">
27-
Empty State (Stub Support Module)
28-
</Title>
23+
<EmptyStateHeader titleText="Empty State (Stub Support Module)" icon={<EmptyStateIcon icon={CubesIcon} />} headingLevel="h1" />
2924
<EmptyStateBody>
3025
<TextContent>
3126
<Text component="p">
@@ -37,17 +32,17 @@ let Support: React.FunctionComponent<ISupportProps> = () => (
3732
PatternFly&apos;s global variable API.
3833
</Text>
3934
</TextContent>
40-
</EmptyStateBody>
35+
</EmptyStateBody><EmptyStateFooter>
4136
<Button variant="primary">Primary Action</Button>
42-
<EmptyStateSecondaryActions>
37+
<EmptyStateActions>
4338
<Button variant="link">Multiple</Button>
4439
<Button variant="link">Action Buttons</Button>
4540
<Button variant="link">Can</Button>
4641
<Button variant="link">Go here</Button>
4742
<Button variant="link">In the secondary</Button>
4843
<Button variant="link">Action area</Button>
49-
</EmptyStateSecondaryActions>
50-
</EmptyState>
44+
</EmptyStateActions>
45+
</EmptyStateFooter></EmptyState>
5146
</PageSection>
5247
);
5348

0 commit comments

Comments
 (0)