-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.tsx
More file actions
85 lines (78 loc) · 2.55 KB
/
index.tsx
File metadata and controls
85 lines (78 loc) · 2.55 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
import React from "react";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import styles from "./styles.module.scss";
import Logo from "@theme/Logo";
import { BRAND, REGION } from "../../constants/env";
import { getNavLinks, getLicenceLinks } from "./_config";
function getCopyrightNotice(region: string): string {
const year = new Date().getFullYear();
const company = region === "cn" ? "美味书签(上海)信息技术有限公司" : "LeanCloud";
return `© ${year} ${company}`;
}
function Footer() {
const {
i18n: { currentLocale },
} = useDocusaurusContext();
return (
<footer className={styles.footer}>
<div className={styles.stage}>
<div>
<section>
<section className={styles.logo}>
{/* @ts-ignore */}
<Logo noLink noLabel reversed={BRAND === "leancloud"} />
</section>
</section>
<section>
<section className={styles.nav}>
{getNavLinks(BRAND, REGION, currentLocale).map((item) =>
"link" in item ? (
<Link
to={item.link}
className={styles.navItem}
key={item.label}
>
{item.label}
</Link>
) : (
<a
href={item.url}
target="_blank"
rel="noreferrer nofollow noopener"
className={styles.navItem}
key={item.label}
>
{item.label}
</a>
)
)}
</section>
<section className={styles.info}>
<div>{getCopyrightNotice(REGION)}</div>
</section>
</section>
</div>
{getLicenceLinks(BRAND, REGION, currentLocale).length > 0 && (
<div>
<section className={styles.licence}>
{getLicenceLinks(BRAND, REGION, currentLocale).map((item) => (
<a
href={item.link}
target="_blank"
rel="noreferrer nofollow noopener"
className={styles.licenceItem}
key={item.label}
>
{item.icon && <img src={item.icon} alt={item.label} />}
{item.label}
</a>
))}
</section>
</div>
)}
</div>
</footer>
);
}
export default Footer;