-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfooter.tsx
128 lines (125 loc) · 3.86 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
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
import {
FooterSection,
FooterSectionButton,
FooterSectionSocialMediaButton,
FooterSectionSocialMediaButtonGroup,
FooterSectionText,
FooterSectionTitle,
Footer as SwissFederalCiFooter,
} from "@interactivethings/swiss-federal-ci/dist/components";
import { t } from "@lingui/macro";
import { Link, SxProps } from "@mui/material";
import contentRoutes from "@/content-routes.json";
import { BUILD_COMMIT, BUILD_GITHUB_REPO, BUILD_VERSION } from "@/domain/env";
import { useLocale } from "@/locales/use-locale";
const mkVersionLink = () => {
let commitLink = "";
let href = "";
if (BUILD_GITHUB_REPO && BUILD_COMMIT) {
commitLink = BUILD_COMMIT.substr(0, 7);
href = `${BUILD_GITHUB_REPO}/commit/${BUILD_COMMIT}`;
}
if (BUILD_COMMIT) {
commitLink = `(${BUILD_COMMIT.substr(0, 7)})`;
}
return { title: `${BUILD_VERSION} ${commitLink}`, href, external: true };
};
export const Footer = ({ sx }: { sx?: SxProps }) => {
const locale = useLocale();
const legalLink = {
title: contentRoutes.legal[locale].title,
href: contentRoutes.legal[locale].path,
external: false,
};
const imprintLink = {
title: contentRoutes.imprint[locale].title,
href: contentRoutes.imprint[locale].path,
external: false,
};
const versionLink = mkVersionLink();
return (
<SwissFederalCiFooter
ContentWrapperProps={{ sx: sx ?? undefined }}
bottomLinks={[versionLink, imprintLink, legalLink]}
nCols={3}
>
<FooterSection>
<FooterSectionTitle
title={t({
id: "footer.about_us.label",
message: "About this portal",
})}
/>
<FooterSectionText
text={t({
id: "footer.about_us.text",
message:
"The portal visualize.admin.ch allows the visualization of Swiss Open Government Data provided by the LINDAS Linked Data Service. Open Government Data (OGD) are data that are made available to the public free of charge in computer-readable format.",
})}
/>
</FooterSection>
<FooterSection>
<FooterSectionTitle
title={t({ id: "footer.contact.title", message: "Stay informed" })}
/>
<FooterSectionSocialMediaButtonGroup>
<FooterSectionSocialMediaButton
type="youtube"
href="https://www.youtube.com/@visualizetutorials"
/>
<FooterSectionSocialMediaButton
type="news"
href="mailto:[email protected]"
/>
</FooterSectionSocialMediaButtonGroup>
</FooterSection>
<FooterSection>
<FooterSectionTitle
title={t({
id: "footer.information.title",
message: "Further information",
})}
/>
<Link
href={`https://lindas.admin.ch/?lang=${locale}`}
target="_blank"
sx={{ textDecoration: "none" }}
>
<FooterSectionButton
iconName="external"
label={t({
id: "footer.button.lindas",
message: "LINDAS Linked Data Services",
})}
/>
</Link>
<Link
href={`https://www.youtube.com/@visualizetutorials`}
target="_blank"
sx={{ textDecoration: "none" }}
>
<FooterSectionButton
iconName="external"
label={t({
id: "footer.tutorials",
message: "Tutorials",
})}
/>
</Link>
<Link
href={`https://visualization-tool.status.interactivethings.io/`}
target="_blank"
sx={{ textDecoration: "none" }}
>
<FooterSectionButton
iconName="external"
label={t({
id: "footer.status",
message: "Status",
})}
/>
</Link>
</FooterSection>
</SwissFederalCiFooter>
);
};