diff options
3 files changed, 20 insertions, 2 deletions
diff --git a/ui/app/css/itcss/components/send.scss b/ui/app/css/itcss/components/send.scss index c1a7381b6..ee07c1a7e 100644 --- a/ui/app/css/itcss/components/send.scss +++ b/ui/app/css/itcss/components/send.scss @@ -646,6 +646,17 @@ height: 54px; border: none; + &__single-asset { + display: flex; + flex-flow: row nowrap; + align-items: center; + padding: 8px 8px; + + &:hover { + background-color: rgba($alto, 0.2); + } + } + &__asset { display: flex; flex-flow: row nowrap; 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) + }) }) |