-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathFooter.tsx
83 lines (75 loc) · 1.61 KB
/
Footer.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
import React from "react"
import {
Box,
useMultiStyleConfig,
List,
ListItem,
LinkProps,
} from "@chakra-ui/react"
import { externalHref } from "#/constants"
import { AcreSignIcon } from "#/assets/icons"
import { useMobileMode } from "#/hooks"
import LinkButton from "./shared/LinkButton"
type FooterListItem = Pick<LinkProps, "href" | "children">
const NAVIGATION: FooterListItem[] = [
{
children: "Acre.fi",
href: externalHref.WEBSITE,
},
{
children: "Docs",
href: externalHref.DOCS,
},
{
children: "FAQ",
href: externalHref.FAQ,
},
{
children: "Blog",
href: externalHref.BLOG,
},
{
children: "Discord",
href: externalHref.DISCORD,
},
{
children: "X",
href: externalHref.X,
},
]
const DOCUMENTS: FooterListItem[] = [
{
children: "Privacy Policy",
href: externalHref.PRIVACY_POLICY,
},
{
children: "Terms of Use",
href: externalHref.TERMS_OF_USE,
},
]
const getItemsList = (
items: FooterListItem[],
styles: ReturnType<typeof useMultiStyleConfig>,
) => (
<List __css={styles.list}>
{items.map((link) => (
<ListItem key={link.href}>
<LinkButton isExternal {...link} />
</ListItem>
))}
</List>
)
export default function Footer() {
const styles = useMultiStyleConfig("Footer")
const isMobileMode = useMobileMode()
if (isMobileMode) return null
return (
<Box as="footer" __css={styles.container}>
<Box __css={styles.wrapper}>
<AcreSignIcon __css={styles.logo} />
{getItemsList(NAVIGATION, styles)}
{getItemsList(DOCUMENTS, styles)}
</Box>
</Box>
)
}