1
0

moved ConfigProvider up in the hierarchy (to main.jsx) to wrap the whole App

This commit is contained in:
Jose
2025-02-26 21:08:19 +01:00
parent cf9d5e71fe
commit 40b8f49b89
13 changed files with 104 additions and 36 deletions

View File

@@ -5,8 +5,8 @@ const ConfigContext = createContext();
export const ConfigProvider = ({ children }) => {
const [config, setConfig] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
const [configLoading, setLoading] = useState(true);
const [configError, setError] = useState(null);
useEffect(() => {
const fetchConfig = async () => {
@@ -26,7 +26,7 @@ export const ConfigProvider = ({ children }) => {
}, []);
return (
<ConfigContext.Provider value={{ config, loading, error }}>
<ConfigContext.Provider value={{ config, configLoading, configError }}>
{children}
</ConfigContext.Provider>
);