- Add context provider for both tabs
This commit is contained in:
1 parent
c1dc04939e
commit
8292654d27
1 file changed
+29
@@ -0,0 +1,29 @@
|
|||||||
|
import { createContext, useState, React } from 'react';
|
||||||
|
|
||||||
|
const StatusFormContext = createContext({
|
||||||
|
form: {},
|
||||||
|
setForm: ()=>{},
|
||||||
|
});
|
||||||
|
|
||||||
|
const StatusFormProvider = ({ children }) => {
|
||||||
|
const [form, setForm] = useState({
|
||||||
|
companyName: "",
|
||||||
|
url: "",
|
||||||
|
timezone: "America/Toronto",
|
||||||
|
color: "#4169E1",
|
||||||
|
//which fields matching below?
|
||||||
|
publish: false,
|
||||||
|
logo: null,
|
||||||
|
monitors: [],
|
||||||
|
showUptimePercentage: false,
|
||||||
|
showBarcode: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StatusFormContext.Provider value={{ form, setForm}}>
|
||||||
|
{children}
|
||||||
|
</StatusFormContext.Provider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export { StatusFormContext, StatusFormProvider };
|
||||||
Reference in new issue
Block a user