Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/react-core/src/components/Page/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> {
isBreadcrumbGrouped?: boolean;
/** Additional content of the group */
additionalGroupedContent?: React.ReactNode;
/** HTML component used as main component of the page. Defaults to 'main', only pass in 'div' if another 'main' element already exists. */
mainComponent?: 'main' | 'div';
/** Additional props of the group */
groupProps?: PageGroupProps;
/** Additional props of the breadcrumb */
Expand All @@ -104,6 +106,7 @@ export class Page extends React.Component<PageProps, PageState> {
mainTabIndex: -1,
isNotificationDrawerExpanded: false,
onNotificationDrawerExpand: () => null,
mainComponent: 'main',
getBreakpoint,
getVerticalBreakpoint
};
Expand Down Expand Up @@ -229,6 +232,7 @@ export class Page extends React.Component<PageProps, PageState> {
getVerticalBreakpoint,
mainAriaLabel,
mainTabIndex,
mainComponent,
tertiaryNav,
isTertiaryNavGrouped,
isBreadcrumbGrouped,
Expand Down Expand Up @@ -288,8 +292,10 @@ export class Page extends React.Component<PageProps, PageState> {
</PageGroup>
) : null;

const Component: keyof JSX.IntrinsicElements = mainComponent;

const main = (
<main
<Component
ref={this.mainRef}
role={role}
id={mainContainerId}
Expand All @@ -301,7 +307,7 @@ export class Page extends React.Component<PageProps, PageState> {
{!isTertiaryNavGrouped && nav}
{!isBreadcrumbGrouped && crumb}
{children}
</main>
</Component>
);

const panelContent = <DrawerPanelContent>{notificationDrawer}</DrawerPanelContent>;
Expand Down