Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DropzoneList exposes a flag to restrict number of dropzones #129

Merged
merged 2 commits into from
Jul 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions frontend/lib/js/form-components/DropzoneList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type PropsType = {
acceptedDropTypes: string[],
onDrop: Function,
onDelete: Function,
disallowMultipleColumns?: boolean
};

const DropzoneList = (props: PropsType) => {
Expand Down Expand Up @@ -46,11 +47,15 @@ const DropzoneList = (props: PropsType) => {
}
</div>
}
<FreeDropzone
className={props.dropzoneClassName}
containsItem={false}
dropzoneText={props.dropzoneText}
/>
{
// allow at least one column
((props.items && props.items.length === 0) || !props.disallowMultipleColumns) &&
<FreeDropzone
className={props.dropzoneClassName}
containsItem={false}
dropzoneText={props.dropzoneText}
/>
}
</div>
);
};
Expand Down