From f143410e03bf5ef745c10281a2dc06a55a5b4298 Mon Sep 17 00:00:00 2001 From: Marc Thevenet Date: Sat, 3 Jul 2021 13:23:15 +0200 Subject: [PATCH] =?UTF-8?q?Nouvelles=20constantes=20pour=20pouvoir=20adapt?= =?UTF-8?q?er=20=C3=A0=20une=20autre=20commune?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/explanation/index.tsx | 19 ++++++++++++------- src/constants.ts | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/components/explanation/index.tsx b/src/components/explanation/index.tsx index 78b93db..0e197d5 100644 --- a/src/components/explanation/index.tsx +++ b/src/components/explanation/index.tsx @@ -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 { @@ -103,7 +108,7 @@ export const Explanation = ({ onTime, offTime, newLightingTime }: IProps) => { Cette économie représenterait{" "} {toEuros(moneySaving)} 💶,
soit - {toEuros(moneySavingPerCapita, 2)} par Capellois + {toEuros(moneySavingPerCapita, 2)} par {CITY_INHABITANTS} {" "} et par an. @@ -121,8 +126,8 @@ export const Explanation = ({ onTime, offTime, newLightingTime }: IProps) => {  heures) et coût horaire du kWh ({toEuros(COST_PER_WH, 4)})
- 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)
@@ -154,16 +159,16 @@ export const Explanation = ({ onTime, offTime, newLightingTime }: IProps) => { .
- Population de La Chapelle-en-Serval en 2017 ( + Population de {CITY_NAME} en {CENSUS_YEAR} ( {toQuantity(POPULATION)}  habitants)
- https://www.insee.fr/fr/statistiques/1405599?geo=COM-60142 + {CENSUS_URL}
diff --git a/src/constants.ts b/src/constants.ts index 4054190..9c5dbe1 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -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",