Feature/browse source manga long press remove add manga from library (#710)

* Extract CategorySelect usage into hook

* Extract logic to change manga in library state into hook

* Change manga in library state on long press when browsing source
This commit is contained in:
schroda
2024-04-07 15:33:08 +02:00
committed by GitHub
parent aab3e25031
commit 29860482a6
13 changed files with 380 additions and 113 deletions

View File

@@ -40,7 +40,7 @@ type MultiMangaModeProps = {
mangaIds: number[];
};
type Props =
export type CategorySelectProps =
| (BaseProps & SingleMangaModeProps & PropertiesNever<MultiMangaModeProps>)
| (BaseProps & PropertiesNever<SingleMangaModeProps> & MultiMangaModeProps);
@@ -77,7 +77,7 @@ const getCategoryCheckedState = (
return undefined;
};
export function CategorySelect(props: Props) {
export function CategorySelect(props: CategorySelectProps) {
const { t } = useTranslation();
const { open, onClose, mangaId, mangaIds: passedMangaIds, addToLibrary = false } = props;