feat: clipboard paste (#1663)

This commit is contained in:
Yuhao
2023-12-01 10:04:14 +08:00
committed by GitHub
parent 1b3a98425f
commit faa88aafe8
4 changed files with 89 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ import { useParams } from 'next/navigation'
import { useTranslation } from 'react-i18next'
import { imageUpload } from './utils'
import type { ImageFile } from '@/types/app'
import { TransferMethod } from '@/types/app'
import { ALLOW_FILE_EXTENSIONS, TransferMethod } from '@/types/app'
import { useToastContext } from '@/app/components/base/toast'
type UploaderProps = {
@@ -90,7 +90,7 @@ const Uploader: FC<UploaderProps> = ({
`}
onClick={e => (e.target as HTMLInputElement).value = ''}
type='file'
accept='.png, .jpg, .jpeg, .webp, .gif'
accept={ALLOW_FILE_EXTENSIONS.map(ext => `.${ext}`).join(',')}
onChange={handleChange}
disabled={disabled}
/>