|
@@ -54,14 +54,14 @@ export const ImportModal: React.FC<ModalProps> = ({ visible, setVisible }) => {
|
|
|
const handleFileDrag = (e: React.DragEvent<HTMLLabelElement>) => {
|
|
|
e.preventDefault();
|
|
|
|
|
|
- if (e.type === 'drop' && e.dataTransfer.files.length) {
|
|
|
- if (e.dataTransfer.files[0].type === 'application/json') {
|
|
|
- setJsonFile(e.dataTransfer.files[0])
|
|
|
+ if (e.type === "drop" && e.dataTransfer.files.length) {
|
|
|
+ if (e.dataTransfer.files[0].type === "application/json") {
|
|
|
+ setJsonFile(e.dataTransfer.files[0]);
|
|
|
} else {
|
|
|
- toast.error('Please upload JSON file!')
|
|
|
+ toast.error("Please upload JSON file!");
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
const handleImportFile = () => {
|
|
|
if (url) {
|
|
@@ -100,10 +100,7 @@ export const ImportModal: React.FC<ModalProps> = ({ visible, setVisible }) => {
|
|
|
placeholder="URL of JSON to fetch"
|
|
|
autoFocus
|
|
|
/>
|
|
|
- <StyledUploadWrapper
|
|
|
- onDrop={handleFileDrag}
|
|
|
- onDragOver={handleFileDrag}
|
|
|
- >
|
|
|
+ <StyledUploadWrapper onDrop={handleFileDrag} onDragOver={handleFileDrag}>
|
|
|
<input
|
|
|
key={jsonFile?.name}
|
|
|
onChange={handleFileChange}
|