UI State added

This commit is contained in:
Belen Curcio
2020-10-01 09:39:31 -03:00
parent 7cf79cea91
commit 0e48451767
4 changed files with 16 additions and 15 deletions

View File

@@ -1,15 +1,18 @@
import React, { Context, FunctionComponent } from "react";
import React, { FunctionComponent } from "react";
export interface UIState {
displaySidebar: boolean;
openSidebar: () => {};
closeSidebar: () => {};
}
const initialState = {
displaySidebar: false,
dispatch: null,
openSidebar: null,
closeSidebar: null,
};
export interface UIState {
displaySidebar: boolean;
dispatch: (string) => void;
}
export const UIContext = React.createContext<UIState>(initialState);
export const UIContext = React.createContext(initialState);
UIContext.displayName = "UIContext";
export const UIProvider: FunctionComponent = (props) => {