mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
UI State added
This commit is contained in:
@@ -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) => {
|
||||
|
Reference in New Issue
Block a user