forked from microwavenby/shoegaze-stack
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLayout.tsx
68 lines (65 loc) · 1.67 KB
/
Layout.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
import { Trans } from "react-i18next";
import type { ReactElement } from "react";
import { Alert, Title, Header, Footer } from "@trussworks/react-uswds";
import TransLinks from "./TransLinks";
export type LayoutProps = {
children: ReactElement;
demoMode?: string;
missingData?: string;
};
const Layout = ({
children,
demoMode,
missingData,
}: LayoutProps): ReactElement => {
return (
<div className="container">
{demoMode === "true" ? (
<Alert type="warning" headingLevel="h6" slim={true} role="status">
<Trans i18nKey={"Demo.alertText"} />
</Alert>
) : (
""
)}
<Header extended>
<div className="usa-navbar">
<Title id="extended-logo">
<em className="usa-logo__text text-primary-darker">
<Trans i18nKey="Layout.header" />
</em>
</Title>
</div>
</Header>
<main className="main">
<div className="grid-row">
<div className="desktop:grid-col-8 padding-2 padding-bottom-8">
{missingData === "true" ? (
<Alert
type="error"
headingLevel="h4"
className="margin-bottom-3"
role="alert"
>
<Trans i18nKey={"routingError"} />
</Alert>
) : (
""
)}
</div>
</div>
{children}
</main>
<Footer
size="slim"
primary=""
secondary={
<TransLinks
i18nTextKey="Layout.footer.text"
i18nLinkKey="Layout.footer.links"
/>
}
/>
</div>
);
};
export default Layout;