This commit is contained in:
hailin 2025-03-15 21:04:34 +08:00
parent 561f1d57e0
commit 4ee54e03ca
1 changed files with 7 additions and 9 deletions

View File

@ -46,25 +46,22 @@ export function UserMenu({ user }: { user: UserData }) {
<Button variant="ghost" className="px-2"> <Button variant="ghost" className="px-2">
{user?.image ? ( {user?.image ? (
<Image <Image
className="h-6 w-6 select-none rounded-full ring-1 ring-zinc-100/10 transition-opacity duration-300 hover:opacity-80" className="h-12 w-12 select-none rounded-full ring-1 ring-zinc-100/10 transition-opacity duration-300 hover:opacity-80"
src={`${user.image}&s=60`} src={`${user.image}&s=60`}
alt='User profile image' alt='User profile image'
width={24} width={48}
height={24} height={48}
/> />
) : ( ) : (
<div className="flex h-7 w-7 shrink-0 select-none items-center justify-center rounded-full bg-muted/50 text-xs font-medium uppercase text-muted-foreground"> <div className="flex h-12 w-12 shrink-0 select-none items-center justify-center rounded-full bg-muted/50 text-xs font-medium uppercase text-muted-foreground">
{user?.user_name ? getUserInitials(user?.user_name.slice(0, 2)) : null} {user?.user_name ? getUserInitials(user?.user_name.slice(0, 2)) : null}
</div> </div>
)} )}
<span className="ml-2 hidden lg:flex">{user?.user_name && getUserInitials(user?.user_name)}</span> <span className="hidden">{user?.user_name && getUserInitials(user?.user_name)}</span>
{/* <span className="ml-2 hidden lg:flex">{user?.user_name && getUserInitials(user?.user_name)}</span> */}
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent sideOffset={8} align="start" className="w-[180px]"> <DropdownMenuContent sideOffset={8} align="start" className="w-[180px]">
{/* <DropdownMenuItem className="flex-col items-start">
<div className="text-xs font-medium">{user?.user_name}</div>
<div className="text-xs text-zinc-500">{user?.user_name}</div>
</DropdownMenuItem> */}
{/* 新增 "Profile" 选项 */} {/* 新增 "Profile" 选项 */}
<DropdownMenuItem <DropdownMenuItem
@ -117,6 +114,7 @@ export function UserMenu({ user }: { user: UserData }) {
> >
Log Out Log Out
</DropdownMenuItem> </DropdownMenuItem>
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </DropdownMenu>
</div> </div>