-
Notifications
You must be signed in to change notification settings - Fork 0
/
[locale].tsx
42 lines (36 loc) · 1.23 KB
/
[locale].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
import * as React from "react"
import { PageProps } from "gatsby"
import Hero from "../components/hero"
import MyNFTs from "../components/my-nfts"
import Section from "../components/section"
import Layout from "../components/layout"
import Seo from "../components/seo"
import Markdown from "../components/markdown"
import Footer from "../components/footer"
import type { DecoratedLocale } from "../../lib/locales"
import Reveal from "../components/reveal"
import { navigate } from "gatsby"
type PageContext = {
locale: DecoratedLocale
}
const Landing: React.FC<PageProps<{}, PageContext>> = ({ location, pageContext: { locale } }) => {
const params = new URLSearchParams(location.search)
const transactionHashes = params.get('transactionHashes')
if (transactionHashes) {
return <Reveal onClose={() => navigate(`/${locale.id}`)} />
}
return (
<Layout title={locale.title}>
<Seo lang={locale.id} title={locale.title} description={locale.description} />
<MyNFTs />
<Hero heroTree={locale.hero} />
{locale.extraSections?.map((section, i) => (
<Section key={i} {...section}>
<Markdown children={section.text} />
</Section>
))}
<Footer />
</Layout>
)
}
export default Landing