Web: Common: added isDropZone prop to page-layout

This commit is contained in:
Nikita Gopienko 2020-06-04 15:46:01 +03:00
parent 2d4dda536c
commit c65ab449bd

View File

@ -27,7 +27,6 @@ const commonStyles = css`
`;
const StyledSectionBody = styled.div`
${props => props.displayBorder && `outline: 1px dotted;`}
${commonStyles}
${props => props.withScroll && `
@ -36,7 +35,6 @@ const StyledSectionBody = styled.div`
`;
const StyledDropZoneBody = styled(DragAndDrop)`
${props => props.displayBorder && `outline: 1px dotted;`}
${commonStyles}
.drag-and-drop {
@ -98,16 +96,18 @@ class SectionBody extends React.Component {
))
};
return (
uploadFiles ? (
<StyledDropZoneBody onDrop={onDrop} withScroll={withScroll}>
{renderBody()}
</StyledDropZoneBody>
) : (
<StyledSectionBody withScroll={withScroll}>
{renderBody()}
</StyledSectionBody>
)
return (uploadFiles ? (
<StyledDropZoneBody
isDropZone
onDrop={onDrop}
withScroll={withScroll}
>
{renderBody()}
</StyledDropZoneBody>
) : (
<StyledSectionBody withScroll={withScroll}>
{renderBody()}
</StyledSectionBody>
);
}
}