2017-09-24 19:06:28 -07:00
|
|
|
import { GenerateNewWalletAction } from 'actions/generateWallet';
|
2017-07-16 16:02:13 -05:00
|
|
|
import React, { Component } from 'react';
|
2017-09-28 22:09:01 -04:00
|
|
|
import { Link } from 'react-router-dom';
|
2017-07-16 16:02:13 -05:00
|
|
|
import translate from 'translations';
|
2017-09-24 19:06:28 -07:00
|
|
|
import './EnterPassword.scss';
|
2017-07-16 16:02:13 -05:00
|
|
|
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-12-06 18:04:57 -05:00
|
|
|
import { knowledgeBaseURL } from 'config/data';
|
2017-11-27 15:31:23 -05:00
|
|
|
|
2017-07-16 16:02:13 -05:00
|
|
|
// VALIDATORS
|
2017-11-27 15:31:23 -05:00
|
|
|
const minLength = min => value => value && value.length >= min;
|
2017-07-16 16:02:13 -05:00
|
|
|
const minLength9 = minLength(9);
|
|
|
|
|
2017-09-24 19:06:28 -07:00
|
|
|
interface Props {
|
|
|
|
generateNewWallet(pw: string): GenerateNewWalletAction;
|
|
|
|
}
|
2017-07-16 16:02:13 -05:00
|
|
|
|
2017-09-24 19:06:28 -07:00
|
|
|
interface State {
|
|
|
|
fileName: null | string;
|
|
|
|
blobURI: null | string;
|
2017-11-27 15:31:23 -05:00
|
|
|
password: string;
|
|
|
|
isPasswordValid: boolean;
|
2017-09-24 19:06:28 -07:00
|
|
|
isPasswordVisible: boolean;
|
|
|
|
}
|
2017-11-27 15:31:23 -05:00
|
|
|
export default class EnterPassword extends Component<Props, State> {
|
2017-09-24 19:06:28 -07:00
|
|
|
public state = {
|
2017-07-16 16:02:13 -05:00
|
|
|
fileName: null,
|
2017-07-27 13:05:09 -04:00
|
|
|
blobURI: null,
|
2017-11-27 15:31:23 -05:00
|
|
|
password: '',
|
|
|
|
isPasswordValid: false,
|
2017-07-27 13:05:09 -04:00
|
|
|
isPasswordVisible: false
|
|
|
|
};
|
|
|
|
|
2017-09-24 19:06:28 -07:00
|
|
|
public render() {
|
2017-11-27 15:31:23 -05:00
|
|
|
const { password, isPasswordValid, isPasswordVisible } = this.state;
|
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">
|
2017-09-24 19:06:28 -07:00
|
|
|
<h4 className="EnterPw-password-label">{translate('GEN_Label_1')}</h4>
|
2017-11-27 15:31:23 -05:00
|
|
|
<PasswordInput
|
|
|
|
password={password}
|
|
|
|
onPasswordChange={this.onPasswordChange}
|
2017-07-27 13:05:09 -04:00
|
|
|
isPasswordVisible={isPasswordVisible}
|
2017-09-24 19:06:28 -07:00
|
|
|
togglePassword={this.togglePassword}
|
2017-11-27 15:31:23 -05:00
|
|
|
isPasswordValid={isPasswordValid}
|
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
|
|
|
</label>
|
|
|
|
|
|
|
|
<button
|
2017-09-24 19:06:28 -07:00
|
|
|
onClick={this.onClickGenerateFile}
|
2017-11-27 15:31:23 -05:00
|
|
|
disabled={!isPasswordValid}
|
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-submit btn btn-primary btn-block"
|
|
|
|
>
|
|
|
|
{translate('NAV_GenerateWallet')}
|
|
|
|
</button>
|
|
|
|
|
2017-09-24 19:06:28 -07:00
|
|
|
<p className="EnterPw-warning">{translate('x_PasswordDesc')}</p>
|
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
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
const help = (
|
|
|
|
<div>
|
|
|
|
<h4>Ledger / TREZOR:</h4>
|
|
|
|
<ul>
|
|
|
|
<li>
|
2017-09-24 19:06:28 -07:00
|
|
|
<span>{translate('GEN_Help_1')}</span>
|
2017-12-06 18:04:57 -05:00
|
|
|
<Link to="/send-transaction"> Ledger or TREZOR or Digital Bitbox</Link>
|
2017-09-24 19:06:28 -07:00
|
|
|
<span> {translate('GEN_Help_2')}</span>
|
|
|
|
<span> {translate('GEN_Help_3')}</span>
|
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
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h4>Jaxx / Metamask:</h4>
|
|
|
|
<ul>
|
|
|
|
<li>
|
2017-09-24 19:06:28 -07:00
|
|
|
<span>{translate('GEN_Help_1')}</span>
|
|
|
|
<Link to="/send-transaction"> {translate('x_Mnemonic')}</Link>
|
|
|
|
<span> {translate('GEN_Help_2')}</span>
|
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
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h4>Mist / Geth / Parity:</h4>
|
|
|
|
<ul>
|
|
|
|
<li>
|
2017-09-24 19:06:28 -07:00
|
|
|
<span>{translate('GEN_Help_1')}</span>
|
|
|
|
<Link to="/send-transaction"> {translate('x_Keystore2')}</Link>
|
|
|
|
<span> {translate('GEN_Help_2')}</span>
|
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
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2017-09-07 15:14:52 -05:00
|
|
|
<h4>Guides & FAQ</h4>
|
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
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<strong>
|
|
|
|
<a
|
2017-12-06 18:04:57 -05:00
|
|
|
href={`${knowledgeBaseURL}/getting-started/creating-a-new-wallet-on-myetherwallet`}
|
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
|
|
|
target="_blank"
|
|
|
|
rel="noopener"
|
|
|
|
>
|
|
|
|
{translate('GEN_Help_5')}
|
|
|
|
</a>
|
|
|
|
</strong>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>
|
|
|
|
<a
|
2017-12-06 18:04:57 -05:00
|
|
|
href={`${knowledgeBaseURL}/getting-started/getting-started-new`}
|
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
|
|
|
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
|
|
|
}
|
2017-09-24 19:06:28 -07:00
|
|
|
private onClickGenerateFile = () => {
|
2017-11-27 15:31:23 -05:00
|
|
|
this.props.generateNewWallet(this.state.password);
|
|
|
|
this.setState({ password: '' });
|
2017-09-24 19:06:28 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
private togglePassword = () => {
|
|
|
|
this.setState({ isPasswordVisible: !this.state.isPasswordVisible });
|
|
|
|
};
|
2017-07-16 16:02:13 -05:00
|
|
|
|
2017-11-27 15:31:23 -05:00
|
|
|
private onPasswordChange = (e: any) => {
|
|
|
|
const password = e.target.value;
|
|
|
|
this.setState({
|
|
|
|
isPasswordValid: minLength9(password),
|
|
|
|
password
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|