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:
@@ -368,14 +368,14 @@ function decrypt(
|
||||
return text;
|
||||
}
|
||||
|
||||
interface authorization {
|
||||
type authorization = {
|
||||
userId: number;
|
||||
token: string;
|
||||
issued: string;
|
||||
expires: string;
|
||||
}
|
||||
};
|
||||
|
||||
interface currentUser {
|
||||
type currentUser = {
|
||||
id: number;
|
||||
userName: string;
|
||||
fio: string;
|
||||
@@ -391,9 +391,9 @@ interface currentUser {
|
||||
emailConfirmed: boolean;
|
||||
isDeleted: boolean;
|
||||
isDisabled: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
interface response {
|
||||
type response = {
|
||||
searchResults?: SearchResultsEntity[] | null;
|
||||
realTotalCount: number;
|
||||
code?: string;
|
||||
@@ -402,8 +402,8 @@ interface response {
|
||||
format: Format;
|
||||
duration: Duration;
|
||||
isWorkMarkEnabled: boolean;
|
||||
}
|
||||
interface SearchResultsEntity {
|
||||
};
|
||||
type SearchResultsEntity = {
|
||||
id: number;
|
||||
title: string;
|
||||
annotation: string;
|
||||
@@ -446,20 +446,20 @@ interface SearchResultsEntity {
|
||||
isLiked: boolean;
|
||||
isWorkMarkEnabled: boolean;
|
||||
workInLibraryState: string;
|
||||
}
|
||||
interface Format {
|
||||
};
|
||||
type Format = {
|
||||
enumValue: string;
|
||||
value: string;
|
||||
title: string;
|
||||
mobileTitle: string;
|
||||
}
|
||||
interface Duration {
|
||||
};
|
||||
type Duration = {
|
||||
value: string;
|
||||
title: string;
|
||||
mobileTitle: string;
|
||||
}
|
||||
};
|
||||
|
||||
interface responseBook {
|
||||
type responseBook = {
|
||||
message?: string;
|
||||
chapters?: ChaptersEntity[] | null;
|
||||
allowDownloads: boolean;
|
||||
@@ -543,8 +543,8 @@ interface responseBook {
|
||||
purchaseTime?: null;
|
||||
likeTime?: null;
|
||||
markTime?: null;
|
||||
}
|
||||
interface ChaptersEntity {
|
||||
};
|
||||
type ChaptersEntity = {
|
||||
id: number;
|
||||
workId: number;
|
||||
title: string;
|
||||
@@ -554,16 +554,16 @@ interface ChaptersEntity {
|
||||
lastModificationTime: string;
|
||||
textLength: number;
|
||||
isAvailable: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
interface GalleryImagesEntity {
|
||||
type GalleryImagesEntity = {
|
||||
id: string;
|
||||
caption?: null;
|
||||
url: string;
|
||||
height: number;
|
||||
width: number;
|
||||
}
|
||||
interface RecommendationsEntity {
|
||||
};
|
||||
type RecommendationsEntity = {
|
||||
title: string;
|
||||
coverUrl: string;
|
||||
authorId: number;
|
||||
@@ -590,9 +590,9 @@ interface RecommendationsEntity {
|
||||
removalReason?: null;
|
||||
removalReasonComment?: null;
|
||||
id: number;
|
||||
}
|
||||
};
|
||||
|
||||
interface encryptedСhapter {
|
||||
type encryptedСhapter = {
|
||||
id: number;
|
||||
title: string;
|
||||
isDraft: boolean;
|
||||
@@ -602,4 +602,4 @@ interface encryptedСhapter {
|
||||
key: string;
|
||||
code?: string;
|
||||
message?: string;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user