diff --git a/src/components/User/UserData.js b/config/content/Profile.js similarity index 92% rename from src/components/User/UserData.js rename to config/content/Profile.js index f86a549..d5ab433 100644 --- a/src/components/User/UserData.js +++ b/config/content/Profile.js @@ -1,18 +1,18 @@ export const UserData = [ { - id: 1, fieldName: 'Name', - fieldValue: 'John Doe', + key: 'name', + fieldValue: '', }, { - id: 2, fieldName: 'Email', - fieldValue: 'johndoe@inno.nitrkl.in', + key: 'email', + fieldValue: '', }, { - id: 3, fieldName: 'Phone', - fieldValue: '555-5555-555', + key: 'mobile', + fieldValue: '', }, ]; @@ -20,7 +20,7 @@ export const RegisteredEvents = [ { id: 1, img: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1695674904/got_lungcp.jpg', - title: 'A Feast for Crows', + title: 'A Feast for Crows Helloopooooo', clubName: 'House Frey', date: '17 July', location: 'LA', diff --git a/src/components/User/User.jsx b/src/components/User/User.jsx index 4d471a9..56b0aff 100644 --- a/src/components/User/User.jsx +++ b/src/components/User/User.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useContext } from 'react'; import { DetailContainer, Legend, @@ -7,39 +7,48 @@ import { DetailWrapper, RegEventContainer, } from './styles'; -import { UserData, RegisteredEvents as RegEvents } from './UserData'; +import { UserData, RegisteredEvents as RegEvents } from '../../../config/content/Profile'; import { Heading2 } from '../shared'; import RegisteredEventCard from './RegisteredEventCard'; +import { AuthContext } from '../../utils/Auth'; const DataContainer = ({ name, value }) => ( -
- {name} - {value} -
- ); +
+ {name} + {value} +
+); + +const User = () => { + const { userData } = useContext(AuthContext); -const User = () => ( + return ( Your Details {UserData.map((item) => ( - + ))} Registered Events {RegEvents.map(({ id, title, img, clubName, date, location }) => ( - - ))} + + ))} ); +}; export default User; diff --git a/src/components/User/styles.js b/src/components/User/styles.js index a8e2e99..1ee7da3 100644 --- a/src/components/User/styles.js +++ b/src/components/User/styles.js @@ -166,7 +166,6 @@ export const RegEventTitle = styled.div` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - //font-weight: 600; line-height: normal; letter-spacing: 0.48px; `; @@ -176,11 +175,8 @@ export const RegEventClubname = styled.p` text-[14px] font-[500] `} - //color: var(--text-tertiary, #D6D6D6); font-family: Noto Sans, sans-serif; - //font-size: 14px; font-style: normal; - //font-weight: 500; line-height: normal; letter-spacing: 0.28px; `; diff --git a/src/utils/Auth.jsx b/src/utils/Auth.jsx index 536df8d..9ee0fbe 100644 --- a/src/utils/Auth.jsx +++ b/src/utils/Auth.jsx @@ -37,10 +37,13 @@ const AuthContextProvider = ({ children }) => { const _cancelSubscription = onAuthStateChanged(auth, async (user) => { if (user) { setAuthenticated(true); - setUserData(user); setToken(user.accessToken); - await api.fetchUserDetails({ uid: user.uid, accessToken: user.accessToken }); + const avenueUser = await api.fetchUserDetails({ + uid: user.uid, + accessToken: user.accessToken, + }); + setUserData(avenueUser); } else { setAuthenticated(false); setUserData({});