[ESLint] Prefer named exports (#427)
This commit is contained in:
@@ -12,7 +12,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { LibrarySortMode, NullAndUndefined, TManga } from '@/typings';
|
||||
import { useSearchSettings } from '@/util/searchSettings';
|
||||
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
|
||||
import MangaGrid from '@/components/MangaGrid';
|
||||
import { MangaGrid } from '@/components/MangaGrid';
|
||||
|
||||
const unreadFilter = (unread: NullAndUndefined<boolean>, { unreadCount }: TManga): boolean => {
|
||||
switch (unread) {
|
||||
@@ -109,7 +109,7 @@ interface LibraryMangaGridProps {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
const LibraryMangaGrid: React.FC<LibraryMangaGridProps> = ({ mangas, isLoading, message }) => {
|
||||
export const LibraryMangaGrid: React.FC<LibraryMangaGridProps> = ({ mangas, isLoading, message }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [query] = useQueryParam('query', StringParam);
|
||||
@@ -144,5 +144,3 @@ const LibraryMangaGrid: React.FC<LibraryMangaGridProps> = ({ mangas, isLoading,
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default LibraryMangaGrid;
|
||||
|
||||
@@ -10,12 +10,12 @@ import { FormLabel, RadioGroup } from '@mui/material';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { LibraryOptions, LibrarySortMode, TranslationKey } from '@/typings';
|
||||
import CheckboxInput from '@/components/atoms/CheckboxInput';
|
||||
import RadioInput from '@/components/atoms/RadioInput';
|
||||
import SortRadioInput from '@/components/atoms/SortRadioInput';
|
||||
import ThreeStateCheckboxInput from '@/components/atoms/ThreeStateCheckboxInput';
|
||||
import { CheckboxInput } from '@/components/atoms/CheckboxInput';
|
||||
import { RadioInput } from '@/components/atoms/RadioInput';
|
||||
import { SortRadioInput } from '@/components/atoms/SortRadioInput';
|
||||
import { ThreeStateCheckboxInput } from '@/components/atoms/ThreeStateCheckboxInput';
|
||||
import { GridLayout, useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
|
||||
import OptionsTabs from '@/components/molecules/OptionsTabs';
|
||||
import { OptionsTabs } from '@/components/molecules/OptionsTabs';
|
||||
|
||||
const TITLES: { [key in 'filter' | 'sort' | 'display']: TranslationKey } = {
|
||||
filter: 'global.label.filter',
|
||||
@@ -35,7 +35,7 @@ interface IProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const LibraryOptionsPanel: React.FC<IProps> = ({ open, onClose }) => {
|
||||
export const LibraryOptionsPanel: React.FC<IProps> = ({ open, onClose }) => {
|
||||
const { t } = useTranslation();
|
||||
const { options, setOptions } = useLibraryOptionsContext();
|
||||
|
||||
@@ -133,5 +133,3 @@ const LibraryOptionsPanel: React.FC<IProps> = ({ open, onClose }) => {
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default LibraryOptionsPanel;
|
||||
|
||||
@@ -8,19 +8,17 @@
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import { LibraryOptions } from '@/typings';
|
||||
import useLocalStorage from '@/util/useLocalStorage';
|
||||
import LibraryOptionsContext, { DefaultLibraryOptions } from '@/components/context/LibraryOptionsContext';
|
||||
import { useLocalStorage } from '@/util/useLocalStorage';
|
||||
import { LibraryOptionsContext, DefaultLibraryOptions } from '@/components/context/LibraryOptionsContext';
|
||||
|
||||
interface IProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const LibraryOptionsContextProvider: React.FC<IProps> = ({ children }) => {
|
||||
export const LibraryOptionsContextProvider: React.FC<IProps> = ({ children }) => {
|
||||
const [options, setOptions] = useLocalStorage<LibraryOptions>('libraryOptions', DefaultLibraryOptions);
|
||||
|
||||
const value = useMemo(() => ({ options, setOptions }), [options, setOptions]);
|
||||
|
||||
return <LibraryOptionsContext.Provider value={value}>{children}</LibraryOptionsContext.Provider>;
|
||||
};
|
||||
|
||||
export default LibraryOptionsContextProvider;
|
||||
|
||||
@@ -10,9 +10,9 @@ import FilterList from '@mui/icons-material/FilterList';
|
||||
import { IconButton } from '@mui/material';
|
||||
import React, { useState } from 'react';
|
||||
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
|
||||
import LibraryOptionsPanel from '@/components/library/LibraryOptionsPanel';
|
||||
import { LibraryOptionsPanel } from '@/components/library/LibraryOptionsPanel';
|
||||
|
||||
const LibraryToolbarMenu: React.FC = () => {
|
||||
export const LibraryToolbarMenu: React.FC = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
const { options } = useLibraryOptionsContext();
|
||||
const active = options.downloaded != null || options.unread != null;
|
||||
@@ -26,5 +26,3 @@ const LibraryToolbarMenu: React.FC = () => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default LibraryToolbarMenu;
|
||||
|
||||
@@ -13,8 +13,8 @@ import CircularProgress from '@mui/material/CircularProgress';
|
||||
import { Box } from '@mui/material';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import requestManager from '@/lib/requests/RequestManager.ts';
|
||||
import makeToast from '@/components/util/Toast';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/components/util/Toast';
|
||||
import { UpdaterSubscription } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
interface IProgressProps {
|
||||
@@ -45,7 +45,7 @@ const calcProgress = (status: UpdaterSubscription['updateStatusChanged'] | undef
|
||||
return Number.isNaN(progress) ? 0 : progress;
|
||||
};
|
||||
|
||||
function UpdateChecker({ handleFinishedUpdate }: { handleFinishedUpdate: () => void }) {
|
||||
export function UpdateChecker({ handleFinishedUpdate }: { handleFinishedUpdate: () => void }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data: updaterData } = requestManager.useUpdaterSubscription();
|
||||
@@ -81,5 +81,3 @@ function UpdateChecker({ handleFinishedUpdate }: { handleFinishedUpdate: () => v
|
||||
</IconButton>
|
||||
);
|
||||
}
|
||||
|
||||
export default UpdateChecker;
|
||||
|
||||
Reference in New Issue
Block a user