forked from LAION-AI/Open-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFooter.tsx
89 lines (84 loc) · 3.2 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
84
85
86
87
88
89
import { Box, Divider, Flex, Text, useColorMode } from "@chakra-ui/react";
import Image from "next/image";
import Link from "next/link";
import { useTranslation } from "next-i18next";
import { useMemo } from "react";
export function Footer() {
const { t } = useTranslation();
const { colorMode } = useColorMode();
const backgroundColor = colorMode === "light" ? "white" : "gray.800";
const textColor = colorMode === "light" ? "black" : "gray.300";
return (
<footer>
<Box bg={backgroundColor}>
<Divider />
<Box
display="flex"
flexDirection={["column", "row"]}
justifyContent="space-between"
alignItems="center"
gap="6"
p="8"
pb={["14", "8"]}
w="full"
mx="auto"
maxWidth="7xl"
>
<Flex alignItems="center">
<Box pr="2">
<Link href="/" aria-label="Home">
<Image src="/images/logos/logo.svg" width="52" height="52" alt="logo" />
</Link>
</Box>
<Box>
<Text fontSize="md" fontWeight="bold">
{t("title")}
</Text>
<Text fontSize="sm" color="gray.500">
{t("conversational")}
</Text>
</Box>
</Flex>
<nav>
<Box display="flex" flexDirection={["column", "row"]} gap={["6", "14"]} fontSize="sm">
<Flex direction="column" alignItems={["center", "start"]}>
<Text fontWeight="bold" color={textColor}>
{t("legal")}
</Text>
<FooterLink href="/privacy-policy" label={t("privacy_policy")} />
<FooterLink href="/terms-of-service" label={t("terms_of_service")} />
</Flex>
<Flex direction="column" alignItems={["center", "start"]}>
<Text fontWeight="bold" color={textColor}>
{t("connect")}
</Text>
<FooterLink href="https://github.com/LAION-AI/Open-Assistant" label={t("github")} />
<FooterLink href="https://ykilcher.com/open-assistant-discord" label={t("discord")} />
<FooterLink href="https://huggingface.co/OpenAssistant" label={t("hugging_face")} />
</Flex>
<Flex direction="column" alignItems={["center", "start"]}>
<Text fontWeight="bold" color={textColor}>
{t("about")}
</Text>
<FooterLink href="/team" label={t("who_are_we")} />
<FooterLink href="https://projects.laion.ai/Open-Assistant" label={t("docs")} />
<FooterLink href="https://projects.laion.ai/Open-Assistant/docs/faq" label={t("faq")} />
</Flex>
</Box>
</nav>
</Box>
</Box>
</footer>
);
}
const FooterLink = ({ href, label }: { href: string; label: string }) =>
useMemo(
() => (
<Link href={href} rel="noopener noreferrer nofollow" target="_blank" aria-label={label}>
<Text color="blue.500" textUnderlineOffset={2} _hover={{ textDecoration: "underline" }}>
{label}
</Text>
</Link>
),
[href, label]
);