From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/base/file-uploader/pdf-preview.tsx | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/components/base/file-uploader/pdf-preview.tsx b/app/components/base/file-uploader/pdf-preview.tsx index f8a02e8..04947be 100644 --- a/app/components/base/file-uploader/pdf-preview.tsx +++ b/app/components/base/file-uploader/pdf-preview.tsx @@ -9,7 +9,6 @@ import Loading from '@/app/components/base/loading' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import Tooltip from '@/app/components/base/tooltip' -import { noop } from 'lodash-es' type PdfPreviewProps = { url: string @@ -48,26 +47,26 @@ return createPortal( <div - className={`fixed inset-0 z-[1000] flex items-center justify-center bg-black/80 ${!isMobile && 'p-8'}`} + className={`fixed inset-0 flex items-center justify-center bg-black/80 z-[1000] ${!isMobile && 'p-8'}`} onClick={e => e.stopPropagation()} tabIndex={-1} > <div - className='h-[95vh] max-h-full w-[100vw] max-w-full overflow-hidden' + className='h-[95vh] w-[100vw] max-w-full max-h-full overflow-hidden' style={{ transform: `scale(${scale})`, transformOrigin: 'center', scrollbarWidth: 'none', msOverflowStyle: 'none' }} > <PdfLoader workerSrc='/pdf.worker.min.mjs' url={url} - beforeLoad={<div className='flex h-64 items-center justify-center'><Loading type='app' /></div>} + beforeLoad={<div className='flex justify-center items-center h-64'><Loading type='app' /></div>} > {(pdfDocument) => { return ( <PdfHighlighter pdfDocument={pdfDocument} enableAreaSelection={event => event.altKey} - scrollRef={noop} - onScrollChange={noop} + scrollRef={() => { }} + onScrollChange={() => { }} onSelectionFinished={() => null} highlightTransform={() => { return <div/> }} highlights={[]} @@ -77,22 +76,22 @@ </PdfLoader> </div> <Tooltip popupContent={t('common.operation.zoomOut')}> - <div className='absolute right-24 top-6 flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg' + <div className='absolute top-6 right-24 flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer' onClick={zoomOut}> - <RiZoomOutLine className='h-4 w-4 text-gray-500'/> + <RiZoomOutLine className='w-4 h-4 text-gray-500'/> </div> </Tooltip> <Tooltip popupContent={t('common.operation.zoomIn')}> - <div className='absolute right-16 top-6 flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg' + <div className='absolute top-6 right-16 flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer' onClick={zoomIn}> - <RiZoomInLine className='h-4 w-4 text-gray-500'/> + <RiZoomInLine className='w-4 h-4 text-gray-500'/> </div> </Tooltip> <Tooltip popupContent={t('common.operation.cancel')}> <div - className='absolute right-6 top-6 flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg bg-white/8 backdrop-blur-[2px]' + className='absolute top-6 right-6 flex items-center justify-center w-8 h-8 bg-white/8 rounded-lg backdrop-blur-[2px] cursor-pointer' onClick={onCancel}> - <RiCloseLine className='h-4 w-4 text-gray-500'/> + <RiCloseLine className='w-4 h-4 text-gray-500'/> </div> </Tooltip> </div>, -- Gitblit v1.8.0