forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPageSidebarBody.tsx
More file actions
40 lines (38 loc) · 1.32 KB
/
Copy pathPageSidebarBody.tsx
File metadata and controls
40 lines (38 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;
/** Flag indicating that the page sidebar body is for a context selector/perspective switcher */
isContextSelector?: boolean;
}
export const PageSidebarBody: React.FunctionComponent<PageSidebarBodyProps> = ({
children,
className,
usePageInsets,
isFilled,
isContextSelector,
...props
}: PageSidebarBodyProps) => (
<div
className={css(
styles.pageSidebarBody,
usePageInsets && styles.modifiers.pageInsets,
isFilled === false && styles.modifiers.noFill,
isFilled === true && styles.modifiers.fill,
isContextSelector === true && styles.modifiers.contextSelector,
className
)}
{...props}
>
{children}
</div>
);
PageSidebarBody.displayName = 'PageSidebarBody';