Skip to content

Commit

Permalink
updating profile when user logs in
Browse files Browse the repository at this point in the history
  • Loading branch information
AniketS02 committed Jan 9, 2025
1 parent d3b24a0 commit b107f15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Pages/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const Order = styled.div`
`;

function Profile() {
const UserData = JSON.parse(localStorage.getItem('user'));
const user = useSelector((state) => state.auth.user);

// Mock order history data
Expand All @@ -71,11 +72,11 @@ function Profile() {
>
<InfoItem>
<Label>Name:</Label>
{user?.username || 'N/A'}
{UserData.username || 'N/A'}
</InfoItem>
<InfoItem>
<Label>Email:</Label>
{user?.email || 'N/A'}
{UserData.email || 'N/A'}
</InfoItem>
<Button primary>Edit Profile</Button>
</ProfileInfo>
Expand Down

0 comments on commit b107f15

Please sign in to comment.