Skip to content

Commit

Permalink
chore: move out viewer provider props into its own type
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite committed Sep 9, 2024
1 parent 3e3d16c commit 9b5a83e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions react-components/src/components/RevealCanvas/ViewerContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ import { type CameraStateParameters, useCameraStateControl } from './hooks/useCa

const ViewerContext = createContext<RevealRenderTarget | null>(null);

export type ViewerContextProviderProps = {
cameraState?: CameraStateParameters;
setCameraState?: (cameraState?: CameraStateParameters) => void;
value: RevealRenderTarget | null;
children: ReactNode;
};

export const ViewerContextProvider = ({
cameraState,
setCameraState,
value,
children
}: {
cameraState?: CameraStateParameters;
setCameraState?: (cameraState?: CameraStateParameters) => void;
value: RevealRenderTarget | null;
children: ReactNode;
}): ReactElement => {
}: ViewerContextProviderProps): ReactElement => {
return (
<ViewerContext.Provider value={value}>
<ViewerControls cameraState={cameraState} setCameraState={setCameraState} />
Expand Down

0 comments on commit 9b5a83e

Please sign in to comment.