/
index.tsx
156 lines (149 loc) · 4.1 KB
/
index.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* eslint-disable react/prop-types */
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { FC } from 'react';
import React from 'react';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import { Icon } from '@iconify/react';
import githubIcon from '@iconify/icons-akar-icons/github-fill';
import twitterIcon from '@iconify/icons-akar-icons/twitter-fill';
import linkedInIcon from '@iconify/icons-akar-icons/linkedin-fill';
import { LazyLoadImage } from 'react-lazy-load-image-component';
import style from './styles.module.scss';
const footer = {
links: [
{
title: 'ASF',
items: [
{
label: 'Foundation',
to: 'https://www.apache.org/',
},
{
label: 'License',
to: 'https://www.apache.org/licenses/',
},
{
label: 'Events',
to: 'https://www.apache.org/events/',
},
{
label: 'Security',
to: 'https://www.apache.org/security/',
},
{
label: 'Sponsorship',
to: 'https://www.apache.org/foundation/sponsorship.html',
},
{
label: 'Thanks',
to: 'https://www.apache.org/foundation/thanks.html',
},
],
},
{
title: 'Community',
items: [
{
icon: githubIcon,
label: 'GitHub Issues',
to: 'https://github.com/apache/streampipes/issues',
},
{
icon: githubIcon,
label: 'Github Discussions',
to: 'https://github.com/apache/streampipes/discussions',
},
{
icon: twitterIcon,
label: 'Twitter',
to: 'https://twitter.com/StreamPipes',
},
{
icon: linkedInIcon,
label: 'LinkedIn',
to: 'https://www.linkedin.com/company/apache-streampipes',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog/',
target: '_parent',
}, {
label: 'Privacy',
to: 'https://privacy.apache.org/policies/privacy-policy-public.html',
target: '_parent',
}
],
},
],
logo: {
alt: 'Apache Software Foundation',
src: '/img/asf_logo_wide.svg',
href: 'https://www.apache.org/',
},
copyright:
`Copyright © 2019-${new Date().getFullYear()} The Apache Software Foundation. Apache StreamPipes, Apache, the Apache feather logo, and the Apache StreamPipes project logo are either registered trademarks or trademarks of the Apache Software Foundation.`,
};
const FooterLink = ({
to, icon, href, label, prependBaseUrlToHref, ...props
}) => {
const toUrl = useBaseUrl(to);
const normalizedHref = useBaseUrl(href, {
forcePrependBaseUrl: true,
});
const hrefObj = href
? {href: prependBaseUrlToHref ? normalizedHref : href}
: {to: toUrl};
return (
<Link
{...hrefObj}
{...props}
>
<Icon icon={icon}/>
<span>{label}</span>
</Link>
);
};
const Footer: FC = () => {
const {copyright, links, logo} = footer;
if (!footer) {
return null;
}
return (
<footer className={style.container}>
{links && links.length > 0 && (
<div className={style.linksRow}>
{links.map(({title, items}) => (
<div key={title} className={style.linksCol}>
<div>{title}</div>
<ul>
{items.map((v) => (
<li key={v.to} className="footer__item">
<FooterLink {...v} />
</li>
))}
</ul>
</div>
))}
</div>
)}
<div className={style.copyright}>
<Link href={logo.href}>
<LazyLoadImage alt={logo.alt} src={logo.src} height="40px" width="231.25px"/>
</Link>
<div className={style.text}>{copyright}</div>
</div>
</footer>
);
};
export default Footer;