feat: ajoute le nombre de familles résistantes
parent
723420a168
commit
551adffa48
|
@ -13,7 +13,7 @@ import {
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import React, { Suspense, lazy } from "react";
|
import React, { Suspense, lazy } from "react";
|
||||||
import { Outlet } from "react-router";
|
import { Outlet } from "react-router";
|
||||||
import { resistantsOrder } from "../../Resistant";
|
import { isAncienResistant, resistantsOrder } from "../../Resistant";
|
||||||
import { Separator } from "../../components/Separator";
|
import { Separator } from "../../components/Separator";
|
||||||
import { DisplayModeContext } from "../../context/DisplayModeContext";
|
import { DisplayModeContext } from "../../context/DisplayModeContext";
|
||||||
import { HomeContext } from "../../context/HomeContext";
|
import { HomeContext } from "../../context/HomeContext";
|
||||||
|
@ -44,6 +44,8 @@ export const ListeResistants = () => {
|
||||||
const filtreNom = (event: React.ChangeEvent<HTMLInputElement>) =>
|
const filtreNom = (event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
setNom(event.target.value);
|
setNom(event.target.value);
|
||||||
|
|
||||||
|
const nbFamillesResistantes = resistants.filter(r => !isAncienResistant(r)).length;
|
||||||
|
|
||||||
const filteredResistants = resistants
|
const filteredResistants = resistants
|
||||||
.filter(
|
.filter(
|
||||||
(r) => !nom || normalize(r.noms).includes(normalize(nom.toLowerCase()))
|
(r) => !nom || normalize(r.noms).includes(normalize(nom.toLowerCase()))
|
||||||
|
@ -60,6 +62,7 @@ export const ListeResistants = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<h2 style={{textAlign:"center"}}>Les {nbFamillesResistantes} familles résistantes !</h2>
|
||||||
<div id="listeResistants">
|
<div id="listeResistants">
|
||||||
<Group position="center">
|
<Group position="center">
|
||||||
<SegmentedControl
|
<SegmentedControl
|
||||||
|
|
Loading…
Reference in New Issue