feat: default view mode depends on location

proto-module-actu-react
Jalil Arfaoui 2023-02-24 22:52:53 +01:00
parent 938ce130cd
commit ec2c3b7de2
1 changed files with 5 additions and 1 deletions

View File

@ -13,8 +13,12 @@ import "./style/thumbs.css";
import "./style/row.css"; import "./style/row.css";
import "./photos"; import "./photos";
const defaultViewMode: ViewMode = location.href.includes("resistants")
? "photos"
: "map";
export const App = () => { export const App = () => {
const [viewMode, setViewMode] = React.useState<ViewMode>("map"); const [viewMode, setViewMode] = React.useState<ViewMode>(defaultViewMode);
return ( return (
<DisplayModeContext.Provider <DisplayModeContext.Provider