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:
@@ -1147,7 +1147,7 @@ class RNBH implements Plugin.PluginBase {
|
||||
|
||||
export default new RNBH();
|
||||
|
||||
interface responseNovels {
|
||||
type responseNovels = {
|
||||
id: number;
|
||||
names: Names;
|
||||
rating: number;
|
||||
@@ -1158,27 +1158,27 @@ interface responseNovels {
|
||||
status: string;
|
||||
user?: User;
|
||||
counts: Counts;
|
||||
}
|
||||
interface Names {
|
||||
};
|
||||
type Names = {
|
||||
eng?: string;
|
||||
rus?: string;
|
||||
original: string;
|
||||
}
|
||||
interface Poster {
|
||||
};
|
||||
type Poster = {
|
||||
medium: string;
|
||||
small: string;
|
||||
color: string;
|
||||
}
|
||||
interface User {
|
||||
};
|
||||
type User = {
|
||||
status?: null;
|
||||
liked: boolean;
|
||||
}
|
||||
interface Counts {
|
||||
};
|
||||
type Counts = {
|
||||
volumes: string;
|
||||
chapters: string;
|
||||
}
|
||||
};
|
||||
|
||||
interface responseNovel {
|
||||
type responseNovel = {
|
||||
id: number;
|
||||
names: Names;
|
||||
rating: number;
|
||||
@@ -1195,55 +1195,53 @@ interface responseNovel {
|
||||
start_reading_url: string;
|
||||
html: string;
|
||||
tags: Tags;
|
||||
}
|
||||
interface Posters {
|
||||
};
|
||||
type Posters = {
|
||||
big: string;
|
||||
medium: string;
|
||||
small: string;
|
||||
tiny: string;
|
||||
color: string;
|
||||
}
|
||||
interface AuthorsEntity {
|
||||
};
|
||||
type AuthorsEntity = {
|
||||
name_eng: string;
|
||||
pivot: Pivot;
|
||||
}
|
||||
interface Pivot {
|
||||
};
|
||||
type Pivot = {
|
||||
ranobe_id: number;
|
||||
author_id?: number;
|
||||
translator_id?: number;
|
||||
}
|
||||
interface TranslatorsEntity {
|
||||
};
|
||||
type TranslatorsEntity = {
|
||||
name: string;
|
||||
pivot: Pivot;
|
||||
}
|
||||
interface Status {
|
||||
};
|
||||
type Status = {
|
||||
id: number;
|
||||
title: string;
|
||||
}
|
||||
interface Tags {
|
||||
name: string;
|
||||
};
|
||||
type Tags = {
|
||||
events?: GenresOrEntity[] | null;
|
||||
genres?: GenresOrEntity[] | null;
|
||||
}
|
||||
interface GenresOrEntity {
|
||||
};
|
||||
type GenresOrEntity = {
|
||||
id: number;
|
||||
names: Names;
|
||||
url: string;
|
||||
title: string;
|
||||
description?: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
interface VolumesEntity {
|
||||
type VolumesEntity = {
|
||||
id: number;
|
||||
num: number;
|
||||
name: string;
|
||||
status: Status;
|
||||
chapters?: ChaptersEntity[] | null;
|
||||
}
|
||||
interface Status {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
interface ChaptersEntity {
|
||||
};
|
||||
|
||||
type ChaptersEntity = {
|
||||
id: number;
|
||||
name: string;
|
||||
num: number;
|
||||
@@ -1252,18 +1250,18 @@ interface ChaptersEntity {
|
||||
has_images: boolean;
|
||||
changed_at: string;
|
||||
comments_count: string;
|
||||
}
|
||||
};
|
||||
|
||||
interface responseSearch {
|
||||
type responseSearch = {
|
||||
meta: Meta;
|
||||
collections?: DataEntity[] | null;
|
||||
data?: DataEntity[] | null;
|
||||
}
|
||||
interface Meta {
|
||||
};
|
||||
type Meta = {
|
||||
key: string;
|
||||
title: string;
|
||||
}
|
||||
interface DataEntity {
|
||||
};
|
||||
type DataEntity = {
|
||||
id: number;
|
||||
names?: Names | null;
|
||||
description?: string | null;
|
||||
@@ -1275,10 +1273,10 @@ interface DataEntity {
|
||||
roles?: null[] | null;
|
||||
avatar?: Avatar | null;
|
||||
has_plus?: boolean | null;
|
||||
}
|
||||
interface Avatar {
|
||||
};
|
||||
type Avatar = {
|
||||
big: string;
|
||||
color: string;
|
||||
thumb: string;
|
||||
is_default: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user