fix(ui): profile page directive + avatar dropdown links/fallbacks

This commit is contained in:
Gabriel Brown committed 2026-07-11 17:32:49 -04:00
1 parent d873c8eaf7
commit cc241c8bbf
3 files changed
+107 -5

No files matched your search

@@ -29,6 +29,10 @@ export const AvatarDropdown = () => {
user?.image && !remoteImageUrl ? { storageId: user.image } : 'skip',
);
const avatarUrl = remoteImageUrl ?? currentImageUrl;
// Empty/whitespace names must fall through to the email, so intentionally
// treat a blank string as "no name" (nullish coalescing would keep it).
const trimmedName = user?.name?.trim();
const displayName = trimmedName?.length ? trimmedName : user?.email?.trim();
if (isLoading) {
return (
@@ -61,16 +65,16 @@ export const AvatarDropdown = () => {
/>
</DropdownMenuTrigger>
<DropdownMenuContent align='end'>
{(user?.name ?? user?.email) && (
{displayName && (
<>
<DropdownMenuLabel className='text-center font-bold'>
{user.name?.trim() ?? user.email?.trim()}
{displayName}
</DropdownMenuLabel>
<DropdownMenuSeparator />
</>
)}
<DropdownMenuItem asChild>
<Link href='/profile' className='w-full cursor-pointer'>
<Link href='/settings/profile' className='w-full cursor-pointer'>
Edit Profile
</Link>
</DropdownMenuItem>