add link to sections

This commit is contained in:
IsWaffle 2024-09-09 16:20:54 -04:00
parent 424a329688
commit 0a271ff03e
3 changed files with 6 additions and 2 deletions

View File

@ -88,16 +88,19 @@ class ModListSection extends Component
'title' => __('Featured Mods'), 'title' => __('Featured Mods'),
'mods' => $this->modsFeatured, 'mods' => $this->modsFeatured,
'versionScope' => 'latestVersion', 'versionScope' => 'latestVersion',
'link' => '/mods?featured=only',
], ],
[ [
'title' => __('Newest Mods'), 'title' => __('Newest Mods'),
'mods' => $this->modsLatest, 'mods' => $this->modsLatest,
'versionScope' => 'latestVersion', 'versionScope' => 'latestVersion',
'link' => '/mods',
], ],
[ [
'title' => __('Recently Updated Mods'), 'title' => __('Recently Updated Mods'),
'mods' => $this->modsUpdated, 'mods' => $this->modsUpdated,
'versionScope' => 'lastUpdatedVersion', 'versionScope' => 'lastUpdatedVersion',
'link' => '/mods?order=updated',
], ],
]; ];
} }

View File

@ -1,10 +1,10 @@
@props(['mods', 'versionScope', 'title']) @props(['mods', 'versionScope', 'title', 'link'])
<div class="mx-auto max-w-7xl px-4 pt-16 sm:px-6 lg:px-8"> <div class="mx-auto max-w-7xl px-4 pt-16 sm:px-6 lg:px-8">
{{-- {{--
TODO: The button-link should be dynamic based on the versionScope. Eg. Featured `View All` button should take 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. the user to the mods page with the `featured` query parameter set.
--}} --}}
<x-page-content-title :title="$title" button-text="View All" button-link="/mods" /> <x-page-content-title :title="$title" button-text="View All" :button-link="$link" />
<x-mod-list :mods="$mods" :versionScope="$versionScope" /> <x-mod-list :mods="$mods" :versionScope="$versionScope" />
</div> </div>

View File

@ -3,5 +3,6 @@
'title' => $section['title'], 'title' => $section['title'],
'mods' => $section['mods'], 'mods' => $section['mods'],
'versionScope' => $section['versionScope'], 'versionScope' => $section['versionScope'],
'link' => $section['link']
]) ])
@endforeach @endforeach