-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KPMP-4773: Preparing merge to master for mini-release
- Loading branch information
Showing
3 changed files
with
120 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React, { Component } from 'react'; | ||
import Gallery from 'react-fine-uploader/gallery'; | ||
import PropTypes from 'prop-types'; | ||
|
||
class FileDropzone extends Component { | ||
|
||
uploadFile(e) { | ||
e.preventDefault(); | ||
document.getElementById("upload").click(); | ||
} | ||
|
||
render() { | ||
let cancelButtonClass = "react-fine-uploader-gallery-cancel-button"; | ||
if (this.props.isUploading) { | ||
cancelButtonClass = cancelButtonClass + " cancel-disabled"; | ||
} | ||
const children = <span className='react-fine-uploader-gallery-dropzone-content'> | ||
Drop file(s) here | ||
|
||
</span>; | ||
const fileInputChildren = <span>Select file(s)</span>; | ||
return( | ||
<Gallery uploader={this.props.uploader} cancelButton-className={cancelButtonClass} fileInput-disabled={this.props.isUploading} fileInput-children={fileInputChildren} children={children}/> | ||
); | ||
} | ||
} | ||
|
||
FileDropzone.propTypes = { | ||
uploader: PropTypes.object.isRequired, | ||
isUploading: PropTypes.bool | ||
} | ||
|
||
export default FileDropzone; | ||
|