-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFooter.tsx
More file actions
89 lines (81 loc) · 1.75 KB
/
Copy pathFooter.tsx
File metadata and controls
89 lines (81 loc) · 1.75 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import React from "react"
import {
Box,
useMultiStyleConfig,
List,
ListItem,
LinkProps,
Link,
Button,
Icon,
} from "@chakra-ui/react"
import { externalHref } from "#/constants"
import { AcreSignIcon } from "#/assets/icons"
import { useMobileMode } from "#/hooks"
import { IconArrowUpRight } from "@tabler/icons-react"
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: "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}>
<Button
as={Link}
__css={styles.link}
iconSpacing={0}
rightIcon={<Icon as={IconArrowUpRight} color="acre.50" />}
{...link}
isExternal
/>
</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>
)
}