-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat(Page): add prop to set width of drawer #10279
Conversation
Preview: https://patternfly-react-pr-10279.surge.sh A11y report: https://patternfly-react-pr-10279-a11y.surge.sh |
@@ -302,6 +305,7 @@ class Page extends React.Component<PageProps, PageState> { | |||
className={css(styles.pageMain)} | |||
tabIndex={mainTabIndex} | |||
aria-label={mainAriaLabel} | |||
style={{ width: `${drawerWidth}` }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcoker do we want to set the --pf-v5-c-drawer__panel--md--FlexBasis
css var here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!! Left a few comments for review 👍
@@ -302,6 +305,7 @@ class Page extends React.Component<PageProps, PageState> { | |||
className={css(styles.pageMain)} | |||
tabIndex={mainTabIndex} | |||
aria-label={mainAriaLabel} | |||
style={{ width: `${drawerWidth}` }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8fbbe26
to
80f0343
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woot! LGTM, left some meta comments, the only one I think needs to update before merging is for drawerMinSize
since the comment is currently "The starting size of a resizable drawer" and should say the minimum drawer size instead.
@@ -39,11 +39,11 @@ export interface DrawerPanelContentProps extends Omit<React.HTMLProps<HTMLDivEle | |||
onResize?: (event: MouseEvent | TouchEvent | React.KeyboardEvent, width: number, id: string) => void; | |||
/** The minimum size of a drawer, in either pixels or percentage. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - should this comment match the others?
/** The minimum size of a drawer, in either pixels or percentage. */ | |
/** The minimum size of a drawer. */ |
@@ -39,11 +39,11 @@ export interface DrawerPanelContentProps extends Omit<React.HTMLProps<HTMLDivEle | |||
onResize?: (event: MouseEvent | TouchEvent | React.KeyboardEvent, width: number, id: string) => void; | |||
/** The minimum size of a drawer, in either pixels or percentage. */ | |||
minSize?: string; | |||
/** The starting size of a resizable drawer, in either pixels or percentage. */ | |||
/** The starting size of a resizable drawer. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't notice this before, but this says starting size of a resizable drawer, but from what I can tell, this prop sets the size on any drawer (not just resizable)
@@ -27,6 +27,12 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> { | |||
notificationDrawer?: React.ReactNode; | |||
/** Flag indicating Notification drawer in expanded */ | |||
isNotificationDrawerExpanded?: boolean; | |||
/** Sets default drawer width size */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sets vertical drawers, too, so we can probably just leave off "width"
/** Sets default drawer width size */ | |
/** Sets default drawer size */ |
@@ -27,6 +27,12 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> { | |||
notificationDrawer?: React.ReactNode; | |||
/** Flag indicating Notification drawer in expanded */ | |||
isNotificationDrawerExpanded?: boolean; | |||
/** Sets default drawer width size */ | |||
drawerDefaultSize?: string; | |||
/** The starting size of a resizable drawer */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we match the wording of the default prop
/** The starting size of a resizable drawer */ | |
/** Sets the minimum drawer size */ |
drawerDefaultSize?: string; | ||
/** The starting size of a resizable drawer */ | ||
drawerMinSize?: string; | ||
/** The maximum size of a drawer */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** The maximum size of a drawer */ | |
/** Sets the max drawer size */ |
80f0343
to
269ac65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎃
What: Closes #10133