diff --git a/src/contexts/LoadingContext.js b/src/contexts/LoadingContext.js new file mode 100644 index 0000000..b33cc02 --- /dev/null +++ b/src/contexts/LoadingContext.js @@ -0,0 +1,15 @@ +import { createContext, useState } from 'react'; + +const initialValue = true; + +export const LoadingContext = createContext(); + +export const LoadingProvider = (props) => { + const [loading, setLoading] = useState(initialValue); + + return ( + + {props.children} + + ); +}; diff --git a/src/contexts/ThemeContext.js b/src/contexts/ThemeContext.js new file mode 100644 index 0000000..fb82452 --- /dev/null +++ b/src/contexts/ThemeContext.js @@ -0,0 +1,16 @@ +import { createContext, useState } from 'react'; +import { getInitialTheme } from '../helpers/utils'; + +const initialValue = getInitialTheme(); + +export const ThemeContext = createContext(); + +export const ThemeProvider = (props) => { + const [theme, setTheme] = useState(initialValue); + + return ( + + {props.children} + + ); +};