File tree 3 files changed +18
-10
lines changed
app/Livewire/Pages/Articles
resources/views/livewire/pages/articles
3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 6
6
7
7
use App \Models \Article ;
8
8
use App \Models \Tag ;
9
- use App \Traits \WithInfiniteScroll ;
10
9
use App \Traits \WithLocale ;
11
10
use Illuminate \Contracts \View \View ;
12
11
use Livewire \Component ;
12
+ use Livewire \WithoutUrlPagination ;
13
+ use Livewire \WithPagination ;
13
14
14
15
final class Index extends Component
15
16
{
16
- use WithInfiniteScroll;
17
17
use WithLocale;
18
+ use WithoutUrlPagination;
19
+ use WithPagination;
18
20
19
21
public function mount (): void
20
22
{
@@ -31,7 +33,7 @@ public function render(): View
31
33
->published ()
32
34
->notPinned ()
33
35
->forLocale ($ this ->locale )
34
- ->paginate ( $ this -> perPage ),
36
+ ->simplePaginate ( 20 ),
35
37
'tags ' => Tag::query ()->whereHas ('articles ' , function ($ query ): void {
36
38
$ query ->published ();
37
39
})->orderBy ('name ' )->get (),
Original file line number Diff line number Diff line change @@ -119,11 +119,8 @@ class="flex size-8 items-center justify-center rounded-full text-gray-400 transi
119
119
@endforeach
120
120
</div >
121
121
122
- @if ($articles -> hasMorePages () )
123
- <p x-intersect =" @this .call('loadMore')" class =" mt-10 flex items-center justify-center gap-2" >
124
- <x-loader class =" text-primary-600" aria-hidden =" true" />
125
- {{ __ (' global.loading' ) } }
126
- </p >
127
- @endif
122
+ <div class =" mt-4" >
123
+ {{ $articles -> links () } }
124
+ </div >
128
125
</x-container >
129
126
</div >
Original file line number Diff line number Diff line change @@ -108,12 +108,21 @@ class="object-cover size-full"
108
108
</div >
109
109
110
110
<div class =" lg:grid lg:grid-cols-4 lg:gap-16" >
111
- <div class =" overflow-x- hidden lg:col-span-3" >
111
+ <div class =" overflow-hidden lg:col-span-3" >
112
112
<x-markdown-content
113
113
id =" content"
114
114
class =" prose prose-green text-gray-500 dark:text-gray-400 dark:prose-invert lg:max-w-none"
115
115
:content =" $article->body"
116
116
/>
117
+
118
+ <div class =" relative inline-flex mt-5 space-x-4" >
119
+ <livewire:components .reactions
120
+ wire:key =" {{ $article -> id } }"
121
+ :model =" $article"
122
+ :with-place-holder =" false"
123
+ :with-background =" false"
124
+ />
125
+ </div >
117
126
</div >
118
127
<div class =" hidden lg:block" >
119
128
<x-sticky-content class =" space-y-10" >
You can’t perform that action at this time.
0 commit comments