0.0.8.2
This commit is contained in:
+17
-19
@@ -241,8 +241,8 @@ export function SiteHeader() {
|
||||
<ChevronDown className="h-4 w-4 flex-shrink-0" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start" className="w-[var(--radix-dropdown-menu-trigger-width)] min-w-[200px]">
|
||||
<DropdownMenuLabel>我的家族树</DropdownMenuLabel>
|
||||
<DropdownMenuContent align="start" className="w-[300px]">
|
||||
<DropdownMenuLabel className="font-light">我的家族树</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
{familyTrees.map((tree) => (
|
||||
<DropdownMenuItem
|
||||
@@ -253,28 +253,26 @@ export function SiteHeader() {
|
||||
const currentPath = window.location.pathname
|
||||
router.push(`${currentPath}?treeId=${tree.id}`)
|
||||
}}
|
||||
className="cursor-pointer flex items-center justify-between group"
|
||||
className="cursor-pointer flex items-center justify-between group py-3"
|
||||
>
|
||||
<div className="flex items-center overflow-hidden">
|
||||
<span className="truncate">{tree.name}</span>
|
||||
<div className="flex items-center gap-2 flex-1 min-w-0">
|
||||
<span className="truncate flex-1">{tree.name}</span>
|
||||
{getRoleBadge(tree.currentUserRole)}
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{currentTree?.id === tree.id && (
|
||||
<span className="text-primary">✓</span>
|
||||
)}
|
||||
{permissions.canDeleteTree(tree.currentUserRole) && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-6 w-6 ml-auto"
|
||||
onClick={(e) => handleDeleteTree(tree, e)}
|
||||
disabled={deletingTreeId === tree.id}
|
||||
>
|
||||
<Trash2 className="h-3 w-3" />
|
||||
</Button>
|
||||
<span className="text-primary flex-shrink-0">✓</span>
|
||||
)}
|
||||
</div>
|
||||
{permissions.canDeleteTree(tree.currentUserRole) && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-6 w-6 ml-2 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"
|
||||
onClick={(e) => handleDeleteTree(tree, e)}
|
||||
disabled={deletingTreeId === tree.id}
|
||||
>
|
||||
<Trash2 className="h-3 w-3" />
|
||||
</Button>
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
Reference in New Issue
Block a user