Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 677
PageLayout: Update divider prop responsive API#2198
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d6298c2ff34a35e7c151231ba88c205788d4b6a267File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| "@primer/react": minor | ||
| --- | ||
| * Updated the `divider` prop in `PageLayout.Header`, `PageLayout.Pane`, and `PageLayout.Footer` to use the new responsive prop API introduced in https://github.com/primer/react/pull/2174. | ||
| * Deprecated the `dividerWhenNarrow` prop in favor of the new responsive prop API | ||
| **Before** | ||
| ``` | ||
| divider="line" | ||
| dividerWhenNarrow="filled" | ||
| ``` | ||
| **After** | ||
| ``` | ||
| divider={{regular: 'line', narrow: 'filled'}} | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -48,7 +48,8 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | ||
| <PageLayout.Content> | ||
| <Placeholder label="Content" height={240} /> | ||
| </PageLayout.Content> | ||
| <PageLayout.Pane divider="line"> | ||
| {/* You can change the divider based on the viewport width */} | ||
| <PageLayout.Pane divider={{narrow: 'line'}}> | ||
| <Placeholder label="Pane" height={120} /> | ||
| </PageLayout.Pane> | ||
| <PageLayout.Footer divider="line"> | ||
| @@ -172,25 +173,39 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | ||
| <PropsTableRow | ||
| name="divider" | ||
| type={`| 'none' | ||
| | 'line'`} | ||
| | 'line' | ||
| | { | ||
| narrow?: | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled' | ||
| regular?: | ||
| | 'none' | ||
| | 'line' | ||
| wide?: | ||
| | 'none' | ||
| | 'line' | ||
| }`} | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed! Open to ideas here. | ||
| defaultValue="'none'" | ||
| /> | ||
| <PropsTableRow | ||
| name="dividerWhenNarrow" | ||
| deprecated | ||
| type={`| 'inherit' | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled'`} | ||
| defaultValue="'inherit'" | ||
| description="Use the divider prop with a responsive value instead." | ||
| /> | ||
| <PropsTableRow | ||
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the header is hidden." | ||
| /> | ||
| @@ -213,10 +228,10 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | ||
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the content is hidden." | ||
| /> | ||
| @@ -250,25 +265,39 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | ||
| <PropsTableRow | ||
| name="divider" | ||
| type={`| 'none' | ||
| | 'line'`} | ||
| | 'line' | ||
| | { | ||
| narrow?: | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled' | ||
| regular?: | ||
| | 'none' | ||
| | 'line' | ||
| wide?: | ||
| | 'none' | ||
| | 'line' | ||
| }`} | ||
| defaultValue="'none'" | ||
| /> | ||
| <PropsTableRow | ||
| name="dividerWhenNarrow" | ||
| deprecated | ||
| type={`| 'inherit' | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled'`} | ||
| defaultValue="'inherit'" | ||
| description="Use the divider prop with a responsive value instead." | ||
| /> | ||
| <PropsTableRow | ||
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the pane is hidden." | ||
| /> | ||
| @@ -281,25 +310,39 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | ||
| <PropsTableRow | ||
| name="divider" | ||
| type={`| 'none' | ||
| | 'line'`} | ||
| | 'line' | ||
| | { | ||
| narrow?: | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled' | ||
| regular?: | ||
| | 'none' | ||
| | 'line' | ||
| wide?: | ||
| | 'none' | ||
| | 'line' | ||
| }`} | ||
| defaultValue="'none'" | ||
| /> | ||
| <PropsTableRow | ||
| name="dividerWhenNarrow" | ||
| deprecated | ||
| type={`| 'inherit' | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled'`} | ||
| defaultValue="'inherit'" | ||
| description="Use the divider prop with a responsive value instead." | ||
| /> | ||
| <PropsTableRow | ||
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the footer is hidden." | ||
| /> | ||
Uh oh!
There was an error while loading. Please reload this page.

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.
this will be really helpful for next major changelog 🏆