refactor: DisplayModeContext
parent
7679672432
commit
938ce130cd
|
@ -1,10 +1,15 @@
|
|||
import React from "react";
|
||||
import { ViewMode } from "../routes/ViewMode";
|
||||
|
||||
export const DisplayModeContext = React.createContext<{
|
||||
mode: ViewMode;
|
||||
setMode: (mode: ViewMode) => void;
|
||||
}>({
|
||||
const defaultValue: DisplayModeContextType = {
|
||||
mode: "map",
|
||||
setMode: () => {},
|
||||
});
|
||||
};
|
||||
|
||||
interface DisplayModeContextType {
|
||||
mode: ViewMode;
|
||||
setMode: (mode: ViewMode) => void;
|
||||
}
|
||||
|
||||
export const DisplayModeContext =
|
||||
React.createContext<DisplayModeContextType>(defaultValue);
|
||||
|
|
Loading…
Reference in New Issue