From e37e570b2eb80871e85c5851ab55793d9d0b8a34 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Mon, 26 Jun 2023 11:13:26 -0500 Subject: [PATCH] Fix #847 - Don't show account address on token pages (#19740) Co-authored-by: Nidhi Kumari --- .../app/wallet-overview/eth-overview.js | 8 +++----- .../app/wallet-overview/token-overview.js | 1 + .../app/wallet-overview/wallet-overview.js | 20 +++++++++++-------- ui/pages/asset/components/native-asset.js | 2 +- ui/pages/home/home.component.js | 3 ++- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ui/components/app/wallet-overview/eth-overview.js b/ui/components/app/wallet-overview/eth-overview.js index e5726f2d8..4cafa0514 100644 --- a/ui/components/app/wallet-overview/eth-overview.js +++ b/ui/components/app/wallet-overview/eth-overview.js @@ -49,7 +49,7 @@ import useRamps from '../../../hooks/experiences/useRamps'; import { getPortfolioUrl } from '../../../helpers/utils/portfolio'; import WalletOverview from './wallet-overview'; -const EthOverview = ({ className }) => { +const EthOverview = ({ className, showAddress }) => { const dispatch = useDispatch(); const t = useContext(I18nContext); const trackEvent = useContext(MetaMetricsContext); @@ -121,6 +121,7 @@ const EthOverview = ({ className }) => { return ( { EthOverview.propTypes = { className: PropTypes.string, -}; - -EthOverview.defaultProps = { - className: undefined, + showAddress: PropTypes.bool, }; export default EthOverview; diff --git a/ui/components/app/wallet-overview/token-overview.js b/ui/components/app/wallet-overview/token-overview.js index 7593ad72f..0820c946a 100644 --- a/ui/components/app/wallet-overview/token-overview.js +++ b/ui/components/app/wallet-overview/token-overview.js @@ -83,6 +83,7 @@ const TokenOverview = ({ className, token }) => { return (
diff --git a/ui/components/app/wallet-overview/wallet-overview.js b/ui/components/app/wallet-overview/wallet-overview.js index a56f8b8d8..f24957954 100644 --- a/ui/components/app/wallet-overview/wallet-overview.js +++ b/ui/components/app/wallet-overview/wallet-overview.js @@ -7,15 +7,22 @@ import { getSelectedIdentity } from '../../../selectors'; import { AddressCopyButton } from '../../multichain'; import Box from '../../ui/box/box'; -const WalletOverview = ({ balance, buttons, className }) => { +const WalletOverview = ({ + balance, + buttons, + className, + showAddress = false, +}) => { const selectedIdentity = useSelector(getSelectedIdentity); const checksummedAddress = toChecksumHexAddress(selectedIdentity?.address); return (
- - - + {showAddress ? ( + + + + ) : null} {balance}
{buttons}
@@ -27,10 +34,7 @@ WalletOverview.propTypes = { balance: PropTypes.element.isRequired, buttons: PropTypes.element.isRequired, className: PropTypes.string, -}; - -WalletOverview.defaultProps = { - className: undefined, + showAddress: PropTypes.bool, }; export default WalletOverview; diff --git a/ui/pages/asset/components/native-asset.js b/ui/pages/asset/components/native-asset.js index 0d5d6f98b..851b88b39 100644 --- a/ui/pages/asset/components/native-asset.js +++ b/ui/pages/asset/components/native-asset.js @@ -64,7 +64,7 @@ export default function NativeAsset({ nativeCurrency }) { /> } /> - + ); diff --git a/ui/pages/home/home.component.js b/ui/pages/home/home.component.js index 9263dff65..52d8b1be9 100644 --- a/ui/pages/home/home.component.js +++ b/ui/pages/home/home.component.js @@ -778,12 +778,13 @@ export default class Home extends PureComponent {
{ ///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask) - + ///: END:ONLY_INCLUDE_IN } { ///: BEGIN:ONLY_INCLUDE_IN(build-mmi)