Organize logout button within user profile dropdown menu
Refactors the Home page UI to integrate the logout button into a user profile dropdown menu, improving navigation and user experience. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 069d4324-6c40-4355-955e-c714a50de1ea Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/069d4324-6c40-4355-955e-c714a50de1ea/9tQ591o
This commit is contained in:
@ -144,21 +144,28 @@ export default function Home() {
|
|||||||
Admin Dashboard
|
Admin Dashboard
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<div className="flex items-center space-x-2 px-3 py-1 bg-gray-100 rounded-md">
|
<DropdownMenu>
|
||||||
<User className="h-4 w-4 text-gray-600" />
|
<DropdownMenuTrigger asChild>
|
||||||
<span className="text-sm font-medium text-gray-700" data-testid="user-name">
|
<div className="flex items-center space-x-2 px-3 py-1 bg-gray-100 rounded-md cursor-pointer hover:bg-gray-200 transition-colors" data-testid="user-profile-chip">
|
||||||
{user.firstName} {user.lastName}
|
<User className="h-4 w-4 text-gray-600" />
|
||||||
</span>
|
<span className="text-sm font-medium text-gray-700" data-testid="user-name">
|
||||||
</div>
|
{user.firstName} {user.lastName}
|
||||||
|
</span>
|
||||||
<Button
|
</div>
|
||||||
variant="ghost"
|
</DropdownMenuTrigger>
|
||||||
size="sm"
|
<DropdownMenuContent align="end" className="w-48">
|
||||||
onClick={handleLogout}
|
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
||||||
data-testid="button-logout"
|
<DropdownMenuSeparator />
|
||||||
>
|
<DropdownMenuItem
|
||||||
<LogOut className="h-4 w-4" />
|
onClick={handleLogout}
|
||||||
</Button>
|
className="cursor-pointer text-red-600"
|
||||||
|
data-testid="button-logout"
|
||||||
|
>
|
||||||
|
<LogOut className="h-4 w-4 mr-2" />
|
||||||
|
Logout
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user