From f5b692c710ad774f0866661ebceac5c06aa942b5 Mon Sep 17 00:00:00 2001 From: Endaman Stevy Date: Tue, 7 Jan 2025 20:06:50 +0100 Subject: [PATCH 1/2] feat:(LAR-180) ajout des reaction et scroll sur article feat:(LAR-180) ajout des reactions et scroll sur article --- app/Livewire/Pages/Articles/Index.php | 8 +++++--- .../views/livewire/pages/articles/index.blade.php | 9 +++------ .../livewire/pages/articles/single-post.blade.php | 11 ++++++++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/Livewire/Pages/Articles/Index.php b/app/Livewire/Pages/Articles/Index.php index 150d5ed7..d6aee8ef 100644 --- a/app/Livewire/Pages/Articles/Index.php +++ b/app/Livewire/Pages/Articles/Index.php @@ -6,15 +6,17 @@ use App\Models\Article; use App\Models\Tag; -use App\Traits\WithInfiniteScroll; use App\Traits\WithLocale; use Illuminate\Contracts\View\View; use Livewire\Component; +use Livewire\WithoutUrlPagination; +use Livewire\WithPagination; final class Index extends Component { - use WithInfiniteScroll; use WithLocale; + use WithoutUrlPagination; + use WithPagination; public function mount(): void { @@ -31,7 +33,7 @@ public function render(): View ->published() ->notPinned() ->forLocale($this->locale) - ->paginate($this->perPage), + ->simplePaginate(5), 'tags' => Tag::query()->whereHas('articles', function ($query): void { $query->published(); })->orderBy('name')->get(), diff --git a/resources/views/livewire/pages/articles/index.blade.php b/resources/views/livewire/pages/articles/index.blade.php index ed251a70..4c96002a 100644 --- a/resources/views/livewire/pages/articles/index.blade.php +++ b/resources/views/livewire/pages/articles/index.blade.php @@ -119,11 +119,8 @@ class="flex size-8 items-center justify-center rounded-full text-gray-400 transi @endforeach - @if ($articles->hasMorePages()) -

-

- @endif +
+ {{ $articles->links() }} +
diff --git a/resources/views/livewire/pages/articles/single-post.blade.php b/resources/views/livewire/pages/articles/single-post.blade.php index 257fd01e..33d02816 100644 --- a/resources/views/livewire/pages/articles/single-post.blade.php +++ b/resources/views/livewire/pages/articles/single-post.blade.php @@ -108,12 +108,21 @@ class="object-cover size-full"
-
+
+ +
+ +