-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.tsx
191 lines (183 loc) · 6.41 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/* eslint-disable jsx-a11y/anchor-is-valid -- Disabled because of a lot of placeholder hrefs */
import Carousel from "@/components/Carousel";
import Navbar, { NavbarProps } from "@/components/Navbar";
import VerticalCard from "@/components/VerticalCard";
import WeekCalendar from "@/components/WeekCalendar";
import useTranslate from "@/hooks/useTranslate";
import createClient from "@/lib/cmsClient";
import { useLanguage } from "@/lib/LanguageContext";
import styles from "@/styles/Home.module.css";
import { readItems } from "@directus/sdk";
import { Button } from "@mui/material";
import { EmblaOptionsType } from "embla-carousel";
import { GetStaticProps } from "next";
import Head from "next/head";
import Image from "next/image";
import Link from "next/link";
import aino from "../public/aino.png";
import cAside from "../public/contact-aside.png";
const OPTIONS: EmblaOptionsType = { loop: true };
const SLIDE_COUNT = 10;
const SLIDES = Array.from(Array(SLIDE_COUNT).keys());
export const getStaticProps: GetStaticProps<HomePageProps> = async () => {
const client = createClient();
const links = await client.request(readItems("NavigationLink"));
return {
props: {
navBar: {
links,
},
},
};
};
type HomePageProps = {
navBar: NavbarProps;
};
export default function Home({ navBar }: HomePageProps) {
const t = useTranslate();
const { language } = useLanguage();
return (
<>
<Head>
<title>Satakuntalainen Osakunta</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Head>
<Navbar links={navBar.links} />
{/* Hero */}
<header className={styles.hero}>
<h2 className={styles.h2}>{t("homepage:heroSectionText")}</h2>
<Link href="/nation-info" locale={language} passHref>
<Button variant="contained" className="button darkBlue">
{t("homepage:join")}
</Button>
</Link>
</header>
<main className={styles.main}>
{/* Cards */}
<section className={styles.cards}>
<VerticalCard
variant="yellow"
image="/Placeholder_1.png"
title={t("homepage:nationInfoCard")}
altText="Placeholder image"
href="/nation-info"
/>
<VerticalCard
variant="yellow"
image="/Placeholder_1.png"
title={t("homepage:memberCard")}
altText="Placeholder image"
href=""
/>
<VerticalCard
variant="yellow"
image="/Placeholder_1.png"
title={t("homepage:eventsCard")}
altText="Placeholder image"
href=""
/>
<VerticalCard
variant="yellow"
image="/Placeholder_1.png"
title={t("homepage:newsCard")}
altText="Placeholder image"
href=""
/>
</section>
{/* Living Info */}
<section className={styles.livingInfo}>
<Image
src={aino}
alt="A photo of SatO's mascot"
className={styles.aino}
/>
<article className={styles.livingArticle}>
<h2 className={styles.livingTitle}>
{t("homepage:livingInfoHeader")}
</h2>
<br />
<p>{t("homepage:livingInfoDescription")}</p>
<br />
<br />
<Link
href="https://www.satalinnansaatio.fi/asunnot/"
target="_blank"
rel="noopener noreferrer"
locale={language}
passHref
>
<Button variant="contained" className="button lightBlue">
{t("homepage:saatioLinkButtonText")}
</Button>
</Link>
</article>
</section>
{/* Calendar */}
<section className={styles.calendarSection}>
<span className={styles.sectionContainer}>
<h2>{t("nav:calendar")}</h2>
<WeekCalendar />
<div className={styles.calendarFooter}>
<ul className={styles.calendarLegend}>
<li className={styles.legendItem}>
<div className={styles.legendGreen} />
<p>{t("homepage:calendarLabelMeeting")}</p>
</li>
<li className={styles.legendItem}>
<div className={styles.legendBlue} />
<p>{t("homepage:calendarLabelEvents")}</p>
</li>
<li className={styles.legendItem}>
<div className={styles.legendOrange} />
<p>{t("homepage:calendarLabelSports")}</p>
</li>
</ul>
<Link href="/calendar" locale={language} passHref>
<Button variant="contained" className="button darkBlue">
{t("general:seeMore")}
</Button>
</Link>
</div>
</span>
</section>
{/* Carousel */}
<section className={styles.karhunkierros}>
<span className={styles.carouselContainer}>
<h2>{t("homepage:karhunkierrosHeader")}</h2>
<Carousel slides={SLIDES} options={OPTIONS} />
</span>
</section>
{/* Contact */}
<section className={styles.contact}>
<div className={styles.contactSectionContainer}>
<div className={styles.contactInfo}>
<h2>{t("homepage:contactBoardHeader")}</h2>
<p>{t("homepage:contactBoardDescription")}</p>
<Button variant="contained" className="button darkBlue">
{t("homepage:contactFormButton")}
</Button>
<br />
<br />
<h2>{t("homepage:harassmentFormHeader")}</h2>
<p>{t("homepage:harassmentFormDescription")}</p>
<Link href="/harassment-form" locale={language} passHref>
<Button variant="contained" className="button darkBlue">
{t("homepage:contactFormButton")}
</Button>
</Link>
</div>
<Image
src={cAside}
alt="various messaging icons"
className={styles.contactAside}
/>
</div>
</section>
{/* Footer */}
<section className="footer" />
<section />
</main>
</>
);
}