refactor: DisplayModeContext
parent
7679672432
commit
938ce130cd
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue