Add button to mark all chapters as read
This commit is contained in:
@@ -14,6 +14,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import Checkbox from '@mui/material/Checkbox';
|
import Checkbox from '@mui/material/Checkbox';
|
||||||
import IconButton from '@mui/material/IconButton';
|
import IconButton from '@mui/material/IconButton';
|
||||||
import DownloadIcon from '@mui/icons-material/Download';
|
import DownloadIcon from '@mui/icons-material/Download';
|
||||||
|
import DoneAllIcon from '@mui/icons-material/DoneAll';
|
||||||
import { TChapter, TManga, TranslationKey } from '@/typings';
|
import { TChapter, TManga, TranslationKey } from '@/typings';
|
||||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||||
import { ChapterCard } from '@/components/manga/ChapterCard';
|
import { ChapterCard } from '@/components/manga/ChapterCard';
|
||||||
@@ -113,6 +114,7 @@ export const ChapterList: React.FC<IProps> = ({ manga, isRefreshing }) => {
|
|||||||
const areAllChaptersSelected = selection?.length === chapters.length;
|
const areAllChaptersSelected = selection?.length === chapters.length;
|
||||||
const areNoneChaptersSelected = !selection;
|
const areNoneChaptersSelected = !selection;
|
||||||
|
|
||||||
|
const areAllChaptersRead = manga.unreadCount === 0;
|
||||||
const areAllChaptersDownloaded = manga.downloadCount === manga.chapters.totalCount;
|
const areAllChaptersDownloaded = manga.downloadCount === manga.chapters.totalCount;
|
||||||
|
|
||||||
const handleSelection = (index: number) => {
|
const handleSelection = (index: number) => {
|
||||||
@@ -268,6 +270,14 @@ export const ChapterList: React.FC<IProps> = ({ manga, isRefreshing }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Stack direction="row" sx={{ paddingRight: '24px' }}>
|
<Stack direction="row" sx={{ paddingRight: '24px' }}>
|
||||||
|
<Tooltip title={t('chapter.action.mark_as_read.add.label.action.current')}>
|
||||||
|
<IconButton
|
||||||
|
disabled={areAllChaptersRead}
|
||||||
|
onClick={() => handleFabAction('mark_as_read', chaptersWithMeta)}
|
||||||
|
>
|
||||||
|
<DoneAllIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
<Tooltip title={t('chapter.action.download.add.label.action')}>
|
<Tooltip title={t('chapter.action.download.add.label.action')}>
|
||||||
<IconButton
|
<IconButton
|
||||||
disabled={areAllChaptersDownloaded}
|
disabled={areAllChaptersDownloaded}
|
||||||
|
|||||||
Reference in New Issue
Block a user