diff --git a/ui/components/app/confirm-page-container/confirm-page-container.component.js b/ui/components/app/confirm-page-container/confirm-page-container.component.js index 35905c940..ad17d7c7c 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container.component.js @@ -217,6 +217,7 @@ export default class ConfirmPageContainer extends Component { tokenName={nativeCurrency} accountAddress={fromAddress} networkName={networkName} + chainId={currentTransaction.chainId} /> ) : ( span { + display: flex; + justify-content: center; + line-height: 18px; + } + } + + &__ident-icon-ethereum--gray { + border: 1px solid var(--color-border-default); } } } diff --git a/ui/components/app/network-account-balance-header/network-account-balance-header.js b/ui/components/app/network-account-balance-header/network-account-balance-header.js index 217111c16..fbf5291b1 100644 --- a/ui/components/app/network-account-balance-header/network-account-balance-header.js +++ b/ui/components/app/network-account-balance-header/network-account-balance-header.js @@ -1,5 +1,6 @@ import React, { useContext } from 'react'; import PropTypes from 'prop-types'; +import IconWithFallback from '../../ui/icon-with-fallback'; import Identicon from '../../ui/identicon'; import { DISPLAY, @@ -14,15 +15,21 @@ import { import Box from '../../ui/box/box'; import { I18nContext } from '../../../contexts/i18n'; import Typography from '../../ui/typography'; +import { CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP } from '../../../../shared/constants/network'; export default function NetworkAccountBalanceHeader({ networkName, accountName, accountBalance, - tokenName, + tokenName, // Derived from nativeCurrency accountAddress, + chainId, }) { const t = useContext(I18nContext); + const networkIcon = CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP[chainId]; + const networkIconWrapperClass = networkIcon + ? 'network-account-balance-header__network-account__ident-icon-ethereum' + : 'network-account-balance-header__network-account__ident-icon-ethereum--gray'; return ( - { const [iconError, setIconError] = useState(false); @@ -17,21 +18,28 @@ const IconWithFallback = ({ setIconError(true); }; - return !iconError && icon ? ( - {name - ) : ( - - {name && name.length ? name.charAt(0).toUpperCase() : ''} - + return ( +
+ {!iconError && icon ? ( + {name + ) : ( + + {name?.charAt(0).toUpperCase() || ''} + + )} +
); }; @@ -52,6 +60,10 @@ IconWithFallback.propTypes = { * className to apply to the image tag */ className: PropTypes.string, + /** + * className to apply to the div that wraps the icon + */ + wrapperClassName: PropTypes.string, /** * Additional className to apply to the fallback span tag */ diff --git a/ui/pages/swaps/dropdown-search-list/__snapshots__/dropdown-search-list.test.js.snap b/ui/pages/swaps/dropdown-search-list/__snapshots__/dropdown-search-list.test.js.snap index e92d6b8cf..b9cd71bde 100644 --- a/ui/pages/swaps/dropdown-search-list/__snapshots__/dropdown-search-list.test.js.snap +++ b/ui/pages/swaps/dropdown-search-list/__snapshots__/dropdown-search-list.test.js.snap @@ -12,11 +12,15 @@ exports[`DropdownSearchList renders the component with initial props 1`] = ` diff --git a/ui/pages/swaps/searchable-item-list/__snapshots__/searchable-item-list.test.js.snap b/ui/pages/swaps/searchable-item-list/__snapshots__/searchable-item-list.test.js.snap index 347fcbec7..6fbcb7b67 100644 --- a/ui/pages/swaps/searchable-item-list/__snapshots__/searchable-item-list.test.js.snap +++ b/ui/pages/swaps/searchable-item-list/__snapshots__/searchable-item-list.test.js.snap @@ -41,11 +41,15 @@ exports[`SearchableItemList renders the component with initial props 2`] = ` class="searchable-item-list__item searchable-item-list__item--selected" tabindex="0" > - primaryLabel +
+ primaryLabel +
diff --git a/ui/pages/swaps/searchable-item-list/item-list/__snapshots__/item-list.component.test.js.snap b/ui/pages/swaps/searchable-item-list/item-list/__snapshots__/item-list.component.test.js.snap new file mode 100644 index 000000000..e69de29bb diff --git a/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap b/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap index c0c5a47b6..87a895865 100644 --- a/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap +++ b/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap @@ -11,11 +11,15 @@ exports[`ViewQuote renders the component with EIP-1559 enabled 1`] = ` > 10 - DAI +
+ DAI +
10 - DAI +
+ DAI +