From 374e5dec38f5eb0db8b3da0521084e6a0064de53 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Thu, 8 Feb 2024 18:02:53 -0600 Subject: [PATCH] Refactor logic --- components/DesktopSidebar/UserIcon.tsx | 58 +++++++------------------- 1 file changed, 14 insertions(+), 44 deletions(-) diff --git a/components/DesktopSidebar/UserIcon.tsx b/components/DesktopSidebar/UserIcon.tsx index 0865602..a164245 100644 --- a/components/DesktopSidebar/UserIcon.tsx +++ b/components/DesktopSidebar/UserIcon.tsx @@ -17,59 +17,29 @@ export const UserIcon = () => { return ( - {/* Bigger image size for desktop and smaller for mobile */} {session?.user && ( <> + {/* Choose image size based on screen size */} - {/* User Profile Picture */} - {session.user.profileImgUrl && ( - user-profile - )} - - {/* Default Profile Picture */} - {!session.user.profileImgUrl && ( - - )} + user-profile - - {/* User Profile Picture */} - {session.user.profileImgUrl && ( - user-profile - )} - - {/* Default Profile Picture */} - {!session.user.profileImgUrl && ( - - )} + user-profile )} - {/* - {session?.user && session.user.profileImgUrl && ( - user-profile - )} - - - - */} - {session?.user && session.user.name} + {session?.user?.name} ); };