Top menu the login button need show which user login, base on email name

This commit is contained in:
Indigo Tang 2025-07-06 12:52:32 +00:00
parent f17120960e
commit c7900221c3
3 changed files with 5 additions and 5 deletions

View File

@ -102,12 +102,13 @@ export default function Header() {
{isMounted && isAuthenticated ? ( {isMounted && isAuthenticated ? (
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon" className="rounded-full h-9 w-9 md:h-10 md:w-10"> <Button variant="ghost" size="sm" className="px-2 sm:px-3 capitalize">
<UserCircle2 className="h-6 w-6" /> <UserCircle2 className="mr-2 h-4 w-4" />
{userEmail?.split('@')[0]}
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent align="end"> <DropdownMenuContent align="end">
<DropdownMenuLabel>{t('header.my_account')}</DropdownMenuLabel> <DropdownMenuLabel className="truncate">{userEmail}</DropdownMenuLabel>
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<DropdownMenuItem asChild> <DropdownMenuItem asChild>
<Link href={`/${locale}/dashboard`}> <Link href={`/${locale}/dashboard`}>
@ -154,8 +155,7 @@ export default function Header() {
) : ( ) : (
// Skeleton for auth buttons during hydration // Skeleton for auth buttons during hydration
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<div className="h-9 w-20 bg-muted rounded-md animate-pulse"></div> <div className="h-9 w-28 bg-muted rounded-md animate-pulse"></div>
<div className="h-9 w-24 bg-muted rounded-md animate-pulse"></div>
</div> </div>
)} )}
</nav> </nav>

Binary file not shown.

Binary file not shown.