on db15cc5 help sign in
bridge/src/components/UploadButton.js
29 lines 619 B history raw
1import React from 'react';
3class UploadButton extends React.Component {
4 constructor(props) {
5 super(props);
6 this.onChange = this.onChange.bind(this);
7 }
9 onChange() {
10 this.props.onChange(this.input);
11 }
13 render() {
14 return (
15 <label className={this.props.className}>
16 <input
17 className={ 'hidden h-0 w-0 abs' }
18 ref={(ref) => { this.input = ref; }}
19 onChange={this.onChange}
20 disabled={this.props.disabled}
21 type="file"
22 />
23 {this.props.children}
24 </label>
25 );
26 }
29export default UploadButton;