Add likes to comments

This commit is contained in:
2026-01-10 19:41:23 +01:00
parent 41c34e6d89
commit b133db0573
3 changed files with 74 additions and 2 deletions

View File

@@ -37,10 +37,28 @@
<div class="text-gray-700 dark:text-gray-200">{!! $comment->presenter()->markdownBody() !!}</div>
@endif
</div>
<div class="mt-2 space-x-2">
<div class="mt-2 space-x-2 flex flex-row">
@guest
<span data-te-toggle="tooltip" title="Please login to like the episode" class=" text-gray-800 cursor-pointer dark:text-gray-200">
<i class="fa-regular fa-heart pr-[4px]"></i> {{ $comment->likeCount() }}
</span>
@endguest
@auth
<!-- Like Button -->
<button class="text-xl text-gray-800 dark:text-gray-200 leading-tight cursor-pointer whitespace-nowrap" wire:click="like">
@if ($liked)
<i class="fa-solid fa-heart pr-[4px] text-rose-600"></i> {{ $likeCount }}
@else
<i class="fa-regular fa-heart pr-[4px]"></i> {{ $likeCount }}
@endif
</button>
@endauth
<span class="text-gray-500 dark:text-gray-300 font-medium">
{{ $comment->presenter()->relativeCreatedAt() }}
</span>
@auth
@if ($comment->depth() < 2)
<button wire:click="$toggle('isReplying')" type="button" class="text-gray-900 dark:text-gray-100 font-medium">