diff --git a/react/src/assets/images/cryptologo/coqui.png b/react/src/assets/images/cryptologo/coqui.png index 59f61a8..5c83bab 100644 Binary files a/react/src/assets/images/cryptologo/coqui.png and b/react/src/assets/images/cryptologo/coqui.png differ diff --git a/react/src/components/dashboard/importKeyModal/importKeyModal.js b/react/src/components/dashboard/importKeyModal/importKeyModal.js index d6ec712..aca52f8 100755 --- a/react/src/components/dashboard/importKeyModal/importKeyModal.js +++ b/react/src/components/dashboard/importKeyModal/importKeyModal.js @@ -15,6 +15,8 @@ import { ImportKeyModalRender, } from './importKeyModal.render'; +const SEED_TRIM_TIMEOUT = 5000; + // import gen komodo keys utils import '../../../util/crypto/gen/array.map.js'; import '../../../util/crypto/gen/cryptojs.js'; @@ -44,6 +46,7 @@ class ImportKeyModal extends React.Component { seedInputVisibility: false, wifInputVisibility: false, trimPassphraseTimer: null, + seedExtraSpaces: false, }; this.generateKeysFromPassphrase = this.generateKeysFromPassphrase.bind(this); this.toggleImportWithRescan = this.toggleImportWithRescan.bind(this); @@ -62,18 +65,24 @@ class ImportKeyModal extends React.Component { } updateInput(e) { - if (e.target.name === 'wifkeysPassphrase') { - // remove any empty chars from the start/end of the string - const newValue = e.target.value; + const newValue = e.target.value; - clearTimeout(this.state.trimPassphraseTimer); + clearTimeout(this.state.trimPassphraseTimer); - const _trimPassphraseTimer = setTimeout(() => { + const _trimPassphraseTimer = setTimeout(() => { + if (newValue[0] === ' ' || + newValue[newValue.length - 1] === ' ') { this.setState({ - wifkeysPassphrase: newValue ? newValue.trim() : '', // hardcoded field name + seedExtraSpaces: true, }); - }, 2000); + } else { + this.setState({ + seedExtraSpaces: false, + }); + } + }, SEED_TRIM_TIMEOUT); + if (e.target.name === 'wifkeysPassphrase') { this.resizeLoginTextarea(); this.setState({ diff --git a/react/src/components/dashboard/importKeyModal/importKeyModal.render.js b/react/src/components/dashboard/importKeyModal/importKeyModal.render.js index 3f244fa..22c7dbd 100644 --- a/react/src/components/dashboard/importKeyModal/importKeyModal.render.js +++ b/react/src/components/dashboard/importKeyModal/importKeyModal.render.js @@ -64,6 +64,16 @@ export const ImportKeyModalRender = function() { + { this.state.seedExtraSpaces && + + + + + }
} - { this.state.btcPreflightRes && + { this.state.spvPreflightRes &&
Fee
-
{ formatValue(this.state.btcPreflightRes.fee * 0.00000001) } ({ this.state.btcPreflightRes.fee } sats)
+
{ formatValue(this.state.spvPreflightRes.fee * 0.00000001) } ({ this.state.spvPreflightRes.fee } sats)
} - { this.state.btcPreflightRes && + { this.state.spvPreflightRes &&
- { this.state.btcPreflightRes.change === 0 && + { this.state.spvPreflightRes.change === 0 &&
Adjusted amount @@ -265,13 +265,19 @@ export const SendRender = function() { effect="solid" className="text-left" /> -  { formatValue((this.state.btcPreflightRes.value * 0.00000001) - (this.state.btcPreflightRes.fee * 0.00000001)) } +  { formatValue((this.state.spvPreflightRes.value * 0.00000001) - (this.state.spvPreflightRes.fee * 0.00000001)) }
} - { this.state.btcPreflightRes.change > 0 && + { this.state.spvPreflightRes.estimatedFee < 0 && +
+ KMD interest  + { Math.abs(formatValue(this.state.spvPreflightRes.estimatedFee * 0.00000001)) } to { this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub } +
+ } + { this.state.spvPreflightRes.change > 0 &&
Total (amount + transaction fee)  - { formatValue((this.state.btcPreflightRes.value * 0.00000001) + (this.state.btcPreflightRes.fee * 0.00000001)) } + { formatValue((this.state.spvPreflightRes.value * 0.00000001) + (this.state.spvPreflightRes.fee * 0.00000001)) }
}
diff --git a/react/src/components/dashboard/settings/settings.bip39KeysPanel.js b/react/src/components/dashboard/settings/settings.bip39KeysPanel.js index b4f1e94..ebcf063 100644 --- a/react/src/components/dashboard/settings/settings.bip39KeysPanel.js +++ b/react/src/components/dashboard/settings/settings.bip39KeysPanel.js @@ -7,6 +7,9 @@ import { triggerToaster, } from '../../../actions/actionCreators'; import Store from '../../../store'; +import ReactTooltip from 'react-tooltip'; + +const SEED_TRIM_TIMEOUT = 5000; class Bip39KeysPanel extends React.Component { constructor() { @@ -15,6 +18,7 @@ class Bip39KeysPanel extends React.Component { keys: null, match: '', passphrase: '', + seedExtraSpaces: false, seedInputVisibility: false, trimPassphraseTimer: null, addressdepth: 20, @@ -51,18 +55,24 @@ class Bip39KeysPanel extends React.Component { } updateInput(e) { - if (e.target.name === 'passphrase') { - // remove any empty chars from the start/end of the string - const newValue = e.target.value; + const newValue = e.target.value; - clearTimeout(this.state.trimPassphraseTimer); + clearTimeout(this.state.trimPassphraseTimer); - const _trimPassphraseTimer = setTimeout(() => { + const _trimPassphraseTimer = setTimeout(() => { + if (newValue[0] === ' ' || + newValue[newValue.length - 1] === ' ') { + this.setState({ + seedExtraSpaces: true, + }); + } else { this.setState({ - passphrase: newValue ? newValue.trim() : '', // hardcoded field name + seedExtraSpaces: false, }); - }, 2000); + } + }, SEED_TRIM_TIMEOUT); + if (e.target.name === 'passphrase') { this.resizeLoginTextarea(); this.setState({ @@ -103,12 +113,6 @@ class Bip39KeysPanel extends React.Component { }); } - updateInput(e) { - this.setState({ - [e.target.name]: e.target.value, - }); - } - render() { return (
@@ -145,6 +149,16 @@ class Bip39KeysPanel extends React.Component { + { this.state.seedExtraSpaces && + + + + + }
diff --git a/react/src/components/dashboard/settings/settings.exportKeysPanel.js b/react/src/components/dashboard/settings/settings.exportKeysPanel.js index 35de2fb..823bd89 100644 --- a/react/src/components/dashboard/settings/settings.exportKeysPanel.js +++ b/react/src/components/dashboard/settings/settings.exportKeysPanel.js @@ -7,6 +7,9 @@ import { triggerToaster, } from '../../../actions/actionCreators'; import Store from '../../../store'; +import ReactTooltip from 'react-tooltip'; + +const SEED_TRIM_TIMEOUT = 5000; class ExportKeysPanel extends React.Component { constructor() { @@ -16,6 +19,7 @@ class ExportKeysPanel extends React.Component { trimPassphraseTimer: null, wifkeysPassphrase: '', keys: null, + seedExtraSpaces: false, }; this.exportWifKeys = this.exportWifKeys.bind(this); this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this); @@ -109,18 +113,24 @@ class ExportKeysPanel extends React.Component { } updateInput(e) { - if (e.target.name === 'wifkeysPassphrase') { - // remove any empty chars from the start/end of the string - const newValue = e.target.value; + const newValue = e.target.value; - clearTimeout(this.state.trimPassphraseTimer); + clearTimeout(this.state.trimPassphraseTimer); - const _trimPassphraseTimer = setTimeout(() => { + const _trimPassphraseTimer = setTimeout(() => { + if (newValue[0] === ' ' || + newValue[newValue.length - 1] === ' ') { this.setState({ - wifkeysPassphrase: newValue ? newValue.trim() : '', // hardcoded field name + seedExtraSpaces: true, }); - }, 2000); + } else { + this.setState({ + seedExtraSpaces: false, + }); + } + }, SEED_TRIM_TIMEOUT); + if (e.target.name === 'wifkeysPassphrase') { this.resizeLoginTextarea(); this.setState({ @@ -198,6 +208,16 @@ class ExportKeysPanel extends React.Component { + { this.state.seedExtraSpaces && + + + + + }
} + { this.state.seedExtraSpaces && + + + + + } { this.state.loginPassphrase && this.state.enableEncryptSeed &&
diff --git a/react/src/components/login/login.scss b/react/src/components/login/login.scss index 81fa5da..4bb1098 100644 --- a/react/src/components/login/login.scss +++ b/react/src/components/login/login.scss @@ -187,6 +187,13 @@ option.login-option { } .page-login { + .seed-extra-spaces-warning { + position: absolute; + right: -30px; + margin-top: 54px; + font-size: 20px; + color: rgb(255, 75, 0); + } .addcoin-shortcut { display: inline-block; width: 46%;