From b9c76e2f6d0ba6783670c4e25d32f4bb7085c657 Mon Sep 17 00:00:00 2001 From: adamviktora Date: Tue, 28 May 2024 11:45:59 +0200 Subject: [PATCH] feat(Page): rename 'header' prop to 'masthead' --- .../react-core/src/components/Page/Page.tsx | 8 +-- .../src/components/Page/PageSidebar.tsx | 2 +- .../components/Page/__tests__/Page.test.tsx | 52 +++++++++---------- .../src/components/Page/examples/Page.md | 2 +- .../Page/examples/PageCenteredSection.tsx | 4 +- .../Page/examples/PageGroupSection.tsx | 4 +- .../Page/examples/PageHorizontalNav.tsx | 4 +- .../Page/examples/PageMainSectionPadding.tsx | 4 +- .../Page/examples/PageMultipleSidebarBody.tsx | 4 +- .../Page/examples/PageUncontrolledNav.tsx | 4 +- .../Page/examples/PageVerticalNav.tsx | 4 +- .../Page/examples/PageWithOrWithoutFill.tsx | 4 +- .../react-core/src/demos/DashboardWrapper.tsx | 4 +- .../examples/NotificationDrawerBasic.tsx | 4 +- .../examples/NotificationDrawerGrouped.tsx | 4 +- .../src/demos/RTL/examples/PaginatedTable.jsx | 2 +- .../src/demos/RTL/examples/PaginatedTable.tsx | 2 +- .../AlertGroupToastWithNotificationDrawer.tsx | 2 +- .../src/demos/examples/DashboardWrapper.js | 4 +- ...stheadWithUtilitiesAndUserDropdownMenu.tsx | 2 +- .../src/demos/examples/Nav/NavDefault.tsx | 2 +- .../src/demos/examples/Nav/NavDrilldown.tsx | 2 +- .../src/demos/examples/Nav/NavExpandable.tsx | 2 +- .../src/demos/examples/Nav/NavFlyout.tsx | 4 +- .../src/demos/examples/Nav/NavGrouped.tsx | 2 +- .../src/demos/examples/Nav/NavHorizontal.tsx | 9 +++- .../examples/Nav/NavHorizontalWithSubnav.tsx | 4 +- .../src/demos/examples/Nav/NavManual.tsx | 4 +- .../src/demos/examples/Nav/NavWithSubnav.tsx | 2 +- .../Page/PageStickySectionBreadcrumb.tsx | 2 +- .../examples/Page/PageStickySectionGroup.tsx | 2 +- .../Page/PageStickySectionGroupAlternate.tsx | 2 +- .../examples/Wizard/InPageWithDrawer.tsx | 4 +- .../InPageWithDrawerInformationalStep.tsx | 4 +- .../react-integration/demo-app-ts/src/App.tsx | 4 +- .../components/demos/PageDemo/PageDemo.tsx | 4 +- .../PageDemo/PageManagedSidebarClosedDemo.tsx | 4 +- .../src/demos/DashboardWrapper.tsx | 8 +-- 38 files changed, 95 insertions(+), 90 deletions(-) diff --git a/packages/react-core/src/components/Page/Page.tsx b/packages/react-core/src/components/Page/Page.tsx index 2e1c75aa142..7d78e679ad7 100644 --- a/packages/react-core/src/components/Page/Page.tsx +++ b/packages/react-core/src/components/Page/Page.tsx @@ -19,8 +19,8 @@ export interface PageProps extends React.HTMLProps { children?: React.ReactNode; /** Additional classes added to the page layout */ className?: string; - /** Header component (e.g. ) */ - header?: React.ReactNode; + /** Masthead component (e.g. ) */ + masthead?: React.ReactNode; /** Sidebar component for a side nav (e.g. ) */ sidebar?: React.ReactNode; /** Notification drawer component for an optional notification drawer (e.g. ) */ @@ -214,7 +214,7 @@ class Page extends React.Component { isBreadcrumbWidthLimited, className, children, - header, + masthead, sidebar, notificationDrawer, isNotificationDrawerExpanded, @@ -328,7 +328,7 @@ class Page extends React.Component { )} > {skipToContent} - {header} + {masthead} {sidebar} {notificationDrawer && (
diff --git a/packages/react-core/src/components/Page/PageSidebar.tsx b/packages/react-core/src/components/Page/PageSidebar.tsx index df6b5f63bbe..3ece4f4e226 100644 --- a/packages/react-core/src/components/Page/PageSidebar.tsx +++ b/packages/react-core/src/components/Page/PageSidebar.tsx @@ -10,7 +10,7 @@ export interface PageSidebarProps extends React.HTMLProps { children?: React.ReactNode; /** * If true, manages the sidebar open/close state and there is no need to pass the isSidebarOpen boolean into - * the sidebar component or add a callback onSidebarToggle function into the PageHeader component + * the sidebar component or add a callback onSidebarToggle function into the Masthead component */ isManagedSidebar?: boolean; /** Programmatically manage if the sidebar is shown, if isManagedSidebar is set to true in the Page component, this prop is managed */ diff --git a/packages/react-core/src/components/Page/__tests__/Page.test.tsx b/packages/react-core/src/components/Page/__tests__/Page.test.tsx index a67ec598808..a72f3400ee1 100644 --- a/packages/react-core/src/components/Page/__tests__/Page.test.tsx +++ b/packages/react-core/src/components/Page/__tests__/Page.test.tsx @@ -22,7 +22,7 @@ const props = { describe('Page', () => { test('Check page vertical layout example against snapshot', () => { - const Header = ; + const masthead = ; const Sidebar = ( Navigation @@ -30,7 +30,7 @@ describe('Page', () => { ); const { asFragment } = render( - + Section with default background ); @@ -39,7 +39,7 @@ describe('Page', () => { }); test('Check dark page against snapshot', () => { - const Header = ; + const masthead = ; const Sidebar = ( Navigation @@ -47,7 +47,7 @@ describe('Page', () => { ); const { asFragment } = render( - + Section with default background ); @@ -56,11 +56,11 @@ describe('Page', () => { }); test('Check page horizontal layout example against snapshot', () => { - const Header = ; + const masthead = ; const Sidebar = ; const { asFragment } = render( - + Section with default background ); @@ -69,7 +69,7 @@ describe('Page', () => { }); test('Check page to verify breadcrumb is created', () => { - const Header = ; + const masthead = ; const Sidebar = ; const PageBreadcrumb = () => ( @@ -83,7 +83,7 @@ describe('Page', () => { ); const { asFragment } = render( - }> + }> Section with default background ); @@ -93,7 +93,7 @@ describe('Page', () => { }); test('Verify sticky top breadcrumb on all height breakpoints', () => { - const Header = ; + const masthead = ; const Sidebar = ; const PageBreadcrumb = () => ( @@ -109,7 +109,7 @@ describe('Page', () => { const { asFragment } = render( } breadcrumbProps={{ stickyOnBreakpoint: { sm: 'top', md: 'top', lg: 'top', xl: 'top', '2xl': 'top' } }} @@ -123,7 +123,7 @@ describe('Page', () => { }); test('Verify sticky bottom breadcrumb on all height breakpoints', () => { - const Header = ; + const masthead = ; const Sidebar = ; const PageBreadcrumb = () => ( @@ -139,7 +139,7 @@ describe('Page', () => { const { asFragment } = render( } breadcrumbProps={{ @@ -155,11 +155,11 @@ describe('Page', () => { }); test('Check page to verify breadcrumb is created - PageBreadcrumb syntax', () => { - const Header = ; + const masthead = ; const Sidebar = ; const { asFragment } = render( - + Section Home @@ -179,11 +179,11 @@ describe('Page', () => { }); test('Verify sticky top breadcrumb on all height breakpoints - PageBreadcrumb syntax', () => { - const Header = ; + const masthead = ; const Sidebar = ; const { asFragment } = render( - + Section Home @@ -203,11 +203,11 @@ describe('Page', () => { }); test('Sticky bottom breadcrumb on all height breakpoints - PageBreadcrumb syntax', () => { - const Header = ; + const masthead = ; const Sidebar = ; const { asFragment } = render( - + @@ -229,11 +229,11 @@ describe('Page', () => { }); test('Check page to verify nav is created - PageNavigation syntax', () => { - const Header = ; + const masthead = ; const Sidebar = ; const { asFragment } = render( - +