Skip to content

Commit

Permalink
refactor: update style in user comments page
Browse files Browse the repository at this point in the history
  • Loading branch information
yilanboy committed Mar 5, 2024
1 parent d954267 commit 027ae1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 0 additions & 3 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ public function run(): void
{
$this->call([
UserSeeder::class,
PostSeeder::class,
TagSeeder::class,
CommentSeeder::class,
]);
}
}
9 changes: 7 additions & 2 deletions resources/views/livewire/shared/users/comments.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class="space-y-6"
x-data="userComments"
x-ref="userComments"
>
@foreach ($comments as $comment)
@forelse ($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"
wire:key="comment-{{ $comment->id }}"
Expand All @@ -63,7 +63,12 @@ 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

{{ $comments->onEachSide(1)->links() }}
</div>
3 changes: 1 addition & 2 deletions resources/views/livewire/shared/users/posts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ class="rounded-md border bg-gray-50 duration-200 dark:border-gray-700 dark:bg-gr
/>
</div>
@endforeach

</x-card>
@else
<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>
<span class="ml-2">目前還沒有發佈任何文章喔!</span>
</x-card>
@endif

0 comments on commit 027ae1e

Please sign in to comment.