From 0a271ff03e53680a3a8a03950ddfb19c14ed257f Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Mon, 9 Sep 2024 16:20:54 -0400 Subject: [PATCH 1/3] add link to sections --- app/View/Components/ModListSection.php | 3 +++ resources/views/components/mod-list-section-partial.blade.php | 4 ++-- resources/views/components/mod-list-section.blade.php | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/View/Components/ModListSection.php b/app/View/Components/ModListSection.php index d08350e..f9c257c 100644 --- a/app/View/Components/ModListSection.php +++ b/app/View/Components/ModListSection.php @@ -88,16 +88,19 @@ class ModListSection extends Component 'title' => __('Featured Mods'), 'mods' => $this->modsFeatured, 'versionScope' => 'latestVersion', + 'link' => '/mods?featured=only', ], [ 'title' => __('Newest Mods'), 'mods' => $this->modsLatest, 'versionScope' => 'latestVersion', + 'link' => '/mods', ], [ 'title' => __('Recently Updated Mods'), 'mods' => $this->modsUpdated, 'versionScope' => 'lastUpdatedVersion', + 'link' => '/mods?order=updated', ], ]; } diff --git a/resources/views/components/mod-list-section-partial.blade.php b/resources/views/components/mod-list-section-partial.blade.php index efbbc7a..79c68c9 100644 --- a/resources/views/components/mod-list-section-partial.blade.php +++ b/resources/views/components/mod-list-section-partial.blade.php @@ -1,10 +1,10 @@ -@props(['mods', 'versionScope', 'title']) +@props(['mods', 'versionScope', 'title', 'link'])
{{-- TODO: The button-link should be dynamic based on the versionScope. Eg. Featured `View All` button should take the user to the mods page with the `featured` query parameter set. --}} - +
diff --git a/resources/views/components/mod-list-section.blade.php b/resources/views/components/mod-list-section.blade.php index a7528cd..15a0daa 100644 --- a/resources/views/components/mod-list-section.blade.php +++ b/resources/views/components/mod-list-section.blade.php @@ -3,5 +3,6 @@ 'title' => $section['title'], 'mods' => $section['mods'], 'versionScope' => $section['versionScope'], + 'link' => $section['link'] ]) @endforeach From ed2091fb23647487808b9419dc29f23992cd9355 Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Tue, 10 Sep 2024 09:10:16 -0400 Subject: [PATCH 2/3] remove session properties --- app/Livewire/Mod/Index.php | 5 ----- .../views/components/mod-list-section-partial.blade.php | 4 ---- 2 files changed, 9 deletions(-) diff --git a/app/Livewire/Mod/Index.php b/app/Livewire/Mod/Index.php index 5760c14..602a0d6 100644 --- a/app/Livewire/Mod/Index.php +++ b/app/Livewire/Mod/Index.php @@ -8,7 +8,6 @@ use Illuminate\Contracts\View\View; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Cache; use Livewire\Attributes\Computed; -use Livewire\Attributes\Session; use Livewire\Attributes\Url; use Livewire\Component; use Livewire\WithPagination; @@ -21,28 +20,24 @@ class Index extends Component * The search query value. */ #[Url] - #[Session] public string $query = ''; /** * The sort order value. */ #[Url] - #[Session] public string $order = 'created'; /** * The SPT versions filter value. */ #[Url] - #[Session] public array $sptVersions = []; /** * The featured filter value. */ #[Url] - #[Session] public string $featured = 'include'; /** diff --git a/resources/views/components/mod-list-section-partial.blade.php b/resources/views/components/mod-list-section-partial.blade.php index 79c68c9..21dc3f9 100644 --- a/resources/views/components/mod-list-section-partial.blade.php +++ b/resources/views/components/mod-list-section-partial.blade.php @@ -1,10 +1,6 @@ @props(['mods', 'versionScope', 'title', 'link'])
- {{-- - TODO: The button-link should be dynamic based on the versionScope. Eg. Featured `View All` button should take - the user to the mods page with the `featured` query parameter set. - --}}
From 8211731c324c3d8ead148e1ddda42c34d7b18f4f Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Tue, 10 Sep 2024 09:20:53 -0400 Subject: [PATCH 3/3] remove clear filters call --- app/Livewire/Mod/Index.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Livewire/Mod/Index.php b/app/Livewire/Mod/Index.php index 602a0d6..1e0a7ad 100644 --- a/app/Livewire/Mod/Index.php +++ b/app/Livewire/Mod/Index.php @@ -97,9 +97,6 @@ class Index extends Component $this->query = ''; $this->sptVersions = $this->getLatestMinorVersions()->pluck('version')->toArray(); $this->featured = 'include'; - - // Clear local storage - $this->dispatch('clear-filters'); } /**