2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { DropzoneOptions } from 'react-dropzone';
|
|
|
|
import { useDropzone } from 'react-dropzone';
|
2020-09-28 18:40:26 +00:00
|
|
|
|
|
|
|
export const useStickerDropzone = (
|
|
|
|
onDrop: DropzoneOptions['onDrop']
|
|
|
|
): ReturnType<typeof useDropzone> =>
|
|
|
|
useDropzone({
|
|
|
|
onDrop,
|
|
|
|
accept: [
|
|
|
|
'image/png',
|
|
|
|
'image/webp',
|
|
|
|
// Some OSes recognize .apng files with the MIME type but others don't, so we supply
|
|
|
|
// the extension too.
|
|
|
|
'image/apng',
|
|
|
|
'.apng',
|
|
|
|
],
|
|
|
|
});
|