Skip to content
Snippets Groups Projects
Commit 8843640e authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[REF]: Refactor dropzone children to catch empty array of ext files and display layer

parent 7b129400
No related branches found
No related tags found
No related merge requests found
...@@ -16,11 +16,14 @@ const DropzoneChildren: React.FC<DropzoneChildrenProps> = ( ...@@ -16,11 +16,14 @@ const DropzoneChildren: React.FC<DropzoneChildrenProps> = (
props: DropzoneChildrenProps props: DropzoneChildrenProps
) => { ) => {
const { children, label, localization } = props; const { children, label, localization } = props;
const isEmptyArray = Array.isArray(children) && children.length===0;
//console.log("isEmptyArray", isEmptyArray,children);
const DropzoneLocalizer: LocalLabels = const DropzoneLocalizer: LocalLabels =
DropzoneLocalizerSelector(localization); DropzoneLocalizerSelector(localization);
//children will be always consider as more important //children will be always consider as more important
if (children) { if (children && !isEmptyArray) {
return ( return (
<div className="files-ui-dropzone-children-container">{children}</div> <div className="files-ui-dropzone-children-container">{children}</div>
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment