Skip to content

Commit

Permalink
fixed user details page
Browse files Browse the repository at this point in the history
  • Loading branch information
VenketeshRushi committed Oct 27, 2023
1 parent 9965419 commit df774c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/Sidebar/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from "@chakra-ui/react";
import { useSelector } from "react-redux";

export default function Profile({ userProfile, setUserProfile, selectedProfile, setSelectedProfile }) {
function Profile({ userProfile, setUserProfile, selectedProfile, setSelectedProfile }) {


const user = useSelector((state) => state.auth.user) || "Test";
Expand Down Expand Up @@ -54,6 +54,7 @@ export default function Profile({ userProfile, setUserProfile, selectedProfile,
name={user.firstName}
cursor="pointer"
onClick={openChooseImage}
// src={user.profilePic && userProfile !== null ? userProfile : user.profilePic && userProfile === null ? user.profilePic : userProfile}
src={userProfile ? userProfile : user.profilePic}
>
<AvatarBadge bg="brand.blue" boxSize="1em">
Expand Down Expand Up @@ -112,3 +113,5 @@ export default function Profile({ userProfile, setUserProfile, selectedProfile,
</VStack>
);
}

export default Profile
2 changes: 1 addition & 1 deletion src/components/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Profile from "./Profile";
import { useSelector } from "react-redux";
import { setToast } from "../../utils/extraFunctions";
import { useState } from "react";
import { getItem, removeItem, setItem } from "../../utils/cookiestorage";
import { removeItem, setItem } from "../../utils/cookiestorage";

function Sidebar() {
const [selectedProfile, setSelectedProfile] = useState(null);
Expand Down

0 comments on commit df774c8

Please sign in to comment.