2015-06-25 13:28:49 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-06-23 10:16:53 +02:00
|
|
|
import React from 'react';
|
|
|
|
import ProgressBar from 'react-progressbar';
|
|
|
|
|
2015-06-29 16:00:26 +02:00
|
|
|
|
2015-06-23 10:16:53 +02:00
|
|
|
let FileDragAndDropPreviewOther = React.createClass({
|
|
|
|
propTypes: {
|
|
|
|
type: React.PropTypes.string,
|
2015-06-25 13:46:10 +02:00
|
|
|
progress: React.PropTypes.number,
|
|
|
|
onClick: React.PropTypes.func
|
2015-06-23 10:16:53 +02:00
|
|
|
},
|
|
|
|
|
2015-06-29 16:00:26 +02:00
|
|
|
getInitialState() {
|
|
|
|
return {
|
|
|
|
loading: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
onClick(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
loading: true
|
|
|
|
});
|
|
|
|
|
|
|
|
this.props.onClick(e);
|
|
|
|
},
|
|
|
|
|
2015-06-23 10:16:53 +02:00
|
|
|
render() {
|
2015-06-29 16:46:12 +02:00
|
|
|
//let actionSymbol = this.state.loading ? <img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} /> : <span className="glyphicon glyphicon-remove delete-file" aria-hidden="true" title="Delete or cancel upload" onClick={this.onClick} />;
|
2015-06-25 13:28:49 +02:00
|
|
|
return (
|
|
|
|
<div
|
2015-06-23 10:16:53 +02:00
|
|
|
className="file-drag-and-drop-preview">
|
|
|
|
<ProgressBar completed={this.props.progress} color="black"/>
|
|
|
|
<div className="file-drag-and-drop-preview-table-wrapper">
|
|
|
|
<div className="file-drag-and-drop-preview-other">
|
2015-06-29 16:46:12 +02:00
|
|
|
<span className="glyphicon glyphicon-pause delete-file" aria-hidden="true" title="Delete or cancel upload"/>
|
2015-06-23 10:16:53 +02:00
|
|
|
<span>{'.' + this.props.type}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default FileDragAndDropPreviewOther;
|