on fbcd6b6 help sign in
bridge/src/_walletgen/components/UploadButton.js
32 lines 640 B history raw
1import React, { Component } from 'react';
3class UploadButton extends 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'}
18 accept={'.txt'}
19 ref={ref => {
20 this.input = ref;
21 }}
22 onChange={this.onChange}
23 disabled={this.props.disabled}
24 type="file"
25 />
26 {this.props.children}
27 </label>
28 );
29 }
32export default UploadButton;