diff --git a/src/client/types.ts b/src/client/types.ts index 9b50c0f2e3bcf7ee76917538416c9428673b1c0e..72d1328499665113f818ffd02f3e1204d84514fd 100644 --- a/src/client/types.ts +++ b/src/client/types.ts @@ -1,4 +1,4 @@ -import { Profile } from '../types/types'; +import { IProfile } from '../types/Profile'; export type EmptyReq = undefined; @@ -11,5 +11,5 @@ export type RegisterReq = { password: string; }; export type UserResponse = { - user: Profile; + user: IProfile; }; diff --git a/src/context/UserContext.tsx b/src/context/UserContext.tsx index 4a9de33994518c115aacba0dce7c0ef423fb07ac..6dbe3ef4ed5241ff2d06c7fac61b90dd2b54c403 100644 --- a/src/context/UserContext.tsx +++ b/src/context/UserContext.tsx @@ -1,27 +1,27 @@ import React, { createContext, useState } from 'react'; -import { Profile, Role } from '../types/types'; +import { IProfile, Role } from '../types/Profile'; interface ContextProps { - profile: Profile; - setProfile: (profile: Profile) => void; + profile: IProfile; + setProfile: (profile: IProfile) => void; } // Context -const initialState: Profile = { - external_id: 'abcd', +const initialState: IProfile = { + externalId: 'abcd', studentCardNumber: '1234', - roomNumber: '104', - picture: 'alma.jpg', + roomNumber: 104, role: Role.User, email: 'alma@gmail.com', name: 'Nagy Gizike', warnings: [], + notices: [], }; export const userContext = createContext({} as ContextProps); const { Provider } = userContext; export const UserStateProvider: React.FC = ({ children }) => { - const [profile, setProfile] = useState<Profile>(initialState); + const [profile, setProfile] = useState<IProfile>(initialState); return <Provider value={{ profile, setProfile }}>{children}</Provider>; };