mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
Merge pull request 'add link to sections' (#49) from waffle.lord/forge:fix/view-all-filtering into develop
Reviewed-on: SPT/forge#49
This commit is contained in:
commit
2932e48c7f
@ -8,7 +8,6 @@ use Illuminate\Contracts\View\View;
|
|||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Livewire\Attributes\Computed;
|
use Livewire\Attributes\Computed;
|
||||||
use Livewire\Attributes\Session;
|
|
||||||
use Livewire\Attributes\Url;
|
use Livewire\Attributes\Url;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithPagination;
|
use Livewire\WithPagination;
|
||||||
@ -21,28 +20,24 @@ class Index extends Component
|
|||||||
* The search query value.
|
* The search query value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public string $query = '';
|
public string $query = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The sort order value.
|
* The sort order value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public string $order = 'created';
|
public string $order = 'created';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SPT versions filter value.
|
* The SPT versions filter value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public array $sptVersions = [];
|
public array $sptVersions = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The featured filter value.
|
* The featured filter value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public string $featured = 'include';
|
public string $featured = 'include';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,9 +97,6 @@ class Index extends Component
|
|||||||
$this->query = '';
|
$this->query = '';
|
||||||
$this->sptVersions = $this->getLatestMinorVersions()->pluck('version')->toArray();
|
$this->sptVersions = $this->getLatestMinorVersions()->pluck('version')->toArray();
|
||||||
$this->featured = 'include';
|
$this->featured = 'include';
|
||||||
|
|
||||||
// Clear local storage
|
|
||||||
$this->dispatch('clear-filters');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
@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">
|
||||||
{{--
|
<x-page-content-title :title="$title" button-text="View All" :button-link="$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.
|
|
||||||
--}}
|
|
||||||
<x-page-content-title :title="$title" button-text="View All" button-link="/mods" />
|
|
||||||
<x-mod-list :mods="$mods" :versionScope="$versionScope" />
|
<x-mod-list :mods="$mods" :versionScope="$versionScope" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user