-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathDefault.tsx
More file actions
59 lines (47 loc) · 1.45 KB
/
Default.tsx
File metadata and controls
59 lines (47 loc) · 1.45 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
import Article from '@node-core/ui-components/Containers/Article';
import WithBreadcrumbs from '#site/components/withBreadcrumbs';
import WithFooter from '#site/components/withFooter';
import WithNavBar from '#site/components/withNavBar';
import WithSidebar from '#site/components/withSidebar';
import WithSidebarCrossLinks from '#site/components/withSidebarCrossLinks';
import WithTOC from '#site/components/withTOC';
import type { NavigationKeys } from '../types';
import type { FC, PropsWithChildren } from 'react';
type DefaultLayoutProps = {
navKeys?: Array<NavigationKeys>;
showBreadcrumbs?: boolean;
};
const DefaultLayout: FC<PropsWithChildren<DefaultLayoutProps>> = ({
children,
navKeys = [],
showBreadcrumbs = false,
}) => (
<>
<WithNavBar />
<Article>
<WithSidebar navKeys={navKeys} />
<div>
<WithTOC />
<main id="main" tabIndex={-1}>
{children}
</main>
</div>
{showBreadcrumbs && <WithBreadcrumbs navKeys={navKeys} />}
</Article>
<WithFooter />
</>
);
export default DefaultLayout;
export const AboutPageLayout: FC<PropsWithChildren> = props => (
<DefaultLayout
navKeys={['about', 'getInvolved']}
showBreadcrumbs={true}
{...props}
/>
);
export const LearnPageLayout: FC<PropsWithChildren> = ({ children }) => (
<DefaultLayout navKeys={['learn']} showBreadcrumbs={true}>
{children}
<WithSidebarCrossLinks navKey="learn" />
</DefaultLayout>
);