1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 17:45:10 +01:00
onion/js/components/ascribe_uploader/file_drag_and_drop_dialog.js

37 lines
1.0 KiB
JavaScript
Raw Normal View History

2015-07-07 18:07:12 +02:00
'use strict';
import React from 'react';
let FileDragAndDropDialog = React.createClass({
propTypes: {
hasFiles: React.PropTypes.bool,
multipleFiles: React.PropTypes.bool,
onClick: React.PropTypes.func
},
render() {
if(this.props.hasFiles) {
return null;
} else {
if(this.props.multipleFiles) {
return (
<span className="file-drag-and-drop-dialog">Click or drag to add files</span>
);
} else {
return (
<span className="file-drag-and-drop-dialog">
<p>Drag a file here</p>
<p>or</p>
<span
2015-07-07 18:07:12 +02:00
className="btn btn-default"
onClick={this.props.onClick}>
choose a file to upload
</span>
2015-07-07 18:07:12 +02:00
</span>
);
}
}
}
});
export default FileDragAndDropDialog;