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