aboutsummaryrefslogtreecommitdiff
path: root/src/web/contexts/StateContext.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/contexts/StateContext.jsx')
-rw-r--r--src/web/contexts/StateContext.jsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/web/contexts/StateContext.jsx b/src/web/contexts/StateContext.jsx
new file mode 100644
index 0000000..91579a4
--- /dev/null
+++ b/src/web/contexts/StateContext.jsx
@@ -0,0 +1,17 @@
+import React, {createContext, useState} from "react";
+
+// Our StateContext are some variables which we want shared between components.
+const StateContext = createContext(null);
+function StateContextProvider({children}) {
+ const state = useState({
+ loginActive: false,
+ });
+
+ return (
+ <StateContext.Provider value={state}>
+ {children}
+ </StateContext.Provider>
+ );
+}
+
+export {StateContext, StateContextProvider}; \ No newline at end of file