Feature/refactor source mangas screen (#314)

* Refactor "SourceMangas"

* Refactor "SourceMangas" - Show loading placeholder on filter reset or submit

Due to the url being the same for all "filter requests" the loading state doesn't get changed by SWR.
Instead, only the "isValidating" state gets updated.

* Refactor "SourceMangas" - Update routing

* Refactor "SourceMangas" - Prevent duplicated mangas in grid

There is a possibility that the "latest" endpoint returns the same manga on different pages

* Always set the toolbar content on the manga page

"setAction" wasn't called on the manga page, thus, in case the previous page didn't unset the action, it never got unset

* Rename source content type "Browse" to "Popular"
This commit is contained in:
schroda
2023-05-28 12:16:06 +02:00
committed by GitHub
parent 1480507c35
commit 46a7ff6e3b
8 changed files with 318 additions and 248 deletions

View File

@@ -37,7 +37,6 @@ interface IFilters1 {
updateFilterValue: Function;
resetFilterValue: Function;
setTriggerUpdate: Function;
setSearch: Function;
update: any;
}
@@ -142,7 +141,6 @@ export default function SourceOptions({
updateFilterValue,
resetFilterValue,
setTriggerUpdate,
setSearch,
update,
}: IFilters1) {
const { t } = useTranslation();
@@ -155,7 +153,6 @@ export default function SourceOptions({
function handleSubmit() {
setTriggerUpdate(0);
setSearch(true);
setFilterOptions(false);
}