2023-02-20 17:22:01 +00:00
|
|
|
import React from "react";
|
2023-02-23 22:03:06 +00:00
|
|
|
import { RouterProvider } from "react-router-dom";
|
|
|
|
import { ViewMode } from "./routes/ViewMode";
|
|
|
|
import { DisplayModeContext } from "./context/DisplayModeContext";
|
|
|
|
import { router } from "./router";
|
|
|
|
import "mapbox-gl/dist/mapbox-gl.css";
|
|
|
|
import "./style/SquareSpace/vars.css";
|
|
|
|
import "./style/SquareSpace/global.css";
|
|
|
|
import "./style/SquareSpace/blocks.css";
|
|
|
|
import "./style/SquareSpace/table.css";
|
|
|
|
import "./style/SquareSpace/video.css";
|
|
|
|
import "./style/thumbs.css";
|
|
|
|
import "./style/row.css";
|
|
|
|
import "./photos";
|
2023-02-20 17:22:01 +00:00
|
|
|
|
2023-02-24 21:52:53 +00:00
|
|
|
const defaultViewMode: ViewMode = location.href.includes("resistants")
|
|
|
|
? "photos"
|
|
|
|
: "map";
|
|
|
|
|
2023-02-20 17:22:01 +00:00
|
|
|
export const App = () => {
|
2023-02-24 21:52:53 +00:00
|
|
|
const [viewMode, setViewMode] = React.useState<ViewMode>(defaultViewMode);
|
2023-02-20 17:22:01 +00:00
|
|
|
|
2023-02-23 22:03:06 +00:00
|
|
|
return (
|
|
|
|
<DisplayModeContext.Provider
|
|
|
|
value={{ mode: viewMode, setMode: setViewMode }}
|
|
|
|
>
|
|
|
|
<RouterProvider router={router} />
|
2023-02-20 17:22:01 +00:00
|
|
|
</DisplayModeContext.Provider>
|
2023-02-23 22:03:06 +00:00
|
|
|
);
|
|
|
|
};
|