Start working on UI
This commit is contained in:
parent
07208177fd
commit
8227b4141a
16 changed files with 701 additions and 581 deletions
36
app/providers/map-scene-provider.tsx
Normal file
36
app/providers/map-scene-provider.tsx
Normal file
|
@ -0,0 +1,36 @@
|
|||
"use client";
|
||||
|
||||
import {
|
||||
createContext,
|
||||
Dispatch,
|
||||
ReactNode,
|
||||
SetStateAction,
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { MapScene } from "../three/MapScene";
|
||||
|
||||
// Declare MapScene context
|
||||
export type MapSceneContextType = {
|
||||
mapScene: MapScene | null;
|
||||
setMapScene: Dispatch<SetStateAction<MapScene | null>>;
|
||||
};
|
||||
|
||||
// Context for MapScene
|
||||
export const MapSceneContext = createContext<MapSceneContextType | null>(null);
|
||||
|
||||
// Context provider for MapScene
|
||||
export const MapSceneProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [mapScene, setMapScene] = useState<MapScene | null>(null);
|
||||
|
||||
return (
|
||||
<MapSceneContext.Provider
|
||||
value={{
|
||||
mapScene: mapScene,
|
||||
setMapScene: setMapScene,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</MapSceneContext.Provider>
|
||||
);
|
||||
};
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue