-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(PageSidebar): added SidebarBody component
- Loading branch information
1 parent
d92de5c
commit 524c19f
Showing
36 changed files
with
433 additions
and
305 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
36 changes: 36 additions & 0 deletions
36
packages/react-core/src/components/Page/PageSidebarBody.tsx
This file contains 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react'; | ||
import styles from '@patternfly/react-styles/css/components/Page/page'; | ||
import { css } from '@patternfly/react-styles'; | ||
|
||
export interface PageSidebarBodyProps extends React.HTMLProps<HTMLDivElement> { | ||
/** Content rendered inside the page sidebar body */ | ||
children?: React.ReactNode; | ||
/** Additional classes added to the page sidebar body */ | ||
className?: string; | ||
/** Flag indicating that the page sidebar body should use page insets. */ | ||
usePageInsets?: boolean; | ||
/** Flag indicating that the page sidebar body should fill the available vertical space. */ | ||
isFilled?: boolean; | ||
} | ||
|
||
export const PageSidebarBody: React.FunctionComponent<PageSidebarBodyProps> = ({ | ||
children, | ||
className, | ||
usePageInsets, | ||
isFilled, | ||
...props | ||
}: PageSidebarBodyProps) => ( | ||
<div | ||
className={css( | ||
styles.pageSidebarBody, | ||
usePageInsets && styles.modifiers.pageInsets, | ||
isFilled === false && styles.modifiers.noFill, | ||
isFilled === true && styles.modifiers.fill, | ||
className | ||
)} | ||
{...props} | ||
> | ||
{children} | ||
</div> | ||
); | ||
PageSidebarBody.displayName = 'PageSidebarBody'; |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.