Skip to content

Commit

Permalink
Merge pull request #102 from chattling/patch-1
Browse files Browse the repository at this point in the history
Removed logging to console from DropzoneDialog
  • Loading branch information
Yuvaleros authored Feb 22, 2020
2 parents ca43257 + efba0e8 commit 0f57dad
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/DropzoneDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class DropzoneDialog extends React.Component {
this.setState({ open: false });
}
onChange(files) {
console.log('Files changed', files);
if (this.props.logEvents) {
console.log('Files changed', files);
}
this.setState({
files: files
}, () => {
Expand All @@ -58,19 +60,25 @@ class DropzoneDialog extends React.Component {
}

onDelete(file) { // this passes it on to the parent component to do with it what they will
console.log('File removed', file);
if (this.props.logEvents) {
console.log('File removed', file);
}
if (this.props.onDelete) {
this.props.onDelete(file)
}
}
onDrop(files) { // this passes it on to the parent component to do with it what they will
console.log('Files dropped', files);
if (this.props.logEvents) {
console.log('Files dropped', files);
}
if (this.props.onDrop) {
this.props.onDrop(files)
}
}
onDropRejected(files, evt) { // this passes it on to the parent component to do with it what they will
console.log('Files rejected', files);
if (this.props.logEvents) {
console.log('Files rejected', files);
}
if (this.props.onDropRejected) {
this.props.onDropRejected(files, evt);
}
Expand Down Expand Up @@ -152,6 +160,7 @@ DropzoneDialog.defaultProps = {
onChange: () => { },
onDrop: () => { },
onDropRejected: () => { },
logEvents: false
};

DropzoneDialog.propTypes = {
Expand All @@ -177,6 +186,7 @@ DropzoneDialog.propTypes = {
cancelButtonText: PropTypes.string,
maxWidth: PropTypes.string,
fullWidth: PropTypes.bool,
logEvents: PropTypes.bool
};

export default DropzoneDialog;

0 comments on commit 0f57dad

Please sign in to comment.