From 3b32f6d5afe5cc7194531bd9bc58c46ca6805ff1 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 13 Feb 2024 19:23:11 +0100 Subject: [PATCH] refining userContext --- src/context/UserContext.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/context/UserContext.js b/src/context/UserContext.js index 42f0aca..57b0841 100644 --- a/src/context/UserContext.js +++ b/src/context/UserContext.js @@ -1,13 +1,6 @@ import { createContext, useState } from "react"; -export const UserContext = createContext({ - language: "fr", - country: "Belgique", - profile: "lhoist_employee", - changeLanguage: () => {}, - changeCountry: () => {}, - changeProfile: () => {}, -}); +export const UserContext = createContext(); export function UserContextProvider({ children }) { const [language, setLanguage] = useState("fr"); @@ -31,7 +24,14 @@ export function UserContextProvider({ children }) { } return ( + value={{ + language, + changeLanguage, + country, + changeCountry, + profile, + changeProfile, + }}> {children} );