-
Notifications
You must be signed in to change notification settings - Fork 0
/
Context.tsx
36 lines (32 loc) · 889 Bytes
/
Context.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as React from 'react'
import { IContext } from './interfaces';
interface Props {
children: React.ReactNode;
}
export const Context = React.createContext<IContext>({
openSideMenu: false,
setOpenSideMenu(_config) { },
mobile: false,
setMobile(_config) { },
openProjectModal: "",
setOpenProjectModal(_config) { },
})
const ContextProvider: React.FC<Props> = ({ children }) => {
const [openSideMenu, setOpenSideMenu] = React.useState<boolean>(false);
const [mobile, setMobile] = React.useState<boolean>(false);
const [openProjectModal, setOpenProjectModal] = React.useState<string>("");
return (
<Context.Provider
value={{
openSideMenu,
setOpenSideMenu,
mobile,
setMobile,
openProjectModal,
setOpenProjectModal,
}}>
{children}
</Context.Provider>
)
}
export default ContextProvider;