Add scanlator filter to chapter list

closes #937
This commit is contained in:
schroda
2025-06-09 15:32:04 +02:00
parent 645eaeb315
commit 7c0ffe9bd3
13 changed files with 234 additions and 10 deletions

View File

@@ -17,12 +17,15 @@ import { CHAPTER_SORT_OPTIONS_TO_TRANSLATION_KEY } from '@/modules/chapter/Chapt
import { TranslationKey } from '@/Base.types.ts';
import { ChapterListOptions } from '@/modules/chapter/Chapter.types.ts';
import { updateChapterListOptions } from '@/modules/chapter/utils/ChapterList.util.tsx';
import { ChapterExcludeSanlatorsFilter } from '@/modules/chapter/components/ChapterExcludeSanlatorsFilter.tsx';
interface IProps {
open: boolean;
onClose: () => void;
options: ChapterListOptions;
updateOption: ReturnType<typeof updateChapterListOptions>;
scanlators: string[];
excludedScanlators: string[];
}
const TITLES: { [key in 'filter' | 'sort' | 'display']: TranslationKey } = {
@@ -31,7 +34,14 @@ const TITLES: { [key in 'filter' | 'sort' | 'display']: TranslationKey } = {
display: 'global.label.display',
};
export const ChapterOptions: React.FC<IProps> = ({ open, onClose, options, updateOption }) => {
export const ChapterOptions: React.FC<IProps> = ({
open,
onClose,
options,
updateOption,
scanlators,
excludedScanlators,
}) => {
const { t } = useTranslation();
return (
@@ -60,6 +70,11 @@ export const ChapterOptions: React.FC<IProps> = ({ open, onClose, options, updat
checked={options.bookmarked}
onChange={(c) => updateOption('bookmarked', c)}
/>
<ChapterExcludeSanlatorsFilter
scanlators={scanlators}
excludedScanlators={excludedScanlators}
updateOption={updateOption}
/>
</>
);
}