refining userContext
This commit is contained in:
parent
29e973a4f1
commit
3b32f6d5af
|
|
@ -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 (
|
||||
<UserContext.Provider
|
||||
value={{ language, changeLanguage, country, changeCountry, profile, changeProfile }}>
|
||||
value={{
|
||||
language,
|
||||
changeLanguage,
|
||||
country,
|
||||
changeCountry,
|
||||
profile,
|
||||
changeProfile,
|
||||
}}>
|
||||
{children}
|
||||
</UserContext.Provider>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user