Change scanlator exclusion filter checked icon to "X"
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
import { bindTrigger, usePopupState } from 'material-ui-popup-state/hooks';
|
import { bindTrigger, usePopupState } from 'material-ui-popup-state/hooks';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import PeopleAltOutlinedIcon from '@mui/icons-material/PeopleAltOutlined';
|
import PeopleAltOutlinedIcon from '@mui/icons-material/PeopleAltOutlined';
|
||||||
|
import DisabledByDefaultRounded from '@mui/icons-material/DisabledByDefaultRounded';
|
||||||
import { CheckboxListSetting } from '@/modules/core/components/settings/CheckboxListSetting.tsx';
|
import { CheckboxListSetting } from '@/modules/core/components/settings/CheckboxListSetting.tsx';
|
||||||
import { updateChapterListOptions } from '@/modules/chapter/utils/ChapterList.util.tsx';
|
import { updateChapterListOptions } from '@/modules/chapter/utils/ChapterList.util.tsx';
|
||||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||||
@@ -51,6 +52,11 @@ export const ChapterExcludeSanlatorsFilter = ({
|
|||||||
getId={(scanlator) => scanlator}
|
getId={(scanlator) => scanlator}
|
||||||
getLabel={(scanlator) => scanlator}
|
getLabel={(scanlator) => scanlator}
|
||||||
isChecked={(scanlator) => excludedScanlators.includes(scanlator)}
|
isChecked={(scanlator) => excludedScanlators.includes(scanlator)}
|
||||||
|
slotProps={{
|
||||||
|
checkbox: {
|
||||||
|
checkedIcon: <DisabledByDefaultRounded />,
|
||||||
|
},
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import FormGroup from '@mui/material/FormGroup';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import Stack from '@mui/material/Stack';
|
import Stack from '@mui/material/Stack';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
|
import { CheckboxProps } from '@mui/material/Checkbox';
|
||||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||||
import { useSelectableCollection } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
import { useSelectableCollection } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@ export function CheckboxListSetting<Item>({
|
|||||||
isChecked,
|
isChecked,
|
||||||
open,
|
open,
|
||||||
onClose,
|
onClose,
|
||||||
|
slotProps,
|
||||||
}: {
|
}: {
|
||||||
title: string;
|
title: string;
|
||||||
emptyMessage?: string;
|
emptyMessage?: string;
|
||||||
@@ -36,6 +38,9 @@ export function CheckboxListSetting<Item>({
|
|||||||
isChecked: (item: Item) => boolean;
|
isChecked: (item: Item) => boolean;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onClose: (selectedItems?: Item[]) => void;
|
onClose: (selectedItems?: Item[]) => void;
|
||||||
|
slotProps?: {
|
||||||
|
checkbox?: Omit<CheckboxProps, 'checked' | 'onChange' | 'label'>;
|
||||||
|
};
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -80,6 +85,7 @@ export function CheckboxListSetting<Item>({
|
|||||||
{items.length === 0 && <span>{emptyMessage}</span>}
|
{items.length === 0 && <span>{emptyMessage}</span>}
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<CheckboxInput
|
<CheckboxInput
|
||||||
|
{...slotProps?.checkbox}
|
||||||
checked={selectedItemIds.includes(getId(item))}
|
checked={selectedItemIds.includes(getId(item))}
|
||||||
onChange={(e, checked) => handleSelection(getId(item), checked)}
|
onChange={(e, checked) => handleSelection(getId(item), checked)}
|
||||||
label={getLabel(item)}
|
label={getLabel(item)}
|
||||||
|
|||||||
Reference in New Issue
Block a user