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";
|
2023-05-13 21:06:58 +00:00
|
|
|
import { HomeContext } from "./context/HomeContext";
|
2023-02-23 22:03:06 +00:00
|
|
|
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-05-08 23:40:02 +00:00
|
|
|
import "./declarations";
|
2023-02-20 17:22:01 +00:00
|
|
|
|
2023-02-25 21:38:26 +00:00
|
|
|
interface Props {
|
|
|
|
defaultViewMode: ViewMode;
|
2023-05-13 21:06:58 +00:00
|
|
|
home: boolean;
|
2023-02-25 21:38:26 +00:00
|
|
|
}
|
2023-02-24 21:52:53 +00:00
|
|
|
|
2023-05-13 21:06:58 +00:00
|
|
|
export const App = ({ defaultViewMode, home }: Props) => {
|
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 }}
|
|
|
|
>
|
2023-05-13 21:06:58 +00:00
|
|
|
<HomeContext.Provider value={{ isHome: home, setMode: () => {} }}>
|
|
|
|
<RouterProvider router={router} />
|
|
|
|
</HomeContext.Provider>
|
2023-02-20 17:22:01 +00:00
|
|
|
</DisplayModeContext.Provider>
|
2023-02-23 22:03:06 +00:00
|
|
|
);
|
|
|
|
};
|