add Dropzone component

This commit is contained in:
[poww10s]
2020-11-26 18:49:18 -05:00
parent 5865400d5b
commit ef198bd9c9
+21
View File
@@ -0,0 +1,21 @@
import React from 'react';
import { useDropzone } from 'react-dropzone';
export default function Dropzone(props) {
const { getRootProps, getInputProps, open, acceptedFiles } = useDropzone({
noClick: true,
noKeyboard: true,
});
return (
<div className="container">
<div {...getRootProps}>
<input {...getInputProps} />
<p>Drag and drop files here</p>
<button type="button" onClick={open}>
Open File
</button>
</div>
</div>
);
}