Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/components/explanation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {
COST_PER_WH,
POPULATION,
CYCLIST_HOURLY_PRODUCTION,
HOUSEHOLD_YEARLY_CONSUMPTION
HOUSEHOLD_YEARLY_CONSUMPTION,
CITY_INHABITANTS,
CITY_NAME,
PUBLIC_LIGHTING_INVOICE_YEAR,
CENSUS_YEAR,
CENSUS_URL,
} from "../../constants";

interface IProps {
Expand Down Expand Up @@ -103,7 +108,7 @@ export const Explanation = ({ onTime, offTime, newLightingTime }: IProps) => {
Cette économie représenterait{" "}
<strong className="stronger">{toEuros(moneySaving)} 💶</strong>,<br />
soit <strong>
{toEuros(moneySavingPerCapita, 2)} par Capellois
{toEuros(moneySavingPerCapita, 2)} par {CITY_INHABITANTS}
</strong>{" "}
et par an.
</Sentence>
Expand All @@ -121,8 +126,8 @@ export const Explanation = ({ onTime, offTime, newLightingTime }: IProps) => {
&#8239;heures) et coût horaire du kWh ({toEuros(COST_PER_WH, 4)})
</dt>
<dd>
Factures d'électricité d'éclairage public de La Chapelle-en-Serval
de 2019 (consultables en mairie)
Factures d'électricité d'éclairage public de {CITY_NAME}{' '}
de {PUBLIC_LIGHTING_INVOICE_YEAR} (consultables en mairie)
</dd>

<dt>
Expand Down Expand Up @@ -154,16 +159,16 @@ export const Explanation = ({ onTime, offTime, newLightingTime }: IProps) => {
.
</dd>
<dt>
Population de La Chapelle-en-Serval en 2017 (
Population de {CITY_NAME} en {CENSUS_YEAR} (
{toQuantity(POPULATION)}
&nbsp;habitants)
</dt>
<dd>
<a
href="https://www.insee.fr/fr/statistiques/1405599?geo=COM-60142"
href={CENSUS_URL}
target="_blank"
>
https://www.insee.fr/fr/statistiques/1405599?geo=COM-60142
{CENSUS_URL}
</a>
</dd>
</Sources>
Expand Down
15 changes: 15 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,27 @@ export const CYCLIST_HOURLY_PRODUCTION = 0.2;
// Population de la commune
export const POPULATION = 3141;

// Année des données concernant la population de la ville
export const CENSUS_YEAR = 2017;

// Url de la page indiquant la population de la ville
export const CENSUS_URL = "https://www.insee.fr/fr/statistiques/1405599?geo=COM-60142";

// Durée d'éclairage annuelle
export const CURRENT_LIGHTING_TIME = 4100;

// Durée du jour en secondes
export const DAY_DURATION = 24 * 60 * 60;

// Nom de la ville
export const CITY_NAME = "La Chapelle-en-Serval";

// Nom des habitants
export const CITY_INHABITANTS = "Capellois";

// Année de la facture d'éclairage public dont sont extraites les données
export const PUBLIC_LIGHTING_INVOICE_YEAR = 2019;

export enum Colors {
Night = "midnightblue",
Sunlight = "lightyellow",
Expand Down