forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPageMainSectionVariations.tsx
More file actions
87 lines (81 loc) · 2.54 KB
/
PageMainSectionVariations.tsx
File metadata and controls
87 lines (81 loc) · 2.54 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { useState } from 'react';
import {
Page,
Masthead,
MastheadMain,
MastheadToggle,
MastheadBrand,
MastheadLogo,
MastheadContent,
PageSidebar,
PageSidebarBody,
PageSection,
PageToggleButton,
Toolbar,
ToolbarContent,
ToolbarItem
} from '@patternfly/react-core';
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
export const PageMainSectionPadding: React.FunctionComponent = () => {
const [isSidebarOpen, setIsSidebarOpen] = useState(true);
const onSidebarToggle = () => {
setIsSidebarOpen(!isSidebarOpen);
};
const headerToolbar = (
<Toolbar id="main-variations-toolbar">
<ToolbarContent>
<ToolbarItem>header-tools</ToolbarItem>
</ToolbarContent>
</Toolbar>
);
const header = (
<Masthead>
<MastheadMain>
<MastheadToggle>
<PageToggleButton
variant="plain"
aria-label="Global navigation"
isSidebarOpen={isSidebarOpen}
onSidebarToggle={onSidebarToggle}
id="main-variations-nav-toggle"
>
<BarsIcon />
</PageToggleButton>
</MastheadToggle>
<MastheadBrand>
<MastheadLogo href="https://patternfly.org" target="_blank">
Logo
</MastheadLogo>
</MastheadBrand>
</MastheadMain>
<MastheadContent>{headerToolbar}</MastheadContent>
</Masthead>
);
const sidebar = (
<PageSidebar isSidebarOpen={isSidebarOpen} id="main-variations-sidebar">
<PageSidebarBody>Navigation</PageSidebarBody>
</PageSidebar>
);
return (
<Page header={header} sidebar={sidebar}>
<PageSection type="subnav" aria-label="With subnav type">
Section with <code>type="subnav"</code> for horizontal subnav navigation
</PageSection>
<PageSection type="nav" aria-label="With nav type">
Section with <code>type="nav"</code> for tertiary navigation
</PageSection>
<PageSection type="tabs" aria-label="With tabs type">
Section with <code>type="tabs"</code> for tabs
</PageSection>
<PageSection type="breadcrumb" aria-label="With breadcrumb type">
Section with <code>type="breadcrumb"</code> for breadcrumbs
</PageSection>
<PageSection aria-label="With default type">
Section without <code>type</code> prop or <code>type="default"</code> for main sections
</PageSection>
<PageSection type="wizard" aria-label="With wizard type">
Section with <code>type="wizard"</code> for wizards
</PageSection>
</Page>
);
};