MyCrypto/common/containers/Tabs/GenerateWallet/components/PasswordInput.jsx

45 lines
1.2 KiB
React
Raw Normal View History

2017-06-20 06:14:23 +00:00
import React, { Component } from 'react';
2017-05-30 20:36:52 +00:00
import PropTypes from 'prop-types';
export default class PasswordInput extends Component {
2017-06-20 06:14:23 +00:00
constructor(props) {
super(props);
}
2017-06-20 06:14:23 +00:00
static propTypes = {
showPasswordGenerateWallet: PropTypes.func,
2017-06-20 06:14:23 +00:00
showPassword: PropTypes.bool,
input: PropTypes.object,
meta: PropTypes.object
};
2017-06-20 06:14:23 +00:00
render() {
return (
<div>
<div>
<div className="input-group" style={{ width: '100%' }}>
<input
{...this.props.input}
name="password"
className={
this.props.meta.error
? 'form-control is-invalid'
: 'form-control'
}
type={this.props.showPassword ? 'text' : 'password'}
placeholder="Do NOT forget to save this!"
aria-label="Enter a strong password (at least 9 characters)"
/>
<span
onClick={this.props.showPasswordGenerateWallet}
2017-06-20 06:14:23 +00:00
aria-label="make password visible"
role="button"
className="input-group-addon eye"
/>
</div>
</div>
</div>
);
}
}