diff --git a/src/components/ComicView.tsx b/src/components/ComicView.tsx index 75a4dd5..19af7aa 100644 --- a/src/components/ComicView.tsx +++ b/src/components/ComicView.tsx @@ -4,7 +4,6 @@ import { FC, useLayoutEffect } from 'react'; import { useMeasure } from 'react-use'; import { useZoomState } from '../states/zoom'; import { ContinuationView } from './ContinuationView'; -import { DoubleView } from './DoubleView'; import { SingleView } from './SingleView'; export const ComicView: FC = () => { @@ -19,7 +18,6 @@ export const ComicView: FC = () => { return ( {equals(viewMode, 'single') && } - {equals(viewMode, 'double') && } {equals(viewMode, 'continuation') && } ); diff --git a/src/components/DoubleView.tsx b/src/components/DoubleView.tsx deleted file mode 100644 index 2f238c7..0000000 --- a/src/components/DoubleView.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { FC } from 'react'; - -export const DoubleView: FC = () => { - return
; -}; diff --git a/src/components/PicToolbar.tsx b/src/components/PicToolbar.tsx index b79d6d7..46ecbff 100644 --- a/src/components/PicToolbar.tsx +++ b/src/components/PicToolbar.tsx @@ -9,7 +9,6 @@ import { } from '@mantine/core'; import { IconArrowAutofitWidth, - IconLock, IconPercentage, IconZoomIn, IconZoomOut @@ -18,22 +17,17 @@ import { FC, useRef } from 'react'; import { useZoomState } from '../states/zoom'; export const PicToolbar: FC = () => { - const { lock, autoFit, currentZoom, viewMode, zoom, switchViewMode } = useZoomState(); + const { autoFit, currentZoom, viewMode, zoom, switchViewMode } = useZoomState(); const zoomHandlers = useRef(); return ( - - - - - - + { - zoom(value)} - handlersRef={zoomHandlers} - styles={{ input: { width: rem(58), textAlign: 'center' } }} - rightSection={} - /> - + + zoom(value)} + handlersRef={zoomHandlers} + styles={{ input: { width: rem(58), textAlign: 'center' } }} + rightSection={} + /> + + { color="grape" data={[ { label: '单页', value: 'single' }, - { label: '双页', value: 'double' }, { label: '连续', value: 'continuation' } ]} /> diff --git a/src/states/zoom.ts b/src/states/zoom.ts index 73d28d6..ab4d97f 100644 --- a/src/states/zoom.ts +++ b/src/states/zoom.ts @@ -2,21 +2,19 @@ import { SyncObjectCallback } from '../types'; import { createStoreHook } from '../utils/store_creator'; interface ZoomState { - lock: boolean; autoFit: boolean; currentZoom: number; - viewMode: 'single' | 'double' | 'continuation'; + viewMode: 'single' | 'continuation'; viewHeight: number; } type ZoomActions = { zoom: SyncObjectCallback; updateViewHeight: SyncObjectCallback; - switchViewMode: SyncObjectCallback<'single' | 'double' | 'continuation'>; + switchViewMode: SyncObjectCallback<'single' | 'continuation'>; }; const initialState: ZoomState = { - lock: true, autoFit: false, currentZoom: 80, viewMode: 'continuation',