-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
73 lines (66 loc) · 2.48 KB
/
index.js
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
import { useState, useEffect } from "react";
import Head from "next/head";
import styles from "../styles/home.module.scss";
import Corner from "../components/corner";
import QuickAccess from "../components/quick_access";
import TextContent from "../components/text_content";
import CounterContent from "../components/counter_content";
import { haveSignaturesReachedTarget } from "../utils/counter_utils";
export default function Home({ signaturesReached }) {
const [counterFocused, setCounterFocused] = useState(false);
useEffect(() => {
if (counterFocused) {
setCounterFocused(false);
}
}, [counterFocused]);
return (
<div className={styles.container}>
<Head>
<title>Signez pour notre autonomie : compteur de signatures</title>
</Head>
<QuickAccess onClickFocus={() => setCounterFocused(true)} />
<header role="banner" className={styles.header}>
<Corner />
<h1 className={styles.title}>Signez pour notre autonomie</h1>
</header>
<main role="main" className={styles.main} id="main">
<section className={styles.counter} id="counter">
<CounterContent
focus={counterFocused}
signaturesReached={signaturesReached}
/>
</section>
<section className={styles.content} id="content">
<h2 className={styles.subtitle}>
Pour que les personnes handicapées puissent vivre en couple sans
être dépendantes de leur conjoint(e)
</h2>
<TextContent />
</section>
</main>
<footer role="contentinfo" className={styles.footer} id="footer">
{" "}
<p>
Fait par <a href="https://koena.net">Koena</a>{" "}
<span className={styles.footer__separation}>|</span> page sous{" "}
<a href="https://github.com/Koena-SAS/petition-aah/blob/main/LICENSE">
Licence AGPL
</a>
</p>
<p className={styles.footer__rgaa}>
97% conforme RGAA 4 (testé par Koena le 21/01/2021). Si vous
rencontrez des difficultés d'accès, n'hésitez pas,{" "}
<a href="https://koena.net/mode-demploi-et-accessibilite-du-site-koena/#contact">
contactez-nous pour que nous puissions vous aider !
</a>
</p>
</footer>
</div>
);
}
export const getStaticProps = async () => {
let signaturesReached = await haveSignaturesReachedTarget();
return {
props: { signaturesReached: signaturesReached },
};
};