Browse Source

Wallet login - remove spaces from the start/end of the login pass phrase; visual improvements

all-modes
petitPapillon 8 years ago
parent
commit
a0ce578f95
  1. 21
      react/src/components/login/login.js
  2. 2
      react/src/components/login/login.render.js
  3. 5
      react/src/components/login/login.scss

21
react/src/components/login/login.js

@ -7,8 +7,7 @@ import {
getDexCoins,
toggleSyncOnlyModal,
getSyncOnlyForks,
createNewWallet,
triggerToaster
createNewWallet
} from '../../actions/actionCreators';
import Store from '../../store';
import {PassPhraseGenerator} from '../../util/crypto/passphrasegenerator';
@ -153,10 +152,13 @@ class Login extends React.Component {
}
updateLoginPassPhraseInput(e) {
// remove any empty chars from the start/end of the string
const newValue = e.target.value ? e.target.value.trim() : null;
this.setState({
[e.target.name]: e.target.value,
loginPassPhraseSeedType: this.getLoginPassPhraseSeedType(e.target.value)
});
[e.target.name]: newValue,
loginPassPhraseSeedType: this.getLoginPassPhraseSeedType(newValue)
});
}
updateRegisterConfirmPassPhraseInput(e) {
@ -176,6 +178,12 @@ class Login extends React.Component {
}
loginSeed() {
// reset the login pass phrase values so that when the user logs out, the values are clear
this.setState({
loginPassphrase: null,
loginPassPhraseSeedType: null,
});
Store.dispatch(
iguanaWalletPassphrase(this.state.loginPassphrase)
);
@ -210,6 +218,7 @@ class Login extends React.Component {
this.setState({
activeLoginSection: name,
loginPassphrase: null,
loginPassPhraseSeedType: null,
seedInputVisibility: false,
bitsOption: 256,
randomSeed: PassPhraseGenerator.generatePassPhrase(256),
@ -258,7 +267,7 @@ class Login extends React.Component {
isSeedBlank: isSeedBlank ? true : false,
});
if (enteredSeedsMatch && !isSeedBlank) {
if (enteredSeedsMatch && !isSeedBlank && _customSeed !== null) {
this.toggleSeedBackupModal();
}
}

2
react/src/components/login/login.render.js

@ -108,7 +108,7 @@ const LoginRender = function () {
<h4 className="color-white">
{ translate('INDEX.WELCOME_PLEASE_ADD') }
</h4>
<div className="form-group form-material floating width-540 vertical-margin-30 horizontal-margin-0">
<div className="form-group form-material floating width-540 vertical-margin-30 auto-side-margin">
<button
className="btn btn-lg btn-primary btn-block ladda-button"
onClick={ this.toggleActivateCoinForm }

5
react/src/components/login/login.scss

@ -84,4 +84,9 @@ textarea {
border-color: transparent black transparent transparent;
}
}
}
.auto-side-margin {
margin-left: auto;
margin-right: auto;
}
Loading…
Cancel
Save