diff options
author | Dan <danjm.com@gmail.com> | 2018-05-24 23:36:48 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-05-25 00:01:14 +0800 |
commit | 1405237479621d7258468e6c7694415b0afbb045 (patch) | |
tree | f2c8640f9ddb70a1bb5f26032740f98917f9e2ab /ui/app | |
parent | c4e48d9263cb251695afc28d936f7abb0e033f5c (diff) | |
download | dexon-wallet-1405237479621d7258468e6c7694415b0afbb045.tar.gz dexon-wallet-1405237479621d7258468e6c7694415b0afbb045.tar.zst dexon-wallet-1405237479621d7258468e6c7694415b0afbb045.zip |
Fix display of primary currency symbol in send amount row
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js | 4 | ||||
-rw-r--r-- | ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js index be301ca7..b094d0cd 100644 --- a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js +++ b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js @@ -64,7 +64,7 @@ export default class SendAmountRow extends Component { convertedCurrency, gasTotal, inError, - primaryCurrency = 'ETH', + primaryCurrency, selectedToken, } = this.props @@ -80,7 +80,7 @@ export default class SendAmountRow extends Component { convertedCurrency={convertedCurrency} handleChange={newAmount => this.handleAmountChange(newAmount)} inError={inError} - primaryCurrency={primaryCurrency} + primaryCurrency={primaryCurrency || 'ETH'} selectedToken={selectedToken} value={amount || '0x0'} /> diff --git a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js b/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js index 8355ebf1..31d2e251 100644 --- a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js +++ b/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js @@ -156,5 +156,11 @@ describe('SendAmountRow Component', function () { ['mockNewAmount'] ) }) + + it('should pass the default primaryCurrency to the CurrencyDisplay if primaryCurrency is falsy', () => { + wrapper.setProps({ primaryCurrency: null }) + const { primaryCurrency } = wrapper.find(SendRowWrapper).childAt(1).props() + assert.equal(primaryCurrency, 'ETH') + }) }) }) |