[Abhinav] | Added logic to show upload modal on hover
This commit is contained in:
parent
f64051008c
commit
1fe714fb2a
1 changed files with 16 additions and 1 deletions
|
@ -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>
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue