diff --git a/src/routes/Liste/index.tsx b/src/routes/Liste/index.tsx index b59a19d..77f6833 100644 --- a/src/routes/Liste/index.tsx +++ b/src/routes/Liste/index.tsx @@ -25,11 +25,13 @@ const normalize = (text: string) => (text || "") type ViewMode = "list" | "photos" | "map"; export const ListeResistants = () => { + const defaultMode = "map" + const { resistants } = useLoaderData() as { resistants: Resistant[] } const [departement, setDepartement] = React.useState(null) const [academie, setAcademie] = React.useState(null) const [nom, setNom] = React.useState(undefined) - const [viewMode, setViewMode ] = React.useState("map") + const [viewMode, setViewMode ] = React.useState(defaultMode) const filtreNom = (event: React.ChangeEvent) => setNom(event.target.value) @@ -46,7 +48,7 @@ export const ListeResistants = () => { { value: "list", label:
Liste
}, { value: "photos", label:
Photos
}, { value: "map", label:
Carte
}, - ]} size="xs" defaultValue="photos" onChange={(value) => setViewMode(value as ViewMode )} /> + ]} size="xs" defaultValue={defaultMode} onChange={(value) => setViewMode(value as ViewMode )} /> } placeholder="Nom" onChange={filtreNom}/>