Skip to content

Commit cc8c091

Browse files
committed
Fix thread menu
1 parent 1ce11bc commit cc8c091

File tree

4 files changed

+41
-43
lines changed

4 files changed

+41
-43
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@props(['tag' => null])
22

3-
<span {{ $attributes->class(['text-orange-900 bg-orange-100 border-orange-200' => $tag?->isAnnouncement(), 'text-sm text-gray-900 bg-gray-100 border border-gray-200 rounded py-1.5 px-3 leading-none']) }}>
3+
<span {{ $attributes->class(['text-orange-900 bg-orange-100 border-orange-200' => $tag?->isAnnouncement(), 'inline-block text-sm text-gray-900 bg-gray-100 border border-gray-200 rounded py-1.5 px-3 leading-none']) }}>
44
{{ $slot }}
55
</span>

resources/views/components/threads/reply-menu.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@can(App\Policies\ThreadPolicy::UPDATE, $thread)
1111
@if ($thread->isSolutionReply($reply))
1212
<button
13-
class="flex items-center gap-x-2 font-medium text-lio-500 hover:text-gray-300"
13+
class="flex items-center font-medium text-lio-500 hover:text-gray-300"
1414
@click="activeModal = 'unmarkSolution-{{ $thread->id }}'"
1515
>
1616
<x-heroicon-o-check-badge class="w-6 h-6" />
@@ -27,7 +27,7 @@ class="flex items-center gap-x-2 font-medium text-lio-500 hover:text-gray-300"
2727
</x-modal>
2828
@else
2929
<button
30-
class="flex items-center gap-x-2 font-medium text-gray-300 hover:text-lio-500"
30+
class="flex items-center font-medium text-gray-300 hover:text-lio-500"
3131
@click="activeModal = 'markSolution-{{ $reply->id }}'"
3232
>
3333
<x-heroicon-o-check-badge class="w-6 h-6" />
@@ -45,7 +45,7 @@ class="flex items-center gap-x-2 font-medium text-gray-300 hover:text-lio-500"
4545
@endif
4646
@else
4747
@if ($thread->isSolutionReply($reply))
48-
<span class="flex items-center gap-x-2 font-medium text-lio-500">
48+
<span class="flex items-center font-medium text-lio-500">
4949
<x-heroicon-o-check-badge class="w-6 h-6" />
5050
<span>Solution</span>
5151
</span>

resources/views/components/threads/thread-menu.blade.php

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,44 @@
11
@props(['thread'])
22

3-
@canany([App\Policies\ThreadPolicy::UPDATE, App\Policies\ThreadPolicy::DELETE], $thread)
4-
<div class="flex items-center gap-x-3">
5-
<div class="relative -mr-3" x-data="{ open: false }" @click.outside="open = false">
6-
<button
7-
class="p-2 rounded hover:bg-gray-100"
8-
@click="open = !open"
9-
>
10-
<x-heroicon-o-ellipsis-horizontal class="w-6 h-6" />
11-
</button>
3+
@canany([App\Policies\ThreadPolicy::LOCK, App\Policies\ThreadPolicy::UPDATE, App\Policies\ThreadPolicy::DELETE], $thread)
4+
<div class="relative flex items-center -mr-3" x-data="{ open: false }" @click.outside="open = false">
5+
<button
6+
class="inline-block p-2 rounded hover:bg-gray-100"
7+
@click="open = !open"
8+
>
9+
<x-heroicon-o-ellipsis-horizontal class="w-6 h-6" />
10+
</button>
1211

13-
<div
14-
x-cloak
15-
x-show="open"
16-
class="absolute top-12 right-1 flex flex-col bg-white rounded shadow w-48"
17-
>
18-
@can(App\Policies\ThreadPolicy::LOCK, $thread)
19-
<x-buk-form-button class="flex gap-x-2 p-3 w-full rounded hover:bg-gray-100" action="{{ route('threads.lock', $thread->slug()) }}">
20-
@if ($thread->isLocked())
21-
<x-heroicon-o-lock-closed class="w-6 h-6"/>
22-
Unlock
23-
@else
24-
<x-heroicon-o-lock-open class="w-6 h-6"/>
25-
Lock
26-
@endif
27-
</x-buk-form-button>
28-
@endcan
12+
<div
13+
x-cloak
14+
x-show="open"
15+
class="absolute top-12 right-1 flex flex-col bg-white rounded shadow w-48"
16+
>
17+
@can(App\Policies\ThreadPolicy::LOCK, $thread)
18+
<x-buk-form-button class="flex gap-x-2 p-3 w-full rounded hover:bg-gray-100" action="{{ route('threads.lock', $thread->slug()) }}">
19+
@if ($thread->isLocked())
20+
<x-heroicon-o-lock-closed class="w-6 h-6"/>
21+
Unlock
22+
@else
23+
<x-heroicon-o-lock-open class="w-6 h-6"/>
24+
Lock
25+
@endif
26+
</x-buk-form-button>
27+
@endcan
2928

30-
@can(App\Policies\ThreadPolicy::UPDATE, $thread)
31-
<a class="flex gap-x-2 p-3 rounded hover:bg-gray-100" href="{{ route('threads.edit', $thread->slug()) }}">
32-
<x-heroicon-o-pencil class="w-6 h-6"/>
33-
Edit
34-
</a>
35-
@endcan
29+
@can(App\Policies\ThreadPolicy::UPDATE, $thread)
30+
<a class="flex gap-x-2 p-3 rounded hover:bg-gray-100" href="{{ route('threads.edit', $thread->slug()) }}">
31+
<x-heroicon-o-pencil class="w-6 h-6"/>
32+
Edit
33+
</a>
34+
@endcan
3635

37-
@can(App\Policies\ThreadPolicy::DELETE, $thread)
38-
<button class="flex gap-x-2 p-3 rounded hover:bg-gray-100" @click="activeModal = 'deleteThread'">
39-
<x-heroicon-o-trash class="w-6 h-6 text-red-500"/>
40-
Delete
41-
</button>
42-
@endcan
43-
</div>
36+
@can(App\Policies\ThreadPolicy::DELETE, $thread)
37+
<button class="flex gap-x-2 p-3 rounded hover:bg-gray-100" @click="activeModal = 'deleteThread'">
38+
<x-heroicon-o-trash class="w-6 h-6 text-red-500"/>
39+
Delete
40+
</button>
41+
@endcan
4442
</div>
4543
</div>
4644

resources/views/components/threads/thread.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="thread bg-white shadow rounded">
44
<div class="border-b">
5-
<div class="px-6 pt-4 pb-0 lg:py-2">
5+
<div class="px-4 pt-4 pb-1 lg:px-6 lg:py-2">
66
<div class="flex flex-row justify-between items-start lg:items-center">
77
<div>
88
<div class="flex flex-wrap items-center space-x-1 text-sm">

0 commit comments

Comments
 (0)