Skip to content
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

refactor(Page): Change the defaultManagedSidebarOpen prop name for co… #2664

Merged
merged 1 commit into from Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/patternfly-4/react-core/src/components/Page/Page.tsx
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
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
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