-
Notifications
You must be signed in to change notification settings - Fork 14
/
ApplicationLayoutCodePage.tsx
204 lines (200 loc) · 6.28 KB
/
ApplicationLayoutCodePage.tsx
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import {
DxcParagraph,
DxcFlex,
DxcTable,
DxcLink,
} from "@dxc-technology/halstack-react";
import DocFooter from "@/common/DocFooter";
import QuickNavContainer from "@/common/QuickNavContainer";
import QuickNavContainerLayout from "@/common/QuickNavContainerLayout";
import Link from "next/link";
import TableCode from "@/common/TableCode";
import StatusBadge from "@/common/StatusBadge";
import Code from "@/common/Code";
const ApplicationLayoutPropsTable = () => (
<DxcTable>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>visibilityToggleLabel</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
Text to be placed next to the hamburger button that toggles the
visibility of the sidenav.
</td>
<td>-</td>
</tr>
<tr>
<td>header</td>
<td>
<TableCode>React.ReactNode</TableCode>
</td>
<td>
Header of the application layout shown at the top of the screen. It is
optional and if it is not specified, the default header will be shown.
Please check the Header documentation{" "}
<Link href="/components/header" passHref legacyBehavior>
<DxcLink>here</DxcLink>
</Link>
.
</td>
<td>-</td>
</tr>
<tr>
<td>footer</td>
<td>
<TableCode>React.ReactNode</TableCode>
</td>
<td>
Footer of the application layout shown at the bottom of the screen. It
is optional and if it is not specified, the default header will be
shown. Please check the Footer documentation{" "}
<Link href="/components/footer" passHref legacyBehavior>
<DxcLink>here</DxcLink>
</Link>
.
</td>
<td>-</td>
</tr>
<tr>
<td>sidenav</td>
<td>
<TableCode>React.ReactNode</TableCode>
</td>
<td>
Sidenav of the application layout shown at the left side of the
screen. Please check the Sidenav documentation{" "}
<Link href="/components/sidenav" passHref legacyBehavior>
<DxcLink>here</DxcLink>
</Link>
.
</td>
<td>-</td>
</tr>
<tr>
<td>
<DxcFlex direction="column" gap="0.25rem" alignItems="baseline">
<StatusBadge status="required" />
children
</DxcFlex>
</td>
<td>
<TableCode>React.ReactNode</TableCode>
</td>
<td>
Use the <Code>DxcApplicationLayout.Main</Code> provided to render main
content.
</td>
<td>-</td>
</tr>
</tbody>
</DxcTable>
);
const sections = [
{
title: "Props",
content: <ApplicationLayoutPropsTable />,
},
{
title: "DxcApplicationLayout.Main",
content: (
<DxcParagraph>
Everything between the tags will be displayed as the main content of the
application layout.
</DxcParagraph>
),
},
{
title: "DxcApplicationLayout.useResponsiveSidenavVisibility",
content: (
<DxcParagraph>
Custom hook that returns a function to manually change the visibility of
the sidenav in responsive mode. This can be very useful for cases where
a custom sidenav is being used and some of its inner elements can close
it (for example, a navigation link).
</DxcParagraph>
),
},
{
title: "Examples",
subSections: [
{
title: "Basic usage",
content: (
<iframe
src="https://codesandbox.io/embed/basic-usage-pi619r?fontsize=14&hidenavigation=1&theme=dark"
style={{
width: "100%",
minHeight: "500px",
border: "0",
borderRadius: "4px",
overflow: "hidden",
}}
title="Basic usage"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>
),
},
{
title: "With sidenav",
content: (
<iframe
src="https://codesandbox.io/embed/with-sidenav-xce9s2?fontsize=14&hidenavigation=1&theme=dark"
style={{
width: "100%",
minHeight: "500px",
border: "0",
borderRadius: "4px",
overflow: "hidden",
}}
title="With sidenav"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>
),
},
{
title: "Custom header and footer",
content: (
<iframe
src="https://codesandbox.io/embed/custom-footer-and-header-lt3gkv?fontsize=14&hidenavigation=1&theme=dark"
style={{
width: "100%",
minHeight: "500px",
border: "0",
borderRadius: "4px",
overflow: "hidden",
}}
title="Custom footer and header"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>
),
},
],
},
];
const ApplicationLayoutCodePage = () => {
return (
<DxcFlex direction="column" gap="4rem">
<QuickNavContainerLayout>
<QuickNavContainer
sections={sections}
startHeadingLevel={2}
></QuickNavContainer>
</QuickNavContainerLayout>
<DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/website/screens/components/application-layout/code/ApplicationLayoutCodePage.tsx" />
</DxcFlex>
);
};
export default ApplicationLayoutCodePage;