refactor: DisplayModeContext

proto-module-actu-react
Jalil Arfaoui 2023-02-24 22:50:53 +01:00
parent 7679672432
commit 938ce130cd
1 changed files with 10 additions and 5 deletions

View File

@ -1,10 +1,15 @@
import React from "react"; import React from "react";
import { ViewMode } from "../routes/ViewMode"; import { ViewMode } from "../routes/ViewMode";
export const DisplayModeContext = React.createContext<{ const defaultValue: DisplayModeContextType = {
mode: ViewMode;
setMode: (mode: ViewMode) => void;
}>({
mode: "map", mode: "map",
setMode: () => {}, setMode: () => {},
}); };
interface DisplayModeContextType {
mode: ViewMode;
setMode: (mode: ViewMode) => void;
}
export const DisplayModeContext =
React.createContext<DisplayModeContextType>(defaultValue);