small change
parent
34f455ded2
commit
7e19f387e5
|
@ -15,7 +15,7 @@ function layoutReducer(state, action) {
|
||||||
|
|
||||||
function LayoutProvider({ children }) {
|
function LayoutProvider({ children }) {
|
||||||
var [state, dispatch] = React.useReducer(layoutReducer, {
|
var [state, dispatch] = React.useReducer(layoutReducer, {
|
||||||
isSidebarOpened: true,
|
isSidebarOpened: true
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<LayoutStateContext.Provider value={state}>
|
<LayoutStateContext.Provider value={state}>
|
||||||
|
@ -44,9 +44,8 @@ function useLayoutDispatch() {
|
||||||
|
|
||||||
export { LayoutProvider, useLayoutState, useLayoutDispatch, toggleSidebar };
|
export { LayoutProvider, useLayoutState, useLayoutDispatch, toggleSidebar };
|
||||||
|
|
||||||
// ###########################################################
|
|
||||||
function toggleSidebar(dispatch) {
|
function toggleSidebar(dispatch) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "TOGGLE_SIDEBAR",
|
type: "TOGGLE_SIDEBAR"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue