[ESLint] Prefer named exports (#427)
This commit is contained in:
@@ -10,8 +10,8 @@ import { useEffect, useRef } from 'react';
|
||||
import { Box } from '@mui/material';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { IReaderProps } from '@/typings';
|
||||
import Page from '@/components/reader/Page';
|
||||
import DoublePage from '@/components/reader/DoublePage';
|
||||
import { Page } from '@/components/reader/Page';
|
||||
import { DoublePage } from '@/components/reader/DoublePage';
|
||||
|
||||
const isSpreadPage = (image: HTMLImageElement): boolean => {
|
||||
const aspectRatio = image.height / image.width;
|
||||
@@ -29,7 +29,7 @@ const isSinglePage = (index: number, spreadPages: boolean[], offsetFirstPage: bo
|
||||
return offsetFirstPage ? numberOfNonSpreads % 2 === 0 : numberOfNonSpreads % 2 === 1;
|
||||
};
|
||||
|
||||
export default function DoublePagedPager(props: IReaderProps) {
|
||||
export function DoublePagedPager(props: IReaderProps) {
|
||||
const { pages, settings, setCurPage, initialPage, curPage, nextChapter, prevChapter } = props;
|
||||
|
||||
const selfRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { Box } from '@mui/material';
|
||||
import { IReaderProps } from '@/typings';
|
||||
import Page from '@/components/reader/Page';
|
||||
import { Page } from '@/components/reader/Page';
|
||||
|
||||
const findCurrentPageIndex = (wrapper: HTMLDivElement): number => {
|
||||
for (let i = 0; i < wrapper.children.length; i++) {
|
||||
@@ -31,7 +31,7 @@ const isAtEnd = () => {
|
||||
};
|
||||
const isAtStart = () => window.scrollX <= 0;
|
||||
|
||||
export default function HorizontalPager(props: IReaderProps) {
|
||||
export function HorizontalPager(props: IReaderProps) {
|
||||
const { pages, curPage, initialPage, settings, setCurPage, prevChapter, nextChapter } = props;
|
||||
|
||||
const currentPageRef = useRef(initialPage);
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { Box } from '@mui/material';
|
||||
import { IReaderProps } from '@/typings';
|
||||
import Page from '@/components/reader/Page';
|
||||
import { Page } from '@/components/reader/Page';
|
||||
|
||||
export default function PagedReader(props: IReaderProps) {
|
||||
export function PagedPager(props: IReaderProps) {
|
||||
const { pages, settings, setCurPage, initialPage, curPage, nextChapter, prevChapter } = props;
|
||||
|
||||
const selfRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
import { Box } from '@mui/material';
|
||||
import { IReaderProps } from '@/typings';
|
||||
import Page from '@/components/reader/Page';
|
||||
import { Page } from '@/components/reader/Page';
|
||||
|
||||
const findCurrentPageIndex = (wrapper: HTMLDivElement): number => {
|
||||
for (let i = 0; i < wrapper.children.length; i++) {
|
||||
@@ -35,7 +35,7 @@ const isAtBottom = () => {
|
||||
};
|
||||
const isAtTop = () => window.scrollY <= 0;
|
||||
|
||||
export default function VerticalPager(props: IReaderProps) {
|
||||
export function VerticalPager(props: IReaderProps) {
|
||||
const { pages, settings, setCurPage, initialPage, nextChapter, prevChapter } = props;
|
||||
|
||||
const currentPageRef = useRef(initialPage);
|
||||
|
||||
Reference in New Issue
Block a user