diff --git a/app/Livewire/Mod/Index.php b/app/Livewire/Mod/Index.php index f8d8b58..69cabb4 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'; /** @@ -102,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'); } /** 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/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 04b1591..6becca0 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -23,7 +23,7 @@ class DatabaseSeeder extends Seeder // how many of each "thing" to make during seeding $userCount = 100; $modCount = 300; - $modVersionCount = 500; + $modVersionCount = 3000; // Create a few SPT versions. $spt_versions = SptVersion::factory(30)->create(); diff --git a/resources/views/components/mod-list-section-partial.blade.php b/resources/views/components/mod-list-section-partial.blade.php index efbbc7a..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']) +@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 diff --git a/resources/views/components/mod-list-stats.blade.php b/resources/views/components/mod-list-stats.blade.php index 0c954e9..ab2cdd2 100644 --- a/resources/views/components/mod-list-stats.blade.php +++ b/resources/views/components/mod-list-stats.blade.php @@ -1,18 +1,32 @@

class(['text-slate-700 dark:text-gray-300 text-sm']) }}> - {{ Number::downloads($mod->downloads) }} downloads - @if(!is_null($mod->created_at)) - - — Created - - - @elseif(!is_null($modVersion->updated_at)) - - — Updated - - - @endif +

+
+
+ + + + + @if(!is_null($mod->updated_at)) + + @elseif(!is_null($mod->created_at)) + + @else + N/A + @endif + +
+
+
+ + {{ Number::downloads($mod->downloads) }} + + + + +
+