From fa754b4a9841a18dfa43f63619d9038ba0a438de Mon Sep 17 00:00:00 2001 From: G Date: Mon, 1 Jul 2024 10:25:21 +0000 Subject: [PATCH] add userInformations props in context --- src/contexts/UserAuthenticationContext.tsx | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/contexts/UserAuthenticationContext.tsx b/src/contexts/UserAuthenticationContext.tsx index 0add797..f873aa0 100644 --- a/src/contexts/UserAuthenticationContext.tsx +++ b/src/contexts/UserAuthenticationContext.tsx @@ -1,15 +1,36 @@ +import type { IuserInformations } from "@/utils/requests/Types"; import { createContext, useContext, useState } from "react"; import type { IauthenticationData } from "./Types"; export interface UserAuthenticationContextProps { isAuthenticated: boolean; setIsAuthenticated: React.Dispatch>; setAuthenticationData: React.Dispatch>; + userInformations: IuserInformations; + setUserInformations: React.Dispatch>; } export const UserAuthenticationContext = createContext({ isAuthenticated: false, setIsAuthenticated: () => {}, setAuthenticationData: () => {}, + userInformations: { + username: "", + email: "", + firstName: "", + lastName: "", + marchand: { + // biome-ignore lint/style/useNamingConvention: + marchand_id: "", + nom: "", + code: "", + adresse: "", + urlSuccess: "", + urlEchec: "", + entreprise: 0, + user: 0, + }, + }, + setUserInformations: () => {}, }); export const UserAuthenticationContextProvider = ({ children }: { children: React.ReactNode }) => { @@ -18,10 +39,33 @@ export const UserAuthenticationContextProvider = ({ children }: { children: Reac access: "", refresh: "", }); + const [userInformations, setUserInformations] = useState({ + username: "", + email: "", + firstName: "", + lastName: "", + marchand: { + // biome-ignore lint/style/useNamingConvention: + marchand_id: "", + nom: "", + code: "", + adresse: "", + urlSuccess: "", + urlEchec: "", + entreprise: 0, + user: 0, + }, + }); return ( {children} -- libgit2 0.27.1