feat: clipboard paste (#1663)

This commit is contained in:
Yuhao 2023-12-01 10:04:14 +08:00 • committed by GitHub
commit faa88aafe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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}
/>