1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

fix wording for file drag and drop dialog

This commit is contained in:
Tim Daubenschütz 2015-07-27 09:23:01 +02:00
parent d6968b40b5
commit d71111b6f1
3 changed files with 11 additions and 4 deletions

View File

@ -30,6 +30,8 @@ let FileDragAndDrop = React.createClass({
areAssetsDownloadable: React.PropTypes.bool, areAssetsDownloadable: React.PropTypes.bool,
areAssetsEditable: React.PropTypes.bool, areAssetsEditable: React.PropTypes.bool,
localHashing: React.PropTypes.bool,
// triggers a FileDragAndDrop-global spinner // triggers a FileDragAndDrop-global spinner
hashingProgress: React.PropTypes.number, hashingProgress: React.PropTypes.number,
// sets the value of this.state.hashingProgress in reactfineuploader // sets the value of this.state.hashingProgress in reactfineuploader
@ -174,7 +176,8 @@ let FileDragAndDrop = React.createClass({
<FileDragAndDropDialog <FileDragAndDropDialog
multipleFiles={this.props.multiple} multipleFiles={this.props.multiple}
hasFiles={hasFiles} hasFiles={hasFiles}
onClick={this.handleOnClick}/> onClick={this.handleOnClick}
localHashing={this.props.localHashing}/>
<FileDragAndDropPreviewIterator <FileDragAndDropPreviewIterator
files={this.props.filesToUpload} files={this.props.filesToUpload}
handleDeleteFile={this.handleDeleteFile} handleDeleteFile={this.handleDeleteFile}

View File

@ -8,7 +8,8 @@ let FileDragAndDropDialog = React.createClass({
propTypes: { propTypes: {
hasFiles: React.PropTypes.bool, hasFiles: React.PropTypes.bool,
multipleFiles: React.PropTypes.bool, multipleFiles: React.PropTypes.bool,
onClick: React.PropTypes.func onClick: React.PropTypes.func,
localHashing: React.PropTypes.bool
}, },
render() { render() {
@ -22,6 +23,8 @@ let FileDragAndDropDialog = React.createClass({
</span> </span>
); );
} else { } else {
let dialog = this.props.localHashing ? getLangText('choose a file to hash') : getLangText('choose a file to upload');
return ( return (
<span className="file-drag-and-drop-dialog"> <span className="file-drag-and-drop-dialog">
<p>{getLangText('Drag a file here')}</p> <p>{getLangText('Drag a file here')}</p>
@ -29,7 +32,7 @@ let FileDragAndDropDialog = React.createClass({
<span <span
className="btn btn-default" className="btn btn-default"
onClick={this.props.onClick}> onClick={this.props.onClick}>
{getLangText('choose a file to upload')} {dialog}
</span> </span>
</span> </span>
); );

View File

@ -691,7 +691,8 @@ var ReactS3FineUploader = React.createClass({
areAssetsDownloadable={this.props.areAssetsDownloadable} areAssetsDownloadable={this.props.areAssetsDownloadable}
areAssetsEditable={this.props.areAssetsEditable} areAssetsEditable={this.props.areAssetsEditable}
dropzoneInactive={!this.props.areAssetsEditable || !this.props.multiple && this.state.filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled' && file.size !== -1).length > 0} dropzoneInactive={!this.props.areAssetsEditable || !this.props.multiple && this.state.filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled' && file.size !== -1).length > 0}
hashingProgress={this.state.hashingProgress} /> hashingProgress={this.state.hashingProgress}
localHashing={this.props.localHashing} />
</div> </div>
); );
} }