'use strict'; import React from 'react'; import ReactS3FineUploader from '../ascribe_uploader/react_s3_fine_uploader'; import AppConstants from '../../constants/application_constants'; import ApiUrls from '../../constants/api_urls'; import { getCookie } from '../../utils/fetch_api_utils'; let InputFileUploader = React.createClass({ propTypes: { setIsUploadReady: React.PropTypes.func, isReadyForFormSubmission: React.PropTypes.func, onClick: React.PropTypes.func, // isFineUploaderActive is used to lock react fine uploader in case // a user is actually not logged in already to prevent him from droping files // before login in isFineUploaderActive: React.PropTypes.bool, onLoggedOut: React.PropTypes.func, editable: React.PropTypes.bool, enableLocalHashing: React.PropTypes.bool, // provided by Property disabled: React.PropTypes.bool }, getInitialState() { return { value: null }; }, submitKey(key){ this.setState({ value: key }); }, reset() { this.refs.fineuploader.reset(); }, render() { let editable = this.props.isFineUploaderActive; // if disabled is actually set by property, we want to override // isFineUploaderActive if(typeof this.props.disabled !== 'undefined') { editable = !this.props.disabled; } return ( ); } }); export default InputFileUploader;