on f660f7b help sign in
bridge/src/components/old/UploadButton.js
31 lines 617 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 => {
19 this.input = ref;
20 }}
21 onChange={this.onChange}
22 disabled={this.props.disabled}
23 type="file"
24 />
25 {this.props.children}
26 </label>
27 );
28 }
31export default UploadButton;