Skip to content

Commit

Permalink
refactor: remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
yilanboy committed Feb 27, 2024
1 parent 5b91b5f commit 7ec8878
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
4 changes: 1 addition & 3 deletions resources/views/livewire/shared/posts/posts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,5 @@ class="flex h-36 w-full items-center justify-center transition duration-150 ease
</x-card>
@endforelse

<div>
{{ $posts->onEachSide(1)->links() }}
</div>
{{ $posts->onEachSide(1)->links() }}
</div>
16 changes: 3 additions & 13 deletions resources/views/livewire/shared/users/comments.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class="space-y-6"
x-data="userComments"
>
@forelse ($comments as $comment)
@foreach ($comments as $comment)
<x-dashed-card
class="group relative max-h-64 cursor-pointer overflow-hidden after:absolute after:inset-x-0 after:bottom-0 after:h-1/2 after:bg-gradient-to-b after:from-transparent after:to-gray-100 dark:after:to-gray-800"
>
Expand All @@ -39,17 +39,7 @@ class="absolute bottom-3 right-3 z-10 flex items-center rounded-lg bg-emerald-60
<span class="ml-2">{{ $comment->created_at->diffForHumans() }}</span>
</div>
</x-dashed-card>
@endforeach

@empty
<x-card class="flex h-32 items-center justify-center text-gray-400 dark:text-gray-600">
<x-icon.exclamation-circle class="w-6" />
<span class="ml-2">目前沒有留言,快點找文章進行留言吧!</span>
</x-card>
@endforelse

@if ($comments->count() > 0)
<div>
{{ $comments->onEachSide(1)->links() }}
</div>
@endif
{{ $comments->onEachSide(1)->links() }}
</div>

0 comments on commit 7ec8878

Please sign in to comment.