[ESLint] Prefer named exports (#427)
This commit is contained in:
@@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { GridLayout, useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
|
||||
|
||||
// TODO: clean up this to use a FormControl, and remove dependency on name o radio button
|
||||
export default function SourceGridLayout() {
|
||||
export function SourceGridLayout() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const {
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
*/
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import MangaGrid, { IMangaGridProps } from '@/components/MangaGrid';
|
||||
import { MangaGrid, IMangaGridProps } from '@/components/MangaGrid';
|
||||
import { TPartialManga } from '@/typings.ts';
|
||||
|
||||
function filterManga(mangas: TPartialManga[]): TPartialManga[] {
|
||||
return mangas;
|
||||
}
|
||||
|
||||
export default function SourceMangaGrid(props: IMangaGridProps) {
|
||||
export function SourceMangaGrid(props: IMangaGridProps) {
|
||||
const { t } = useTranslation();
|
||||
const { mangas, isLoading, hasNextPage, loadMore, message, messageExtra, gridLayout } = props;
|
||||
|
||||
|
||||
@@ -11,18 +11,18 @@ import { Button, Stack, Box } from '@mui/material';
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SourceFilters } from '@/typings';
|
||||
import OptionsPanel from '@/components/molecules/OptionsPanel';
|
||||
import CheckBoxFilter from '@/components/source/filters/CheckBoxFilter';
|
||||
import HeaderFilter from '@/components/source/filters/HeaderFilter';
|
||||
import SelectFilter from '@/components/source/filters/SelectFilter';
|
||||
import SortFilter from '@/components/source/filters/SortFilter';
|
||||
import TextFilter from '@/components/source/filters/TextFilter';
|
||||
import TriStateFilter from '@/components/source/filters/TriStateFilter';
|
||||
import { OptionsPanel } from '@/components/molecules/OptionsPanel';
|
||||
import { CheckBoxFilter } from '@/components/source/filters/CheckBoxFilter';
|
||||
import { HeaderFilter } from '@/components/source/filters/HeaderFilter';
|
||||
import { SelectFilter } from '@/components/source/filters/SelectFilter';
|
||||
import { SortFilter } from '@/components/source/filters/SortFilter';
|
||||
import { TextFilter } from '@/components/source/filters/TextFilter';
|
||||
import { TriStateFilter } from '@/components/source/filters/TriStateFilter';
|
||||
// this can only cycle once, so should be fine
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import GroupFilter from '@/components/source/filters/GroupFilter';
|
||||
import SeperatorFilter from '@/components/source/filters/SeparatorFilter';
|
||||
import StyledFab from '@/components/util/StyledFab';
|
||||
import { GroupFilter } from '@/components/source/filters/GroupFilter';
|
||||
import { SeparatorFilter } from '@/components/source/filters/SeparatorFilter';
|
||||
import { StyledFab } from '@/components/util/StyledFab';
|
||||
|
||||
interface IFilters {
|
||||
sourceFilter: SourceFilters[];
|
||||
@@ -88,7 +88,7 @@ export function Options({ sourceFilter, group, updateFilterValue, update }: IFil
|
||||
/>
|
||||
);
|
||||
case 'SeparatorFilter':
|
||||
return <SeperatorFilter key={`filters ${e.name}`} name={e.name} />;
|
||||
return <SeparatorFilter key={`filters ${e.name}`} name={e.name} />;
|
||||
case 'SortFilter':
|
||||
return (
|
||||
<SortFilter
|
||||
@@ -139,7 +139,7 @@ export function Options({ sourceFilter, group, updateFilterValue, update }: IFil
|
||||
);
|
||||
}
|
||||
|
||||
export default function SourceOptions({
|
||||
export function SourceOptions({
|
||||
sourceFilter,
|
||||
updateFilterValue,
|
||||
resetFilterValue,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import CheckboxInput from '@/components/atoms/CheckboxInput';
|
||||
import { CheckboxInput } from '@/components/atoms/CheckboxInput';
|
||||
|
||||
interface Props {
|
||||
state: boolean;
|
||||
@@ -18,7 +18,7 @@ interface Props {
|
||||
update: any;
|
||||
}
|
||||
|
||||
const CheckBoxFilter: React.FC<Props> = (props: Props) => {
|
||||
export const CheckBoxFilter: React.FC<Props> = (props: Props) => {
|
||||
const { state, name, position, group, updateFilterValue, update } = props;
|
||||
const [val, setval] = React.useState(state);
|
||||
|
||||
@@ -35,5 +35,3 @@ const CheckBoxFilter: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export default CheckBoxFilter;
|
||||
|
||||
@@ -21,7 +21,7 @@ interface Props {
|
||||
update: any;
|
||||
}
|
||||
|
||||
const GroupFilter: React.FC<Props> = (props: Props) => {
|
||||
export const GroupFilter: React.FC<Props> = (props: Props) => {
|
||||
const { state, name, position, updateFilterValue, update } = props;
|
||||
|
||||
const [open, setOpen] = React.useState(false);
|
||||
@@ -46,5 +46,3 @@ const GroupFilter: React.FC<Props> = (props: Props) => {
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default GroupFilter;
|
||||
|
||||
@@ -13,10 +13,8 @@ interface Props {
|
||||
name: string;
|
||||
}
|
||||
|
||||
const HeaderFilter: React.FC<Props> = ({ name }) => (
|
||||
export const HeaderFilter: React.FC<Props> = ({ name }) => (
|
||||
<Typography key={name} sx={{ mt: 2 }} variant="subtitle2">
|
||||
{name}
|
||||
</Typography>
|
||||
);
|
||||
|
||||
export default HeaderFilter;
|
||||
|
||||
@@ -60,7 +60,5 @@ function noSelect(
|
||||
return null;
|
||||
}
|
||||
|
||||
const SelectFilter: React.FC<Props> = ({ values, name, state, position, updateFilterValue, update, group }) =>
|
||||
export const SelectFilter: React.FC<Props> = ({ values, name, state, position, updateFilterValue, update, group }) =>
|
||||
noSelect(values, name, state, position, updateFilterValue, update, group);
|
||||
|
||||
export default SelectFilter;
|
||||
|
||||
@@ -13,10 +13,8 @@ interface Props {
|
||||
name: string;
|
||||
}
|
||||
|
||||
const SeparatorFilter: React.FC<Props> = ({ name }) => (
|
||||
export const SeparatorFilter: React.FC<Props> = ({ name }) => (
|
||||
<Divider key={name} sx={{ my: 1 }} textAlign="center">
|
||||
{name}
|
||||
</Divider>
|
||||
);
|
||||
|
||||
export default SeparatorFilter;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { ExpandLess, ExpandMore } from '@mui/icons-material';
|
||||
import { Collapse, ListItemButton, ListItemText, Stack, Box } from '@mui/material';
|
||||
import React from 'react';
|
||||
import SortRadioInput from '@/components/atoms/SortRadioInput';
|
||||
import { SortRadioInput } from '@/components/atoms/SortRadioInput';
|
||||
import { SortSelectionInput } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
interface Props {
|
||||
@@ -22,7 +22,7 @@ interface Props {
|
||||
update: any;
|
||||
}
|
||||
|
||||
const SortFilter: React.FC<Props> = (props: Props) => {
|
||||
export const SortFilter: React.FC<Props> = (props: Props) => {
|
||||
const { values, name, state, position, group, updateFilterValue, update } = props;
|
||||
const [val, setval] = React.useState(state);
|
||||
|
||||
@@ -72,5 +72,3 @@ const SortFilter: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export default SortFilter;
|
||||
|
||||
@@ -20,7 +20,7 @@ interface Props {
|
||||
update: any;
|
||||
}
|
||||
|
||||
const TextFilter: React.FC<Props> = (props) => {
|
||||
export const TextFilter: React.FC<Props> = (props) => {
|
||||
const { state, name, position, group, updateFilterValue, update } = props;
|
||||
const [Search, setsearch] = React.useState(state || '');
|
||||
const inputText = useDebounce(Search, 500);
|
||||
@@ -51,5 +51,3 @@ const TextFilter: React.FC<Props> = (props) => {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export default TextFilter;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import ThreeStateCheckboxInput from '@/components/atoms/ThreeStateCheckboxInput';
|
||||
import { ThreeStateCheckboxInput } from '@/components/atoms/ThreeStateCheckboxInput';
|
||||
import { TriState } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
interface Props {
|
||||
@@ -45,7 +45,7 @@ const convertNumberToTriState = (state: number): TriState => {
|
||||
}
|
||||
};
|
||||
|
||||
const TriStateFilter: React.FC<Props> = (props) => {
|
||||
export const TriStateFilter: React.FC<Props> = (props) => {
|
||||
const { state, name, position, group, updateFilterValue, update } = props;
|
||||
const [val, setval] = React.useState(convertTriStateToNumber(state));
|
||||
|
||||
@@ -78,5 +78,3 @@ const TriStateFilter: React.FC<Props> = (props) => {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export default TriStateFilter;
|
||||
|
||||
Reference in New Issue
Block a user