mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
added comment form drop zone
This commit is contained in:
parent
63b9781977
commit
62d4e03206
8 changed files with 142 additions and 93 deletions
14
src/components/comment/CommentFormDropzone/index.tsx
Normal file
14
src/components/comment/CommentFormDropzone/index.tsx
Normal file
|
@ -0,0 +1,14 @@
|
|||
import React, { FC } from 'react';
|
||||
import { COMMENT_FILE_TYPES } from '~/redux/uploads/constants';
|
||||
import { useDropZone } from '~/utils/hooks';
|
||||
|
||||
interface IProps {
|
||||
onUpload: (files: File[]) => void;
|
||||
}
|
||||
|
||||
const CommentFormDropzone: FC<IProps> = ({ children, onUpload }) => {
|
||||
const onDrop = useDropZone(onUpload, COMMENT_FILE_TYPES);
|
||||
return <div onDropCapture={onDrop}>{children}</div>;
|
||||
};
|
||||
|
||||
export { CommentFormDropzone };
|
Loading…
Add table
Add a link
Reference in a new issue