2017-07-16 16:02:13 -05:00
|
|
|
// @flow
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
import './EnterPassword.scss';
|
2017-07-16 16:02:13 -05:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { Field, reduxForm } from 'redux-form';
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
import { Link } from 'react-router';
|
2017-07-16 16:02:13 -05:00
|
|
|
import translate from 'translations';
|
|
|
|
import PasswordInput from './PasswordInput';
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
import Template from './Template';
|
2017-07-16 16:02:13 -05:00
|
|
|
|
|
|
|
// VALIDATORS
|
|
|
|
const minLength = min => value => {
|
|
|
|
return value && value.length < min
|
|
|
|
? `Must be ${min} characters or more`
|
|
|
|
: undefined;
|
|
|
|
};
|
|
|
|
const minLength9 = minLength(9);
|
|
|
|
const required = value => (value ? undefined : 'Required');
|
|
|
|
|
2017-07-27 13:05:09 -04:00
|
|
|
type Props = {
|
|
|
|
walletPasswordForm: Object,
|
|
|
|
showWalletPassword: Function,
|
|
|
|
generateNewWallet: Function
|
|
|
|
};
|
|
|
|
|
2017-07-16 16:02:13 -05:00
|
|
|
class EnterPassword extends Component {
|
2017-07-27 13:05:09 -04:00
|
|
|
props: Props;
|
2017-07-16 16:02:13 -05:00
|
|
|
|
|
|
|
state = {
|
|
|
|
fileName: null,
|
2017-07-27 13:05:09 -04:00
|
|
|
blobURI: null,
|
|
|
|
isPasswordVisible: false
|
|
|
|
};
|
|
|
|
|
|
|
|
_onClickGenerateFile = () => {
|
|
|
|
const form = this.props.walletPasswordForm;
|
|
|
|
this.props.generateNewWallet(form.values.password);
|
2017-07-16 16:02:13 -05:00
|
|
|
};
|
|
|
|
|
2017-07-27 13:05:09 -04:00
|
|
|
_togglePassword = () => {
|
|
|
|
this.setState({ isPasswordVisible: !this.state.isPasswordVisible });
|
2017-07-16 16:02:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2017-07-27 13:05:09 -04:00
|
|
|
const { walletPasswordForm } = this.props;
|
|
|
|
const { isPasswordVisible } = this.state;
|
2017-07-16 16:02:13 -05:00
|
|
|
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
const content = (
|
|
|
|
<div className="EnterPw">
|
|
|
|
<h1 className="EnterPw-title" aria-live="polite">
|
2017-07-16 16:02:13 -05:00
|
|
|
{translate('NAV_GenerateWallet')}
|
|
|
|
</h1>
|
|
|
|
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
<label className="EnterPw-password">
|
|
|
|
<h4 className="EnterPw-password-label">
|
|
|
|
{translate('GEN_Label_1')}
|
2017-07-16 16:02:13 -05:00
|
|
|
</h4>
|
|
|
|
<Field
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
className="EnterPw-password-field"
|
2017-07-16 16:02:13 -05:00
|
|
|
validate={[required, minLength9]}
|
|
|
|
component={PasswordInput}
|
2017-07-27 13:05:09 -04:00
|
|
|
isPasswordVisible={isPasswordVisible}
|
|
|
|
togglePassword={this._togglePassword}
|
2017-07-16 16:02:13 -05:00
|
|
|
name="password"
|
|
|
|
type="text"
|
|
|
|
/>
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
</label>
|
|
|
|
|
|
|
|
<button
|
|
|
|
onClick={this._onClickGenerateFile}
|
|
|
|
disabled={walletPasswordForm ? walletPasswordForm.syncErrors : true}
|
|
|
|
className="EnterPw-submit btn btn-primary btn-block"
|
|
|
|
>
|
|
|
|
{translate('NAV_GenerateWallet')}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<p className="EnterPw-warning">
|
|
|
|
{translate('x_PasswordDesc')}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
const help = (
|
|
|
|
<div>
|
|
|
|
<h4>Ledger / TREZOR:</h4>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<span>
|
|
|
|
{translate('GEN_Help_1')}
|
|
|
|
</span>
|
|
|
|
<Link to="/send-transaction">
|
|
|
|
{' '}Ledger or TREZOR or Digital Bitbox
|
|
|
|
</Link>
|
|
|
|
<span>
|
|
|
|
{' '}{translate('GEN_Help_2')}
|
|
|
|
</span>
|
|
|
|
<span translate="GEN_Help_3" className="ng-scope">
|
|
|
|
{' '}{translate('GEN_Help_3')}
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h4>Jaxx / Metamask:</h4>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<span>
|
|
|
|
{translate('GEN_Help_1')}
|
|
|
|
</span>
|
|
|
|
<Link to="/send-transaction">
|
|
|
|
{' '}{translate('x_Mnemonic')}
|
|
|
|
</Link>
|
|
|
|
<span>
|
|
|
|
{' '}{translate('GEN_Help_2')}
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h4>Mist / Geth / Parity:</h4>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<span>
|
|
|
|
{translate('GEN_Help_1')}
|
|
|
|
</span>
|
|
|
|
<Link to="/send-transaction">
|
|
|
|
{' '}{translate('x_Keystore2')}
|
|
|
|
</Link>
|
|
|
|
<span>
|
|
|
|
{' '}{translate('GEN_Help_2')}
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h4 translate="GEN_Help_4" className="ng-scope">
|
|
|
|
Guides & FAQ
|
|
|
|
</h4>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<strong>
|
|
|
|
<a
|
|
|
|
href="https://myetherwallet.groovehq.com/knowledge_base/topics/how-do-i-create-a-new-wallet"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener"
|
|
|
|
>
|
|
|
|
{translate('GEN_Help_5')}
|
|
|
|
</a>
|
|
|
|
</strong>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>
|
|
|
|
<a
|
|
|
|
href="https://myetherwallet.groovehq.com/knowledge_base/categories/getting-started-443"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener"
|
|
|
|
>
|
|
|
|
{translate('GEN_Help_6')}
|
|
|
|
</a>
|
|
|
|
</strong>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-07-16 16:02:13 -05:00
|
|
|
</div>
|
|
|
|
);
|
v3 Style Import (#151)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
2017-09-05 15:52:01 -04:00
|
|
|
|
|
|
|
return <Template content={content} help={help} />;
|
2017-07-16 16:02:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default reduxForm({
|
2017-07-27 13:05:09 -04:00
|
|
|
form: 'walletPasswordForm' // a unique name for this form
|
2017-07-16 16:02:13 -05:00
|
|
|
})(EnterPassword);
|