diff --git a/js/components/ascribe_forms/form_create_contract.js b/js/components/ascribe_forms/form_create_contract.js index 614480a7..23916c67 100644 --- a/js/components/ascribe_forms/form_create_contract.js +++ b/js/components/ascribe_forms/form_create_contract.js @@ -77,7 +77,11 @@ let CreateContractForm = React.createClass({ areAssetsEditable={true} submitFile={this.submitFile} setIsUploadReady={this.setIsUploadReady} - isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile} /> + isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile} + fileClassToUpload={{ + singular: 'contract', + plural: 'contracts' + }}/> + enableLocalHashing={this.props.enableLocalHashing} + fileClassToUpload={this.props.fileClassToUpload}/> ); } }); diff --git a/js/components/ascribe_uploader/file_drag_and_drop.js b/js/components/ascribe_uploader/file_drag_and_drop.js index 7d6c8a66..9de22d3d 100644 --- a/js/components/ascribe_uploader/file_drag_and_drop.js +++ b/js/components/ascribe_uploader/file_drag_and_drop.js @@ -37,7 +37,14 @@ let FileDragAndDrop = React.createClass({ hashingProgress: React.PropTypes.number, // sets the value of this.state.hashingProgress in reactfineuploader // to -1 which is code for: aborted - handleCancelHashing: React.PropTypes.func + handleCancelHashing: React.PropTypes.func, + + // A class of a file the user has to upload + // Needs to be defined both in singular as well as in plural + fileClassToUpload: React.PropTypes.shape({ + singular: React.PropTypes.string, + plural: React.PropTypes.string + }) }, handleDragStart(event) { @@ -192,7 +199,8 @@ let FileDragAndDrop = React.createClass({ multipleFiles={this.props.multiple} hasFiles={hasFiles} onClick={this.handleOnClick} - enableLocalHashing={this.props.enableLocalHashing}/> + enableLocalHashing={this.props.enableLocalHashing} + fileClassToUpload={this.props.fileClassToUpload}/> -

{getLangText('Drag files here')}

+

{getLangText('Drag %s here', this.props.fileClassToUpload.plural)}

{getLangText('or')}

- {getLangText('choose files to upload')} + {getLangText('choose %s to upload', this.props.fileClassToUpload.plural)} ); } else { - let dialog = queryParams.method === 'hash' ? getLangText('choose a file to hash') : getLangText('choose a file to upload'); + let dialog = queryParams.method === 'hash' ? getLangText('choose a %s to hash', this.props.fileClassToUpload.singular) : getLangText('choose a file to upload'); return ( -

{getLangText('Drag a file here')}

+

{getLangText('Drag a %s here', this.props.fileClassToUpload.singular)}

{getLangText('or')}

+ enableLocalHashing={this.props.enableLocalHashing} + fileClassToUpload={this.props.fileClassToUpload}/> ); }