[ESLint] Prefer named exports (#427)
This commit is contained in:
@@ -26,7 +26,7 @@ interface IProps {
|
||||
settings: IReaderSettings;
|
||||
}
|
||||
|
||||
const DoublePage = forwardRef((props: IProps, ref: any) => {
|
||||
export const DoublePage = forwardRef((props: IProps, ref: any) => {
|
||||
const { image1src, image2src, index, settings } = props;
|
||||
|
||||
return (
|
||||
@@ -47,5 +47,3 @@ const DoublePage = forwardRef((props: IProps, ref: any) => {
|
||||
</Box>
|
||||
);
|
||||
});
|
||||
|
||||
export default DoublePage;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { useState, useEffect, forwardRef, useRef } from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import { IReaderSettings } from '@/typings';
|
||||
import SpinnerImage from '@/components/util/SpinnerImage';
|
||||
import { SpinnerImage } from '@/components/util/SpinnerImage';
|
||||
|
||||
function imageStyle(settings: IReaderSettings): any {
|
||||
const [dimensions, setDimensions] = useState({
|
||||
@@ -65,7 +65,7 @@ interface IProps {
|
||||
settings: IReaderSettings;
|
||||
}
|
||||
|
||||
const Page = forwardRef((props: IProps, ref: any) => {
|
||||
export const Page = forwardRef((props: IProps, ref: any) => {
|
||||
const { src, index, onImageLoad, settings } = props;
|
||||
|
||||
const imgRef = useRef<HTMLImageElement>(null);
|
||||
@@ -92,5 +92,3 @@ const Page = forwardRef((props: IProps, ref: any) => {
|
||||
</Box>
|
||||
);
|
||||
});
|
||||
|
||||
export default Page;
|
||||
|
||||
@@ -15,7 +15,7 @@ interface IProps {
|
||||
pageCount: number;
|
||||
}
|
||||
|
||||
export default function PageNumber(props: IProps) {
|
||||
export function PageNumber(props: IProps) {
|
||||
const { settings, curPage, pageCount } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -17,7 +17,7 @@ interface IProps extends IReaderSettings {
|
||||
setSettingValue: (key: keyof IReaderSettings, value: string | boolean) => void;
|
||||
}
|
||||
|
||||
export default function ReaderSettingsOptions({
|
||||
export function ReaderSettingsOptions({
|
||||
staticNav,
|
||||
loadNextOnEnding,
|
||||
readerType,
|
||||
|
||||
@@ -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