diff --git a/src/base/components/inputs/SortRadioInput.tsx b/src/base/components/inputs/SortRadioInput.tsx index aab02e4e..b61ce61b 100644 --- a/src/base/components/inputs/SortRadioInput.tsx +++ b/src/base/components/inputs/SortRadioInput.tsx @@ -8,7 +8,6 @@ import ArrowDownward from '@mui/icons-material/ArrowDownward'; import ArrowUpward from '@mui/icons-material/ArrowUpward'; -import Replay from '@mui/icons-material/Replay'; import { memo } from 'react'; import type { RadioInputProps } from '@/base/components/inputs/RadioInput.tsx'; import { RadioInput } from '@/base/components/inputs/RadioInput.tsx'; @@ -23,7 +22,3 @@ export const SortRadioInput = memo(({ sortDescending, ...rest }: IProps) => ( {...rest} /> )); - -export const SortRadioInputRandom = memo(({ sortDescending, ...rest }: IProps) => ( - } {...rest} /> -)); diff --git a/src/features/library/components/LibraryOptionsPanel.tsx b/src/features/library/components/LibraryOptionsPanel.tsx index f071784b..c7c3766d 100644 --- a/src/features/library/components/LibraryOptionsPanel.tsx +++ b/src/features/library/components/LibraryOptionsPanel.tsx @@ -16,7 +16,7 @@ import { useMemo } from 'react'; import uniqBy from 'lodash/fp/uniqBy'; import { CheckboxInput } from '@/base/components/inputs/CheckboxInput.tsx'; import { RadioInput } from '@/base/components/inputs/RadioInput.tsx'; -import { SortRadioInput, SortRadioInputRandom } from '@/base/components/inputs/SortRadioInput.tsx'; +import { SortRadioInput } from '@/base/components/inputs/SortRadioInput.tsx'; import { ThreeStateCheckboxInput } from '@/base/components/inputs/ThreeStateCheckboxInput.tsx'; import { OptionsTabs } from '@/base/components/modals/OptionsTabs.tsx'; import { requestManager } from '@/lib/requests/RequestManager.ts'; @@ -38,6 +38,7 @@ import { MANGA_STATUS_TO_TRANSLATION } from '@/features/manga/Manga.constants.ts import { GridLayout } from '@/base/Base.types'; import { getErrorMessage } from '@/lib/HelperFunctions.ts'; import { Collapsable } from '@/base/components/Collapsable.tsx'; +import Replay from '@mui/icons-material/Replay'; const TITLES: { [key in 'filter' | 'sort' | 'display']: MessageDescriptor } = { filter: msg`Filter`, @@ -211,33 +212,20 @@ export const LibraryOptionsPanel = ({ ); } if (key === 'sort') { - return SORT_OPTIONS.map(([mode, label]) => - mode === 'random' ? ( - - mode !== categoryLibraryOptions.sortBy - ? updateCategoryLibraryOptions('sortBy', mode) - : updateCategoryLibraryOptions('sortDesc', !categoryLibraryOptions.sortDesc) - } - /> - ) : ( - - mode !== categoryLibraryOptions.sortBy - ? updateCategoryLibraryOptions('sortBy', mode) - : updateCategoryLibraryOptions('sortDesc', !categoryLibraryOptions.sortDesc) - } - /> - ), - ); + return SORT_OPTIONS.map(([mode, label]) => ( + : undefined} + sortDescending={categoryLibraryOptions.sortDesc} + onClick={() => + mode !== categoryLibraryOptions.sortBy + ? updateCategoryLibraryOptions('sortBy', mode) + : updateCategoryLibraryOptions('sortDesc', !categoryLibraryOptions.sortDesc) + } + /> + )); } if (key === 'display') { return (