From 6fb0d4af276316c5170a03f31695f72a88cbe278 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Mon, 17 Jun 2019 04:02:12 -0700 Subject: Wrap smaller custom block explorer url text (#6714) --- ui/app/components/app/dropdowns/account-details-dropdown.js | 5 ++++- ui/app/components/app/dropdowns/components/menu.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'ui/app/components') diff --git a/ui/app/components/app/dropdowns/account-details-dropdown.js b/ui/app/components/app/dropdowns/account-details-dropdown.js index cbeccdd81..a4c33620a 100644 --- a/ui/app/components/app/dropdowns/account-details-dropdown.js +++ b/ui/app/components/app/dropdowns/account-details-dropdown.js @@ -119,8 +119,11 @@ AccountDetailsDropdown.prototype.render = function () { this.props.onClose() }, text: (rpcPrefs.blockExplorerUrl - ? this.context.t('blockExplorerView', [rpcPrefs.blockExplorerUrl.match(/^https?:\/\/(.+)/)[1]]) + ? this.context.t('viewinExplorer') : this.context.t('viewOnEtherscan')), + subText: (rpcPrefs.blockExplorerUrl + ? rpcPrefs.blockExplorerUrl.match(/^https?:\/\/(.+)/)[1] + : null), icon: h(`img`, { src: 'images/open-etherscan.svg', style: { height: '15px' } }), }), isRemovable ? h(Item, { diff --git a/ui/app/components/app/dropdowns/components/menu.js b/ui/app/components/app/dropdowns/components/menu.js index f6d8a139e..63501eaa9 100644 --- a/ui/app/components/app/dropdowns/components/menu.js +++ b/ui/app/components/app/dropdowns/components/menu.js @@ -20,16 +20,18 @@ Item.prototype.render = function () { icon, children, text, + subText, className = '', onClick, } = this.props const itemClassName = `menu__item ${className} ${onClick ? 'menu__item--clickable' : ''}` const iconComponent = icon ? h('div.menu__item__icon', [icon]) : null const textComponent = text ? h('div.menu__item__text', text) : null + const subTextComponent = subText ? h('div.menu__item__subtext', subText) : null return children ? h('div', { className: itemClassName, onClick }, children) - : h('div.menu__item', { className: itemClassName, onClick }, [ iconComponent, textComponent ] + : h('div.menu__item', { className: itemClassName, onClick }, [ iconComponent, textComponent, subTextComponent ] .filter(d => Boolean(d)) ) } -- cgit v1.2.3