From a4f85c53c5bba486924129930a8461463a25a920 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Tue, 6 Jan 2026 11:13:26 +0700 Subject: [PATCH] feat: Introduce custom Livewire pagination component and apply it to news and announcements, enhancing list rendering with `wire:key`. --- .../livewire/home/announcements.blade.php | 6 +- .../livewire/home/custom-pagination.blade.php | 57 +++++++++++++++++++ .../views/livewire/home/news/index.blade.php | 4 +- 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 resources/views/livewire/home/custom-pagination.blade.php diff --git a/resources/views/livewire/home/announcements.blade.php b/resources/views/livewire/home/announcements.blade.php index 40d21dc..e521fc5 100644 --- a/resources/views/livewire/home/announcements.blade.php +++ b/resources/views/livewire/home/announcements.blade.php @@ -31,11 +31,11 @@ class="bi bi-megaphone text-white icon-small me-10px">{{ $pageTitle }}
-
    +
    • @foreach ($announcements as $announcement) -
    • +
    • @@ -63,7 +63,7 @@ class="card-title mb-10px fw-600 fs-19 lh-28 text-dark-gray text-primary-hover">
- {{ $announcements->links() }} + {{ $announcements->links('livewire.home.custom-pagination') }}
diff --git a/resources/views/livewire/home/custom-pagination.blade.php b/resources/views/livewire/home/custom-pagination.blade.php new file mode 100644 index 0000000..bb5d632 --- /dev/null +++ b/resources/views/livewire/home/custom-pagination.blade.php @@ -0,0 +1,57 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/livewire/home/news/index.blade.php b/resources/views/livewire/home/news/index.blade.php index f11ac5f..357b304 100644 --- a/resources/views/livewire/home/news/index.blade.php +++ b/resources/views/livewire/home/news/index.blade.php @@ -33,7 +33,7 @@ class="bi bi-megaphone text-white icon-small me-10px">{{ $pageTitle }} @forelse($news as $item) -
+
@if ($item->thumbnail)
@@ -78,7 +78,7 @@ class="bg-base-color"> @endforelse
- {{ $news->links() }} + {{ $news->links('livewire.home.custom-pagination') }}