1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-10 21:18:38 +01:00
onion/js/components/ascribe_uploader/file_drag_and_drop_dialog.js
2015-07-23 17:17:48 +02:00

41 lines
1.2 KiB
JavaScript

'use strict';
import React from 'react';
import { getLangText } from '../../utils/lang_utils';
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">
{getLangText('Click or drag to add files')}
</span>
);
} else {
return (
<span className="file-drag-and-drop-dialog">
<p>{getLangText('Drag a file here')}</p>
<p>{getLangText('or')}</p>
<span
className="btn btn-default"
onClick={this.props.onClick}>
{getLangText('choose a file to upload')}
</span>
</span>
);
}
}
}
});
export default FileDragAndDropDialog;