FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor(Page): Change the defaultManagedSidebarOpen prop name for co… by tlabaj · Pull Request #2664 · patternfly/patternfly-react · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .snap  (1) .tsx  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
      • Page.tsx
        • Page.test.tsx.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> {
/**
* If true, the managed sidebar is initially open for desktop view
*/
defaultManagedSidebarOpen?: boolean;
defaultManagedSidebarIsOpen?: boolean;
/**
* Can add callback to be notified when resize occurs, for example to set the sidebar isNav prop to false for a width < 768px
* Returns object { mobileView: boolean, windowSize: number }
Expand All @@ -60,16 +60,16 @@ export class Page extends React.Component<PageProps, PageState> {
sidebar: null as React.ReactNode,
skipToContent: null as React.ReactElement,
isManagedSidebar: false,
defaultManagedSidebarOpen: true,
defaultManagedSidebarIsOpen: true,
onPageResize: ():void => null,
mainContainerId: null as string
};

constructor(props: PageProps) {
super(props);

const {isManagedSidebar, defaultManagedSidebarOpen} = props;
const managedSidebarOpen = !isManagedSidebar ? true : defaultManagedSidebarOpen;
const {isManagedSidebar, defaultManagedSidebarIsOpen} = props;
const managedSidebarOpen = !isManagedSidebar ? true : defaultManagedSidebarIsOpen;
this.state = {
desktopIsNavOpen: managedSidebarOpen,
mobileIsNavOpen: false,
Expand Down Expand Up @@ -127,7 +127,7 @@ export class Page extends React.Component<PageProps, PageState> {
skipToContent,
mainContainerId,
isManagedSidebar,
defaultManagedSidebarOpen,
defaultManagedSidebarIsOpen,
onPageResize,
...rest
} = this.props;
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`Check page horizontal layout example against snapshot 1`] = `
aria-label="Page layout"
breadcrumb={null}
className="my-page-class"
defaultManagedSidebarOpen={true}
defaultManagedSidebarIsOpen={true}
header={
<Unknown
avatar=" | Avatar"
Expand Down Expand Up @@ -126,7 +126,7 @@ exports[`Check page to verify breadcrumb is created 1`] = `
aria-label="Page layout"
breadcrumb={<PageBreadcrumb />}
className="my-page-class"
defaultManagedSidebarOpen={true}
defaultManagedSidebarIsOpen={true}
header={
<Unknown
avatar=" | Avatar"
Expand Down Expand Up @@ -430,7 +430,7 @@ exports[`Check page to verify skip to content points to main content region 1`]
</Unknown>
}
className="my-page-class"
defaultManagedSidebarOpen={true}
defaultManagedSidebarIsOpen={true}
header={
<Unknown
avatar=" | Avatar"
Expand Down Expand Up @@ -732,7 +732,7 @@ exports[`Check page vertical layout example against snapshot 1`] = `
aria-label="Page layout"
breadcrumb={null}
className="my-page-class"
defaultManagedSidebarOpen={true}
defaultManagedSidebarIsOpen={true}
header={
<Unknown
avatar=" | Avatar"
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class PageManagedSidebarClosedDemo extends React.Component {
const Sidebar = <PageSidebar nav="Navigation" />;

return (
<Page id="page-managed-sidebar-closed-demo" header={Header} sidebar={Sidebar} isManagedSidebar defaultManagedSidebarOpen={false}>
<Page id="page-managed-sidebar-closed-demo" header={Header} sidebar={Sidebar} isManagedSidebar defaultManagedSidebarIsOpen={false}>
<PageSection variant={PageSectionVariants.darker}>Section with darker background</PageSection>
<PageSection variant={PageSectionVariants.dark}>Section with dark background</PageSection>
<PageSection variant={PageSectionVariants.light}>Section with light background</PageSection>
Expand Down

Back | FazBrowse Home | New Git URL