Move to Zustand and add Filters to web_test (#1077)

* Moved to zustand and started refactored filters

- Move from redux to zustand
- Refactor Filters typings and add some helper types
- Add Filters button and Picker/Switch filter options
- Fixed Syosetu typings

* Add rule consistent-type-definitions

- Add consistent-type-definitions eslint rule to force consistent use of types instead of interfaces
- Run eslint to auto-change every interface to types

https://dev.to/atheodosiou/types-vs-interfaces-in-typescript-making-the-right-choice-48a4
https://www.youtube.com/watch?v=zM9UPcIyyhQ

* Add other filters and refactor

- Move Dialog to FiltersDialog
- CheckboxFilter, TextFilter, XCheckboxFilter added
- Added TripleCheckbox and TripleSwitch as tri-state checkbox/switch items using Mui stylings

* TriStateCheckbox/Switch refactor

- Change name of TripleSwitch and TripleCheckbox to TriState
- Change slightly TriStateSwitch and StyledSwitch styles
- Add option to change into TriStateSwitches via `localStorage` value `useSwitches`

* Refactor code and fix issues

* fix: prettier

---------

Co-authored-by: nyagami <hoangquan05112002@gmail.com>
This commit is contained in:
Marcin Majewski
2024-08-18 17:31:41 +02:00
committed by GitHub
parent eb5522b066
commit b2caf26da3
73 changed files with 1914 additions and 916 deletions
+12 -12
View File
@@ -226,7 +226,7 @@ class Bookriver implements Plugin.PluginBase {
}
export default new Bookriver();
interface response {
type response = {
props: {
pageProps: {
state: {
@@ -241,9 +241,9 @@ interface response {
};
};
};
}
};
interface BooksEntity {
type BooksEntity = {
name: string;
coverImages: { url: string }[];
slug: string;
@@ -256,17 +256,17 @@ interface BooksEntity {
chapters: Chapter[];
};
statusComplete: string;
}
};
interface Chapter {
type Chapter = {
name: string;
available: boolean;
firstPublishedAt?: Date | null;
createdAt?: Date | null;
chapterId: number | string;
}
};
interface responseChapter {
type responseChapter = {
data: {
id: number;
bookId: number;
@@ -288,12 +288,12 @@ interface responseChapter {
};
publicationScheduledFor?: null;
};
}
};
interface responseSearch {
type responseSearch = {
data: Data;
total: number;
}
interface Data {
};
type Data = {
books?: BooksEntity[] | null;
}
};