mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-16 13:20:33 +00:00
parent
656279d74b
commit
cd495fc7a0
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @stylistic/indent */
|
||||||
import { BreadcrumbItem, Breadcrumbs } from '@heroui/breadcrumbs';
|
import { BreadcrumbItem, Breadcrumbs } from '@heroui/breadcrumbs';
|
||||||
import { Button } from '@heroui/button';
|
import { Button } from '@heroui/button';
|
||||||
import { Input } from '@heroui/input';
|
import { Input } from '@heroui/input';
|
||||||
@ -320,9 +321,9 @@ export default function FileManagerPage () {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
const { getRootProps, getInputProps, isDragActive, open } = useDropzone({
|
||||||
onDrop,
|
onDrop,
|
||||||
noClick: true,
|
noClick: true, // 禁用自动点击,使用 open() 手动触发
|
||||||
onDragOver: (e) => {
|
onDragOver: (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@ -340,7 +341,8 @@ export default function FileManagerPage () {
|
|||||||
hasBackground
|
hasBackground
|
||||||
? 'bg-white/20 dark:bg-black/10 border border-white/40 dark:border-white/10'
|
? 'bg-white/20 dark:bg-black/10 border border-white/40 dark:border-white/10'
|
||||||
: 'bg-white/60 dark:bg-black/40 border border-white/40 dark:border-white/10'
|
: 'bg-white/60 dark:bg-black/40 border border-white/40 dark:border-white/10'
|
||||||
)}>
|
)}
|
||||||
|
>
|
||||||
<div className='flex items-center gap-2 overflow-x-auto hide-scrollbar pb-1 md:pb-0'>
|
<div className='flex items-center gap-2 overflow-x-auto hide-scrollbar pb-1 md:pb-0'>
|
||||||
<Button
|
<Button
|
||||||
color='primary'
|
color='primary'
|
||||||
@ -470,7 +472,7 @@ export default function FileManagerPage () {
|
|||||||
animate={{ height: showUpload ? 'auto' : 0 }}
|
animate={{ height: showUpload ? 'auto' : 0 }}
|
||||||
transition={{ duration: 0.2 }}
|
transition={{ duration: 0.2 }}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'border-dashed rounded-lg text-center',
|
'border-dashed rounded-lg text-center overflow-hidden',
|
||||||
isDragActive ? 'border-primary bg-primary/10' : 'border-default-300',
|
isDragActive ? 'border-primary bg-primary/10' : 'border-default-300',
|
||||||
showUpload ? 'mb-4 border-2' : 'border-none'
|
showUpload ? 'mb-4 border-2' : 'border-none'
|
||||||
)}
|
)}
|
||||||
@ -479,9 +481,15 @@ export default function FileManagerPage () {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div {...getRootProps()} className='w-full h-full p-4'>
|
<div {...getRootProps()} className='w-full h-full p-4 cursor-pointer hover:bg-default-100 transition-colors'>
|
||||||
<input {...getInputProps()} multiple />
|
<input {...getInputProps()} multiple />
|
||||||
<p>拖拽文件或文件夹到此处上传,或点击选择文件</p>
|
<div className='flex flex-col items-center gap-2'>
|
||||||
|
<FiUpload className='text-3xl text-primary' />
|
||||||
|
<p className='text-default-600'>拖拽文件到此处上传</p>
|
||||||
|
<Button color='primary' size='sm' variant='flat' onPress={open}>
|
||||||
|
点击选择文件
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user