-
-
Notifications
You must be signed in to change notification settings - Fork 229
/
Copy pathExplorerIndexPage.tsx
44 lines (43 loc) · 1.44 KB
/
ExplorerIndexPage.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
import { Head } from "./Head.js"
import { Html } from "./Html.js"
import { EXPLORERS_ROUTE_FOLDER } from "@ourworldindata/explorer"
import { SiteHeader } from "./SiteHeader.js"
import { SiteFooter } from "./SiteFooter.js"
import { SiteFooterContext } from "@ourworldindata/types"
import {
__OWID_EXPLORER_INDEX_PAGE_PROPS,
ExplorerIndex,
ExplorerIndexPageProps,
} from "./ExplorerIndex.js"
export const ExplorerIndexPage = ({
baseUrl,
explorers,
}: ExplorerIndexPageProps) => {
const inlineJs = `window.${__OWID_EXPLORER_INDEX_PAGE_PROPS} = ${JSON.stringify(
{
baseUrl,
explorers,
}
)}`
return (
<Html>
<Head
canonicalUrl={`${baseUrl}/${EXPLORERS_ROUTE_FOLDER}`}
pageTitle={`Data Explorers`}
pageDesc={"An index of all Our World in Data data explorers"}
baseUrl={baseUrl}
></Head>
<body>
<SiteHeader baseUrl={baseUrl} />
<main className="explorer-index-page grid grid-cols-12-full-width">
<ExplorerIndex baseUrl={baseUrl} explorers={explorers} />
</main>
<SiteFooter
baseUrl={baseUrl}
context={SiteFooterContext.explorerIndexPage}
/>
<script dangerouslySetInnerHTML={{ __html: inlineJs }} />
</body>
</Html>
)
}