[ESLint] Prefer named exports (#427)
This commit is contained in:
@@ -27,10 +27,10 @@ import ArrowBack from '@mui/icons-material/ArrowBack';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { NavbarItem } from '@/typings';
|
||||
import NavBarContext from '@/components/context/NavbarContext';
|
||||
import ExtensionOutlinedIcon from '@/components/util/CustomExtensionOutlinedIcon';
|
||||
import DesktopSideBar from '@/components/navbar/navigation/DesktopSideBar';
|
||||
import MobileBottomBar from '@/components/navbar/navigation/MobileBottomBar';
|
||||
import { NavBarContext } from '@/components/context/NavbarContext';
|
||||
import { ExtensionOutlinedIcon } from '@/components/util/CustomExtensionOutlinedIcon';
|
||||
import { DesktopSideBar } from '@/components/navbar/navigation/DesktopSideBar';
|
||||
import { MobileBottomBar } from '@/components/navbar/navigation/MobileBottomBar';
|
||||
import { useHistory } from '@/util/useHistory';
|
||||
|
||||
const navbarItems: Array<NavbarItem> = [
|
||||
@@ -85,7 +85,7 @@ const navbarItems: Array<NavbarItem> = [
|
||||
},
|
||||
];
|
||||
|
||||
export default function DefaultNavBar() {
|
||||
export function DefaultNavBar() {
|
||||
const { title, action, override, defaultBackTo: backToUrl } = useContext(NavBarContext);
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { INavbarOverride } from '@/typings';
|
||||
import NavBarContext from '@/components/context/NavbarContext';
|
||||
import { NavBarContext } from '@/components/context/NavbarContext';
|
||||
|
||||
interface IProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function NavBarProvider({ children }: IProps) {
|
||||
export function NavBarContextProvider({ children }: IProps) {
|
||||
const [defaultBackTo, setDefaultBackTo] = useState<string | undefined>();
|
||||
const [title, setTitle] = useState<string | React.ReactNode>('Tachidesk');
|
||||
const [action, setAction] = useState<any>(<div />);
|
||||
|
||||
@@ -25,7 +25,7 @@ import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
|
||||
import Collapse from '@mui/material/Collapse';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ChapterOffset, IReaderSettings, TChapter, TManga } from '@/typings';
|
||||
import ReaderSettingsOptions from '@/components/reader/ReaderSettingsOptions';
|
||||
import { ReaderSettingsOptions } from '@/components/reader/ReaderSettingsOptions';
|
||||
|
||||
const Root = styled('div')(({ theme }) => ({
|
||||
top: 0,
|
||||
@@ -122,7 +122,7 @@ interface IProps {
|
||||
retrievingNextChapter: boolean;
|
||||
}
|
||||
|
||||
export default function ReaderNavBar(props: IProps) {
|
||||
export function ReaderNavBar(props: IProps) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation<{
|
||||
|
||||
@@ -16,7 +16,7 @@ import Checkbox from '@mui/material/Checkbox';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import FormGroup from '@mui/material/FormGroup';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import requestManager from '@/lib/requests/RequestManager.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
|
||||
interface IProps {
|
||||
open: boolean;
|
||||
@@ -24,7 +24,7 @@ interface IProps {
|
||||
mangaId: number;
|
||||
}
|
||||
|
||||
export default function CategorySelect(props: IProps) {
|
||||
export function CategorySelect(props: IProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { open, setOpen, mangaId } = props;
|
||||
|
||||
@@ -18,7 +18,7 @@ import FilterListIcon from '@mui/icons-material/FilterList';
|
||||
import { List, ListItemSecondaryAction, ListItemText } from '@mui/material';
|
||||
import ListItem from '@mui/material/ListItem';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import cloneObject from '@/util/cloneObject';
|
||||
import { cloneObject } from '@/util/cloneObject';
|
||||
import { translateExtensionLanguage } from '@/screens/util/Extensions';
|
||||
|
||||
function removeAll(firstList: any[], secondList: any[]) {
|
||||
@@ -39,7 +39,7 @@ interface IProps {
|
||||
forcedLangs?: string[];
|
||||
}
|
||||
|
||||
export default function LangSelect(props: IProps) {
|
||||
export function LangSelect(props: IProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { shownLangs, setShownLangs, allLangs, forcedLangs } = props;
|
||||
|
||||
@@ -28,7 +28,7 @@ interface IProps {
|
||||
navBarItems: Array<NavbarItem>;
|
||||
}
|
||||
|
||||
export default function DesktopSideBar({ navBarItems }: IProps) {
|
||||
export function DesktopSideBar({ navBarItems }: IProps) {
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -37,7 +37,7 @@ interface IProps {
|
||||
navBarItems: Array<NavbarItem>;
|
||||
}
|
||||
|
||||
export default function MobileBottomBar({ navBarItems }: IProps) {
|
||||
export function MobileBottomBar({ navBarItems }: IProps) {
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
const theme = useTheme();
|
||||
|
||||
Reference in New Issue
Block a user