Skip to content

Commit

Permalink
Add drawerWidth prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiehuff committed Apr 15, 2024
1 parent 62810f1 commit 8fbbe26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-core/src/components/Page/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> {
notificationDrawer?: React.ReactNode;
/** Flag indicating Notification drawer in expanded */
isNotificationDrawerExpanded?: boolean;
/** Sets drawer width, in either pixels or percentage. */
drawerWidth?: string;
/** Flag indicating if breadcrumb width should be limited */
isBreadcrumbWidthLimited?: boolean;
/** Callback when notification drawer panel is finished expanding. */
Expand Down Expand Up @@ -219,6 +221,7 @@ class Page extends React.Component<PageProps, PageState> {
notificationDrawer,
isNotificationDrawerExpanded,
onNotificationDrawerExpand,
drawerWidth,
isTertiaryNavWidthLimited,
skipToContent,
role,
Expand Down Expand Up @@ -302,6 +305,7 @@ class Page extends React.Component<PageProps, PageState> {
className={css(styles.pageMain)}
tabIndex={mainTabIndex}
aria-label={mainAriaLabel}
style={{ width: `${drawerWidth}` }}
>
{group}
{!isTertiaryNavGrouped && nav}
Expand All @@ -310,7 +314,7 @@ class Page extends React.Component<PageProps, PageState> {
</Component>
);

const panelContent = <DrawerPanelContent>{notificationDrawer}</DrawerPanelContent>;
const panelContent = <DrawerPanelContent defaultSize={drawerWidth}>{notificationDrawer}</DrawerPanelContent>;

return (
<PageContextProvider value={context}>
Expand Down

0 comments on commit 8fbbe26

Please sign in to comment.