Finish slicing box and UI
This commit is contained in:
parent
8227b4141a
commit
213537508c
19 changed files with 965 additions and 1361 deletions
|
@ -1,36 +0,0 @@
|
|||
"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>
|
||||
);
|
||||
};
|
38
app/providers/scene-view-provider.tsx
Normal file
38
app/providers/scene-view-provider.tsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
"use client";
|
||||
|
||||
import {
|
||||
createContext,
|
||||
Dispatch,
|
||||
ReactNode,
|
||||
SetStateAction,
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { SceneView } from "../three/SceneView";
|
||||
|
||||
// Declare SceneView context
|
||||
export type SceneViewContextType = {
|
||||
sceneView: SceneView | null;
|
||||
setSceneView: Dispatch<SetStateAction<SceneView | null>>;
|
||||
};
|
||||
|
||||
// Context for SceneView
|
||||
export const SceneViewContext = createContext<SceneViewContextType | null>(
|
||||
null
|
||||
);
|
||||
|
||||
// Context provider for SceneView
|
||||
export const SceneViewProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [sceneView, setSceneView] = useState<SceneView | null>(null);
|
||||
|
||||
return (
|
||||
<SceneViewContext.Provider
|
||||
value={{
|
||||
sceneView: sceneView,
|
||||
setSceneView: setSceneView,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</SceneViewContext.Provider>
|
||||
);
|
||||
};
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue