[Abhinav] | Added logic to show upload modal on hover

This commit is contained in:
Abhinav-grd 2021-01-05 10:55:58 +05:30
parent f64051008c
commit 1fe714fb2a

View file

@ -1,6 +1,8 @@
import { close } from 'inspector';
import React from 'react';
import Dropzone from 'react-dropzone';
import styled from 'styled-components';
import CollectionSelector from './CollectionSelector';
const getColor = (props) => {
if (props.isDragAccept) {
@ -29,7 +31,13 @@ const DropDiv = styled.div`
transition: border 0.24s ease-in-out;
`;
const FileUpload = ({ children, noClick }) => {
const FileUpload = ({
children,
noClick,
modalView,
closeModal,
showModal,
}) => {
return (
<>
<Dropzone
@ -37,6 +45,8 @@ const FileUpload = ({ children, noClick }) => {
console.log(acceptedFiles);
}}
noClick={noClick}
onDragOver={showModal}
onDragLeave={closeModal}
>
{({
getRootProps,
@ -56,6 +66,11 @@ const FileUpload = ({ children, noClick }) => {
>
<input {...getInputProps()} />
{children}
<CollectionSelector
modalView={modalView}
closeModal={closeModal}
showModal={showModal}
/>
</DropDiv>
</>
);