Skip to content

Commit

Permalink
Add default picture for user icon
Browse files Browse the repository at this point in the history
  • Loading branch information
JiashuHarryHuang committed Feb 9, 2024
1 parent fd8ff6c commit 3f041b7
Showing 1 changed file with 39 additions and 3 deletions.
42 changes: 39 additions & 3 deletions components/DesktopSidebar/UserIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,45 @@ export const UserIcon = () => {
return (
<UserIconContainer>
<ImageContainer>
{/* TODO: add user profile image */}
{/* Bigger image size for desktop and smaller for mobile */}
<Media greaterThanOrEqual="sm">
{session?.user && (
<>
<Media greaterThanOrEqual="sm">
{/* User Profile Picture */}
{session.user.profileImgUrl && (
<Image
src={session.user.profileImgUrl}
width="100"
height="100"
alt="user-profile"
/>
)}

{/* Default Profile Picture */}
{!session.user.profileImgUrl && (
<Image src="/bookem-logo.png" width="100" height="100" alt="" />
)}
</Media>

<Media lessThan="sm">
{/* User Profile Picture */}
{session.user.profileImgUrl && (
<Image
src={session.user.profileImgUrl}
width="73"
height="73"
alt="user-profile"
/>
)}

{/* Default Profile Picture */}
{!session.user.profileImgUrl && (
<Image src="/bookem-logo.png" width="73" height="73" alt="" />
)}
</Media>
</>
)}
{/* <Media greaterThanOrEqual="sm">
{session?.user && session.user.profileImgUrl && (
<Image
src={session.user.profileImgUrl}
Expand All @@ -31,7 +67,7 @@ export const UserIcon = () => {
</Media>
<Media lessThan="sm">
<Image src="/bookem-logo.png" width="73" height="73" alt="" />
</Media>
</Media> */}
</ImageContainer>
<Name>{session?.user && session.user.name}</Name>
</UserIconContainer>
Expand Down

0 comments on commit 3f041b7

Please sign in to comment.