aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/pages
diff options
context:
space:
mode:
authorKristian Tapia <kristian.tapia01@gmail.com>2019-07-24 07:51:13 +0800
committerDan J Miller <danjm.com@gmail.com>2019-07-24 07:51:13 +0800
commit934433e4bed1d0db67cb92bf5695952733461e63 (patch)
tree1d2041896d75df4ab12389f51940ba2c4967a01e /ui/app/pages
parentfc3b035aac66c5636ef7d77c0659a157cdf4384d (diff)
downloadtangerine-wallet-browser-934433e4bed1d0db67cb92bf5695952733461e63.tar
tangerine-wallet-browser-934433e4bed1d0db67cb92bf5695952733461e63.tar.gz
tangerine-wallet-browser-934433e4bed1d0db67cb92bf5695952733461e63.tar.bz2
tangerine-wallet-browser-934433e4bed1d0db67cb92bf5695952733461e63.tar.lz
tangerine-wallet-browser-934433e4bed1d0db67cb92bf5695952733461e63.tar.xz
tangerine-wallet-browser-934433e4bed1d0db67cb92bf5695952733461e63.tar.zst
tangerine-wallet-browser-934433e4bed1d0db67cb92bf5695952733461e63.zip
Single asset dropdown fix (#6900)
* Disable open dropdown for single asset * add test to check single asset in dropdown * fix lint errors, remove unused import
Diffstat (limited to 'ui/app/pages')
-rw-r--r--ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js4
-rw-r--r--ui/app/pages/send/send-content/tests/send-content-component.test.js7
2 files changed, 9 insertions, 2 deletions
diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js
index de2d9462f..1dcd0bd2c 100644
--- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js
+++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js
@@ -59,7 +59,7 @@ export default class SendAssetRow extends Component {
<SendRowWrapper label={`${t('asset')}:`}>
<div className="send-v2__asset-dropdown">
{ this.renderSelectedToken() }
- { this.renderAssetDropdown() }
+ { this.props.tokens.length > 0 ? this.renderAssetDropdown() : null }
</div>
</SendRowWrapper>
)
@@ -101,7 +101,7 @@ export default class SendAssetRow extends Component {
return (
<div
- className="send-v2__asset-dropdown__asset"
+ className={ this.props.tokens.length > 0 ? 'send-v2__asset-dropdown__asset' : 'send-v2__asset-dropdown__single-asset' }
onClick={() => this.selectToken()}
>
<div className="send-v2__asset-dropdown__asset-icon">
diff --git a/ui/app/pages/send/send-content/tests/send-content-component.test.js b/ui/app/pages/send/send-content/tests/send-content-component.test.js
index 521c6523e..d172423ab 100644
--- a/ui/app/pages/send/send-content/tests/send-content-component.test.js
+++ b/ui/app/pages/send/send-content/tests/send-content-component.test.js
@@ -50,4 +50,11 @@ describe('SendContent Component', function () {
assert.equal(PageContainerContentChild.childAt(5).exists(), false)
})
})
+
+ it('should not render the asset dropdown if token length is 0 ', () => {
+ wrapper.setProps({ tokens: [] })
+ const PageContainerContentChild = wrapper.find(PageContainerContent).children()
+ assert(PageContainerContentChild.childAt(2).is(SendAssetRow))
+ assert(PageContainerContentChild.childAt(2).find('send-v2__asset-dropdown__single-asset'), true)
+ })
})