declaring cookie consent var

This commit is contained in:
Antoine M 2024-05-14 10:43:12 +02:00
parent b1b20d1898
commit ae38fdb924

View File

@ -4,6 +4,8 @@ import CountriesJSON from "../data/countries/countries.json";
export const UserContext = createContext();
export function UserContextProvider({ children }) {
const [hasConsentedCookies, setHasConsentedCookies] = useState(false);
const localLanguage = localStorage.getItem("userLanguage") || "FR";
const localCountry = JSON.parse(localStorage.getItem("userCountry")) || {
name: "belgique",
@ -59,6 +61,8 @@ export function UserContextProvider({ children }) {
changeUserLanguage,
// changeLanguage,
country,
hasConsentedCookies,
setHasConsentedCookies,
setLanguage,
changeCountry,
profile,