Browse Source

import key modal wif visibility toggle

v0.25
pbca26 7 years ago
parent
commit
d7372e4ba4
  1. 11
      react/src/components/dashboard/importKeyModal/importKeyModal.js
  2. 21
      react/src/components/dashboard/importKeyModal/importKeyModal.render.js

11
react/src/components/dashboard/importKeyModal/importKeyModal.js

@ -42,12 +42,13 @@ class ImportKeyModal extends React.Component {
keyImportResult: null,
importWithRescan: false,
seedInputVisibility: false,
toggleSeedInputVisibility: false,
wifInputVisibility: false,
trimPassphraseTimer: null,
};
this.generateKeysFromPassphrase = this.generateKeysFromPassphrase.bind(this);
this.toggleImportWithRescan = this.toggleImportWithRescan.bind(this);
this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this);
this.toggleWifInputVisibility = this.toggleWifInputVisibility.bind(this);
this._copyCoinAddress = this._copyCoinAddress.bind(this);
this.showPassphraseAddress = this.showPassphraseAddress.bind(this);
this.importWifAddress = this.importWifAddress.bind(this);
@ -102,6 +103,12 @@ class ImportKeyModal extends React.Component {
});
}
toggleWifInputVisibility() {
this.setState({
wifInputVisibility: !this.state.wifInputVisibility,
});
}
showPassphraseAddress() {
const _address = this.generateKeysFromPassphrase();
@ -189,6 +196,7 @@ class ImportKeyModal extends React.Component {
});
this.setState({
wif: null,
passphraseWif: null,
passphraseAddress: null,
wifkeysPassphrase: null,
@ -197,6 +205,7 @@ class ImportKeyModal extends React.Component {
});
// reset input vals
this.refs.wif.value = '';
this.refs.wifkeysPassphrase.value = '';
this.refs.wifkeysPassphraseTextarea.value = '';
}

21
react/src/components/dashboard/importKeyModal/importKeyModal.render.js

@ -116,13 +116,20 @@ export const ImportKeyModalRender = function() {
<label
htmlFor="wif"
className="bold">{ translate('IMPORT_KEY.WIF_KEY') }</label>
<input
type="text"
className="form-control"
name="wif"
ref="wif"
onChange={ this.updateInput }
value={ this.state.wif } />
<div className="form-group form-material">
<input
autoComplete="off"
type={ !this.state.wifInputVisibility ? 'password' : 'text' }
className="form-control"
name="wif"
id="wif"
ref="wif"
onChange={ this.updateInput }
value={ this.state.wif } />
<i
className={ 'seed-toggle fa fa-eye' + (!this.state.wifInputVisibility ? '-slash' : '') }
onClick={ this.toggleWifInputVisibility }></i>
</div>
</div>
<button
type="button"

Loading…
Cancel
Save