Fix crashing on droping text (#302)
* Add basic drop overlay * Prevent crash when dragging text * Only show popup when files are being dragged * Make drop box bigger * Make drag drop overlay without a modal * Don't show drag drop menu on top of modals * Use different way to check for modal
This commit is contained in:
24
src/app/organisms/drag-drop/DragDrop.jsx
Normal file
24
src/app/organisms/drag-drop/DragDrop.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import './DragDrop.scss';
|
||||
|
||||
import RawModal from '../../atoms/modal/RawModal';
|
||||
import Text from '../../atoms/text/Text';
|
||||
|
||||
function DragDrop({ isOpen }) {
|
||||
return (
|
||||
<RawModal
|
||||
className="drag-drop__model"
|
||||
overlayClassName="drag-drop__overlay"
|
||||
isOpen={isOpen}
|
||||
>
|
||||
<Text variant="h2" weight="medium">Drop file to upload</Text>
|
||||
</RawModal>
|
||||
);
|
||||
}
|
||||
|
||||
DragDrop.propTypes = {
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default DragDrop;
|
||||
12
src/app/organisms/drag-drop/DragDrop.scss
Normal file
12
src/app/organisms/drag-drop/DragDrop.scss
Normal file
@@ -0,0 +1,12 @@
|
||||
.drag-drop__model {
|
||||
box-shadow: none;
|
||||
text-align: center;
|
||||
|
||||
.text {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.drag-drop__overlay {
|
||||
background-color: var(--bg-overlay-low);
|
||||
}
|
||||
Reference in New Issue
Block a user