Skip to content

Commit bda4494

Browse files
committed
Fix btn visibility in menu tree item
1 parent 8490393 commit bda4494

File tree

1 file changed

+26
-30
lines changed

1 file changed

+26
-30
lines changed
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="menu-tree-item" data-item-id="{{ $item->id }}">
22
<div class="flex items-center p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 group hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors {{ $depth > 0 ? 'ml-' . ($depth * 8) : '' }}">
3-
3+
44
@if($showActions)
55
<!-- Drag Handle -->
6-
<div class="drag-handle cursor-move text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 mr-4 opacity-0 group-hover:opacity-100 transition-opacity">
6+
<div class="drag-handle cursor-move text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 mr-4">
77
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
88
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8h16M4 16h16"></path>
99
</svg>
@@ -12,7 +12,7 @@
1212

1313
<!-- Expand/Collapse Button for items with children -->
1414
@if($this->hasChildren())
15-
<button
15+
<button
1616
type="button"
1717
wire:click="toggleExpanded"
1818
class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
@@ -30,9 +30,11 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
3030
<div class="flex items-center justify-between">
3131
<div class="flex items-center space-x-3">
3232
@if($item->icon)
33-
<span class="text-gray-500 text-lg">{!! $item->icon !!}</span>
33+
<x-filament::icon
34+
icon="{{ $item->icon }}"
35+
class="h-5 w-5 text-gray-500 text-lg"/>
3436
@endif
35-
37+
3638
<div>
3739
<p class="text-sm font-medium text-gray-900 dark:text-white truncate">
3840
{{ $this->getItemDisplayLabel() }}
@@ -41,7 +43,7 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
4143
{{ $this->getItemTypeLabel() }}
4244
</p>
4345
</div>
44-
46+
4547
@if(!$item->is_visible)
4648
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300">
4749
{{ flexiblePagesTrans('menu_items.status.hidden') }}
@@ -56,42 +58,36 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
5658
<x-filament::button
5759
color="gray"
5860
size="xs"
61+
icon="heroicon-o-plus"
62+
tooltip="{{ flexiblePagesTrans('menu_items.tree.add_child') }}"
63+
label-sr-only="{{ flexiblePagesTrans('menu_items.tree.add_child') }}"
5964
wire:click="mountAction('addChild')"
60-
>
61-
<x-slot name="icon">
62-
heroicon-o-plus
63-
</x-slot>
64-
{{ flexiblePagesTrans('menu_items.tree.add_child') }}
65-
</x-filament::button>
65+
></x-filament::button>
6666
@endif
67-
67+
6868
<x-filament::button
69-
color="primary"
69+
color="gray"
7070
size="xs"
71+
icon="heroicon-o-pencil"
72+
tooltip="{{ flexiblePagesTrans('menu_items.tree.edit') }}"
73+
label-sr-only="{{ flexiblePagesTrans('menu_items.tree.edit') }}"
7174
wire:click="mountAction('edit')"
72-
>
73-
<x-slot name="icon">
74-
heroicon-o-pencil
75-
</x-slot>
76-
{{ flexiblePagesTrans('menu_items.tree.edit') }}
77-
</x-filament::button>
78-
75+
></x-filament::button>
76+
7977
<x-filament::button
8078
color="danger"
8179
size="xs"
80+
icon="heroicon-o-trash"
81+
tooltip="{{ flexiblePagesTrans('menu_items.tree.delete') }}"
82+
label-sr-only="{{ flexiblePagesTrans('menu_items.tree.delete') }}"
8283
wire:click="mountAction('delete')"
83-
>
84-
<x-slot name="icon">
85-
heroicon-o-trash
86-
</x-slot>
87-
{{ flexiblePagesTrans('menu_items.tree.delete') }}
88-
</x-filament::button>
84+
></x-filament::button>
8985
</div>
9086
@endif
9187
</div>
9288
</div>
9389
</div>
94-
90+
9591
<!-- Children -->
9692
@if($this->hasChildren() && $isExpanded)
9793
<div class="space-y-2 mt-2" wire:key="children-{{ $item->id }}">
@@ -101,8 +97,8 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
10197
'depth' => $depth + 1,
10298
'maxDepth' => $maxDepth,
10399
'showActions' => $showActions
104-
], key($child->id))
100+
], key: $child->id)
105101
@endforeach
106102
</div>
107103
@endif
108-
</div>
104+
</div>

0 commit comments

Comments
 (0)