From 66015b891e109707c4ecec3b937b8645f3204f96 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 3 Sep 2024 18:27:24 +0200 Subject: [PATCH 01/68] feat: add new setting and remove useNativeCurrencyAsPrimaryCurrency setting --- app/_locales/en/messages.json | 5 +- app/scripts/constants/sentry-state.ts | 1 + app/scripts/controllers/metametrics.js | 2 + app/scripts/controllers/preferences.js | 1 + shared/constants/metametrics.ts | 5 + shared/modules/currency-display.utils.test.ts | 8 +- shared/modules/currency-display.utils.ts | 8 +- .../app/assets/asset-list/asset-list.js | 18 ++- .../app/confirm/info/row/currency.tsx | 2 +- .../cancel-transaction-gas-fee.component.js | 4 +- .../transaction-breakdown.component.js | 22 ++- ...referenced-currency-display.component.d.ts | 1 + ...-preferenced-currency-display.component.js | 3 + ...er-preferenced-currency-input.component.js | 14 +- ...er-preferenced-currency-input.container.js | 4 - .../user-preferenced-token-input.component.js | 12 +- .../user-preferenced-token-input.container.js | 9 +- .../app/wallet-overview/coin-overview.tsx | 45 +----- .../app/wallet-overview/eth-overview.test.js | 2 +- ...teractive-replacement-token-modal.test.tsx | 4 +- ...ve-replacement-token-notification.test.tsx | 4 +- .../account-list-item/account-list-item.js | 4 +- .../asset-balance/asset-balance-text.test.tsx | 1 - .../asset-picker-modal/AssetList.tsx | 12 +- .../nft-input/nft-input.test.tsx | 9 +- .../swappable-currency-input.test.tsx | 10 +- .../asset-picker-amount/utils.test.ts | 30 +--- .../multichain/asset-picker-amount/utils.ts | 18 +-- .../multichain/pages/send/send.test.js | 1 - .../token-list-item/token-list-item.test.js | 10 +- ui/components/ui/dropdown/dropdown.scss | 4 +- ui/hooks/useTransactionDisplayData.test.js | 1 - ui/hooks/useUserPreferencedCurrency.js | 21 ++- ui/hooks/useUserPreferencedCurrency.test.js | 137 +++++++++++------- ui/pages/asset/components/asset-page.test.tsx | 4 +- .../confirm-decrypt-message.component.js | 1 + .../confirm-decrypt-message.container.js | 9 +- ...confirm-encryption-public-key.component.js | 1 + ...confirm-encryption-public-key.container.js | 9 +- .../confirm-gas-display.test.js.snap | 4 +- .../confirm-legacy-gas-display.js | 6 +- .../confirm-legacy-gas-display.test.js | 3 - .../confirm-detail-row.component.test.js | 4 +- .../confirm-subtitle/confirm-subtitle.js | 1 - .../edit-gas-fees-row/edit-gas-fees-row.tsx | 12 +- .../info/shared/gas-fees-row/gas-fees-row.tsx | 11 +- .../fee-details-component.js | 11 +- .../gas-details-item/gas-details-item.js | 8 +- .../gas-details-item/gas-details-item.test.js | 4 +- .../signature-request-header.js | 9 +- .../signature-request.test.js | 4 +- .../confirm-approve-content.component.js | 5 +- .../confirm-approve-content.component.test.js | 4 +- .../confirm-approve/confirm-approve.js | 5 - .../confirm-transaction-base.test.js.snap | 14 +- .../confirm-transaction-base.component.js | 14 +- .../confirm-transaction-base.container.js | 3 - .../confirm-transaction-base.test.js | 4 +- .../send/gas-display/gas-display.js | 10 +- .../confirm-add-custodian-token.test.tsx | 8 +- .../confirm-connect-custodian-modal.test.tsx | 4 +- .../institutional/custody/custody.test.tsx | 4 +- ui/pages/settings/index.scss | 17 ++- .../settings-tab/settings-tab.component.js | 123 ++++++++++++---- .../settings-tab/settings-tab.container.js | 16 +- .../settings-tab/settings-tab.test.js | 19 ++- ui/store/actions.ts | 4 + 67 files changed, 384 insertions(+), 403 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b179af364c9a..68d439a784f1 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1320,7 +1320,7 @@ "message": "CryptoCompare" }, "currencyConversion": { - "message": "Currency conversion" + "message": "Currency" }, "currencyRateCheckToggle": { "message": "Show balance and token price checker" @@ -4787,6 +4787,9 @@ "showMore": { "message": "Show more" }, + "showNativeTokenAsMainBalance": { + "message": "Show native token as main balance" + }, "showNft": { "message": "Show NFT" }, diff --git a/app/scripts/constants/sentry-state.ts b/app/scripts/constants/sentry-state.ts index df0238210d96..557a03427b5c 100644 --- a/app/scripts/constants/sentry-state.ts +++ b/app/scripts/constants/sentry-state.ts @@ -221,6 +221,7 @@ export const SENTRY_BACKGROUND_STATE = { showTestNetworks: true, smartTransactionsOptInStatus: true, useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: false, petnamesEnabled: true, showConfirmationAdvancedDetails: true, }, diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 8aafa0893d53..1ba6a8e401ab 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -821,6 +821,8 @@ export default class MetaMetricsController { metamaskState.useTokenDetection, [MetaMetricsUserTrait.UseNativeCurrencyAsPrimaryCurrency]: metamaskState.useNativeCurrencyAsPrimaryCurrency, + [MetaMetricsUserTrait.ShowNativeTokenAsMainBalance]: + metamaskState.showNativeTokenAsMainBalance, ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) [MetaMetricsUserTrait.MmiExtensionId]: this.extension?.runtime?.id, [MetaMetricsUserTrait.MmiAccountAddress]: mmiAccountAddress, diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 677761cd2ef5..49a3f6e147e6 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -88,6 +88,7 @@ export default class PreferencesController { showTestNetworks: false, smartTransactionsOptInStatus: null, // null means we will show the Smart Transactions opt-in modal to a user if they are eligible useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: false, hideZeroBalanceTokens: false, petnamesEnabled: true, redesignedConfirmationsEnabled: true, diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 7cbbefe23e64..13806e026985 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -449,6 +449,10 @@ export enum MetaMetricsUserTrait { * Identified when the user enables native currency. */ UseNativeCurrencyAsPrimaryCurrency = 'use_native_currency_as_primary_currency', + /** + * Identified when show native token as main balance is toggled. + */ + ShowNativeTokenAsMainBalance = 'show_native_token_as_main_balance', /** * Identified when the security provider feature is enabled. */ @@ -623,6 +627,7 @@ export enum MetaMetricsEventName { TokenImportCanceled = 'Token Import Canceled', TokenImportClicked = 'Token Import Clicked', UseNativeCurrencyAsPrimaryCurrency = 'Use Native Currency as Primary Currency', + ShowNativeTokenAsMainBalance = 'Show native token as main balance', WalletSetupStarted = 'Wallet Setup Selected', WalletSetupCanceled = 'Wallet Setup Canceled', WalletSetupFailed = 'Wallet Setup Failed', diff --git a/shared/modules/currency-display.utils.test.ts b/shared/modules/currency-display.utils.test.ts index b2fdbc456593..fa28f89966b4 100644 --- a/shared/modules/currency-display.utils.test.ts +++ b/shared/modules/currency-display.utils.test.ts @@ -4,7 +4,7 @@ import { } from './currency-display.utils'; describe('showPrimaryCurrency', () => { - it('should return true when useNativeCurrencyAsPrimaryCurrency is true', () => { + it('should return true when showNativeTokenAsMainBalance is true', () => { const result = showPrimaryCurrency(true, true); expect(result).toBe(true); }); @@ -14,14 +14,14 @@ describe('showPrimaryCurrency', () => { expect(result).toBe(true); }); - it('should return false when useNativeCurrencyAsPrimaryCurrency and isOriginalNativeSymbol are false', () => { + it('should return false when showNativeTokenAsMainBalance and isOriginalNativeSymbol are false', () => { const result = showPrimaryCurrency(false, false); expect(result).toBe(false); }); }); describe('showSecondaryCurrency', () => { - it('should return true when useNativeCurrencyAsPrimaryCurrency is false', () => { + it('should return true when showNativeTokenAsMainBalance is false', () => { const result = showSecondaryCurrency(true, false); expect(result).toBe(true); }); @@ -31,7 +31,7 @@ describe('showSecondaryCurrency', () => { expect(result).toBe(true); }); - it('should return false when useNativeCurrencyAsPrimaryCurrency is true and isOriginalNativeSymbol is false', () => { + it('should return false when showNativeTokenAsMainBalance is true and isOriginalNativeSymbol is false', () => { const result = showSecondaryCurrency(false, true); expect(result).toBe(false); }); diff --git a/shared/modules/currency-display.utils.ts b/shared/modules/currency-display.utils.ts index 3f50a2364e6d..28ee5ae9f7b9 100644 --- a/shared/modules/currency-display.utils.ts +++ b/shared/modules/currency-display.utils.ts @@ -1,9 +1,9 @@ export const showPrimaryCurrency = ( isOriginalNativeSymbol: boolean, - useNativeCurrencyAsPrimaryCurrency: boolean, + showNativeTokenAsMainBalance: boolean, ): boolean => { // crypto is the primary currency in this case , so we have to display it always - if (useNativeCurrencyAsPrimaryCurrency) { + if (showNativeTokenAsMainBalance) { return true; } // if the primary currency corresponds to a fiat value, check that the symbol is correct. @@ -16,10 +16,10 @@ export const showPrimaryCurrency = ( export const showSecondaryCurrency = ( isOriginalNativeSymbol: boolean, - useNativeCurrencyAsPrimaryCurrency: boolean, + showNativeTokenAsMainBalance: boolean, ): boolean => { // crypto is the secondary currency in this case , so we have to display it always - if (!useNativeCurrencyAsPrimaryCurrency) { + if (!showNativeTokenAsMainBalance) { return true; } // if the secondary currency corresponds to a fiat value, check that the symbol is correct. diff --git a/ui/components/app/assets/asset-list/asset-list.js b/ui/components/app/assets/asset-list/asset-list.js index 81c70d433dc9..0dfa0f597dd0 100644 --- a/ui/components/app/assets/asset-list/asset-list.js +++ b/ui/components/app/assets/asset-list/asset-list.js @@ -56,7 +56,7 @@ const AssetList = ({ onClickAsset, showTokensLinks }) => { const nativeCurrency = useSelector(getMultichainNativeCurrency); const showFiat = useSelector(getMultichainShouldShowFiat); const isMainnet = useSelector(getMultichainIsMainnet); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); + const { showNativeTokenAsMainBalance } = useSelector(getPreferences); const { chainId, ticker, type, rpcUrl } = useSelector( getMultichainCurrentNetwork, ); @@ -77,11 +77,17 @@ const AssetList = ({ onClickAsset, showTokensLinks }) => { const { currency: primaryCurrency, numberOfDecimals: primaryNumberOfDecimals, - } = useUserPreferencedCurrency(PRIMARY, { ethNumberOfDecimals: 4 }); + } = useUserPreferencedCurrency(PRIMARY, { + ethNumberOfDecimals: 4, + withCheckShowNativeToken: true, + }); const { currency: secondaryCurrency, numberOfDecimals: secondaryNumberOfDecimals, - } = useUserPreferencedCurrency(SECONDARY, { ethNumberOfDecimals: 4 }); + } = useUserPreferencedCurrency(SECONDARY, { + ethNumberOfDecimals: 4, + withCheckShowNativeToken: true, + }); const [primaryCurrencyDisplay, primaryCurrencyProperties] = useCurrencyDisplay(balance, { @@ -163,13 +169,13 @@ const AssetList = ({ onClickAsset, showTokensLinks }) => { primary={ showSecondaryCurrency( isOriginalNativeSymbol, - useNativeCurrencyAsPrimaryCurrency, + showNativeTokenAsMainBalance, ) ? secondaryCurrencyDisplay : undefined } tokenSymbol={ - useNativeCurrencyAsPrimaryCurrency + showNativeTokenAsMainBalance ? primaryCurrencyProperties.suffix : secondaryCurrencyProperties.suffix } @@ -177,7 +183,7 @@ const AssetList = ({ onClickAsset, showTokensLinks }) => { showFiat && showPrimaryCurrency( isOriginalNativeSymbol, - useNativeCurrencyAsPrimaryCurrency, + showNativeTokenAsMainBalance, ) ? primaryCurrencyDisplay : undefined diff --git a/ui/components/app/confirm/info/row/currency.tsx b/ui/components/app/confirm/info/row/currency.tsx index 82ce82c3a113..a799d1bda712 100644 --- a/ui/components/app/confirm/info/row/currency.tsx +++ b/ui/components/app/confirm/info/row/currency.tsx @@ -38,7 +38,7 @@ export const ConfirmInfoRowCurrency = ({ {currency ? ( ) : ( - + )} ); diff --git a/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js b/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js index 02583b0298e4..d6b8f3f184c8 100644 --- a/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js +++ b/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js @@ -16,12 +16,12 @@ export default class CancelTransaction extends PureComponent { ); diff --git a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js index 704ceca4c9fc..58cfd6d3c181 100644 --- a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js +++ b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js @@ -189,12 +189,12 @@ export default class TransactionBreakdown extends PureComponent { denomination={EtherDenomination.ETH} numberOfDecimals={6} value={hexGasTotal} - type={PRIMARY} + showNative /> {showFiat && ( )} @@ -211,12 +211,14 @@ export default class TransactionBreakdown extends PureComponent { denomination={EtherDenomination.ETH} numberOfDecimals={9} value={maxFeePerGas} - type={PRIMARY} + //type={PRIMARY} + showNative /> {showFiat && ( )} @@ -229,12 +231,14 @@ export default class TransactionBreakdown extends PureComponent { data-testid="transaction-breakdown__l1-gas-total" numberOfDecimals={18} value={l1HexGasTotal} - type={PRIMARY} + // type={PRIMARY} + showNative /> {showFiat && ( )} @@ -243,14 +247,16 @@ export default class TransactionBreakdown extends PureComponent { {showFiat && ( )} diff --git a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts index 9e4ca5565733..a2bab969e9cc 100644 --- a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts +++ b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts @@ -12,6 +12,7 @@ export type UserPrefrencedCurrencyDisplayProps = OverridingUnion< showFiat?: boolean; showNative?: boolean; showCurrencySuffix?: boolean; + withCheckShowNativeToken?: boolean; } >; diff --git a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js index 294e6063f0ad..e47cc83f1202 100644 --- a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js +++ b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js @@ -25,6 +25,7 @@ export default function UserPreferencedCurrencyDisplay({ showFiat, showNative, showCurrencySuffix, + withCheckShowNativeToken, ...restProps }) { const currentNetwork = useMultichainSelector( @@ -42,6 +43,7 @@ export default function UserPreferencedCurrencyDisplay({ numberOfDecimals: propsNumberOfDecimals, showFiatOverride: showFiat, showNativeOverride: showNative, + withCheckShowNativeToken, }); const prefixComponent = useMemo(() => { return ( @@ -112,6 +114,7 @@ const UserPreferencedCurrencyDisplayPropTypes = { prefixComponentWrapperProps: PropTypes.object, textProps: PropTypes.object, suffixProps: PropTypes.object, + withCheckShowNativeToken: PropTypes.bool, }; UserPreferencedCurrencyDisplay.propTypes = diff --git a/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.component.js b/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.component.js index 70b232848d16..7e34a90bba27 100644 --- a/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.component.js +++ b/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.component.js @@ -2,27 +2,21 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import CurrencyInput from '../currency-input'; +// Noticed this component is not used in codebase; +// removing usage of useNativeCurrencyAsPrimaryCurrency because its being removed in this PR export default class UserPreferencedCurrencyInput extends PureComponent { static propTypes = { - useNativeCurrencyAsPrimaryCurrency: PropTypes.bool, sendInputCurrencySwitched: PropTypes.bool, ...CurrencyInput.propTypes, }; render() { - const { - useNativeCurrencyAsPrimaryCurrency, - sendInputCurrencySwitched, - ...restProps - } = this.props; + const { sendInputCurrencySwitched, ...restProps } = this.props; return ( ); } diff --git a/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js b/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js index 042b73c249ae..7bec54e5dd8f 100644 --- a/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js +++ b/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js @@ -1,13 +1,9 @@ import { connect } from 'react-redux'; import { toggleCurrencySwitch } from '../../../ducks/app/app'; -import { getPreferences } from '../../../selectors'; import UserPreferencedCurrencyInput from './user-preferenced-currency-input.component'; const mapStateToProps = (state) => { - const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state); - return { - useNativeCurrencyAsPrimaryCurrency, sendInputCurrencySwitched: state.appState.sendInputCurrencySwitched, }; }; diff --git a/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.component.js b/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.component.js index a285446100ed..ee8178664564 100644 --- a/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.component.js +++ b/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.component.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import TokenInput from '../../ui/token-input'; import { getTokenSymbol } from '../../../store/actions'; +// This component is not used in codebase, removing usage of useNativeCurrencyAsPrimaryCurrency in this PR export default class UserPreferencedTokenInput extends PureComponent { static propTypes = { token: PropTypes.shape({ @@ -10,7 +11,6 @@ export default class UserPreferencedTokenInput extends PureComponent { decimals: PropTypes.number, symbol: PropTypes.string, }).isRequired, - useNativeCurrencyAsPrimaryCurrency: PropTypes.bool, }; state = { @@ -28,16 +28,10 @@ export default class UserPreferencedTokenInput extends PureComponent { } render() { - const { useNativeCurrencyAsPrimaryCurrency, ...restProps } = this.props; + const { ...restProps } = this.props; return ( - + ); } } diff --git a/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js b/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js index 33afd8ce24a4..03c0c5eda7bf 100644 --- a/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js +++ b/ui/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js @@ -1,15 +1,8 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; -import { getPreferences } from '../../../selectors'; import UserPreferencedTokenInput from './user-preferenced-token-input.component'; -const mapStateToProps = (state) => { - const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state); - - return { - useNativeCurrencyAsPrimaryCurrency, - }; -}; +const mapStateToProps = (state) => state; const UserPreferencedTokenInputContainer = connect(mapStateToProps)( UserPreferencedTokenInput, diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 547ef107b05d..0089f06df142 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -15,26 +15,20 @@ import { getPortfolioUrl } from '../../../helpers/utils/portfolio'; import { I18nContext } from '../../../contexts/i18n'; import Tooltip from '../../ui/tooltip'; import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display'; -import { PRIMARY, SECONDARY } from '../../../helpers/constants/common'; +import { PRIMARY } from '../../../helpers/constants/common'; import { getDataCollectionForMarketing, getMetaMetricsId, getParticipateInMetaMetrics, - getPreferences, getTokensMarketData, ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) SwapsEthToken, ///: END:ONLY_INCLUDE_IF } from '../../../selectors'; import Spinner from '../../ui/spinner'; -import { useIsOriginalNativeTokenSymbol } from '../../../hooks/useIsOriginalNativeTokenSymbol'; -import { showPrimaryCurrency } from '../../../../shared/modules/currency-display.utils'; + import { PercentageAndAmountChange } from '../../multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change'; -import { - getMultichainIsEvm, - getMultichainProviderConfig, - getMultichainShouldShowFiat, -} from '../../../selectors/multichain'; +import { getMultichainIsEvm } from '../../../selectors/multichain'; import WalletOverview from './wallet-overview'; import CoinButtons from './coin-buttons'; @@ -83,15 +77,7 @@ export const CoinOverview = ({ const isMarketingEnabled = useSelector(getDataCollectionForMarketing); const isEvm = useSelector(getMultichainIsEvm); - const showFiat = useSelector(getMultichainShouldShowFiat); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); - const { ticker, type, rpcUrl } = useSelector(getMultichainProviderConfig); - const isOriginalNativeSymbol = useIsOriginalNativeTokenSymbol( - chainId, - ticker, - type, - rpcUrl, - ); + const tokensMarketData = useSelector(getTokensMarketData); const handlePortfolioOnClick = useCallback(() => { @@ -143,16 +129,10 @@ export const CoinOverview = ({ )} data-testid={`${classPrefix}-overview__primary-currency`} value={balance} - type={ - showPrimaryCurrency( - isOriginalNativeSymbol, - useNativeCurrencyAsPrimaryCurrency, - ) - ? PRIMARY - : SECONDARY - } + type={PRIMARY} ethNumberOfDecimals={4} hideTitle + withCheckShowNativeToken /> ) : ( @@ -163,19 +143,6 @@ export const CoinOverview = ({ )} - {showFiat && isOriginalNativeSymbol && balance && ( - - )} {isEvm && ( { }, }, preferences: { - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, }, useExternalServices: true, useCurrencyRateCheck: true, diff --git a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.test.tsx b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.test.tsx index 535b21f2e69b..97eaa364f104 100644 --- a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.test.tsx +++ b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.test.tsx @@ -48,9 +48,7 @@ describe('Interactive Replacement Token Modal', function () { oldRefreshToken: 'abc', url: 'https://saturn-custody-ui.dev.metamask-institutional.io', }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, }, }; diff --git a/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.test.tsx b/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.test.tsx index 77424a95e86e..4c132ecbd414 100644 --- a/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.test.tsx +++ b/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.test.tsx @@ -72,9 +72,7 @@ describe('Interactive Replacement Token Notification', () => { }, isUnlocked: false, interactiveReplacementToken: { oldRefreshToken: 'abc' }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, keyrings: [ { type: KeyringType.imported, diff --git a/ui/components/multichain/account-list-item/account-list-item.js b/ui/components/multichain/account-list-item/account-list-item.js index 0991b77c3b29..24ae32e1a3c3 100644 --- a/ui/components/multichain/account-list-item/account-list-item.js +++ b/ui/components/multichain/account-list-item/account-list-item.js @@ -306,7 +306,7 @@ const AccountListItem = ({ account={account} ethNumberOfDecimals={MAXIMUM_CURRENCY_DECIMALS} value={balanceToTranslate} - type={PRIMARY} + //type={PRIMARY} showFiat={showFiat} data-testid="first-currency-display" /> @@ -353,7 +353,7 @@ const AccountListItem = ({ account={account} ethNumberOfDecimals={MAXIMUM_CURRENCY_DECIMALS} value={account.balance} - type={SECONDARY} + //type={SECONDARY} showNative data-testid="second-currency-display" /> diff --git a/ui/components/multichain/asset-picker-amount/asset-balance/asset-balance-text.test.tsx b/ui/components/multichain/asset-picker-amount/asset-balance/asset-balance-text.test.tsx index 6613bf785b91..be9d58f23968 100644 --- a/ui/components/multichain/asset-picker-amount/asset-balance/asset-balance-text.test.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-balance/asset-balance-text.test.tsx @@ -11,7 +11,6 @@ const store = configureStore({ ...mockSendState, metamask: { ...mockSendState.metamask, - preferences: { useNativeCurrencyAsPrimaryCurrency: true }, }, appState: { ...mockSendState.appState, sendInputCurrencySwitched: false }, }); diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx index 1ea66e917437..9061592cf37c 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx @@ -1,10 +1,7 @@ import React from 'react'; import { useSelector } from 'react-redux'; import classnames from 'classnames'; -import { - getPreferences, - getSelectedAccountCachedBalance, -} from '../../../../selectors'; +import { getSelectedAccountCachedBalance } from '../../../../selectors'; import { getNativeCurrency } from '../../../../ducks/metamask/metamask'; import { useUserPreferencedCurrency } from '../../../../hooks/useUserPreferencedCurrency'; import { PRIMARY, SECONDARY } from '../../../../helpers/constants/common'; @@ -46,7 +43,6 @@ export default function AssetList({ const nativeCurrency = useSelector(getNativeCurrency); const balanceValue = useSelector(getSelectedAccountCachedBalance); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); const { currency: primaryCurrency, @@ -121,11 +117,7 @@ export default function AssetList({ primaryCurrencyProperties.value ?? secondaryCurrencyProperties.value } - tokenSymbol={ - useNativeCurrencyAsPrimaryCurrency - ? primaryCurrency - : secondaryCurrency - } + tokenSymbol={primaryCurrency} secondary={secondaryCurrencyDisplay} tokenImage={token.image} isOriginalTokenSymbol diff --git a/ui/components/multichain/asset-picker-amount/nft-input/nft-input.test.tsx b/ui/components/multichain/asset-picker-amount/nft-input/nft-input.test.tsx index 05289c604aa3..08e4875ce149 100644 --- a/ui/components/multichain/asset-picker-amount/nft-input/nft-input.test.tsx +++ b/ui/components/multichain/asset-picker-amount/nft-input/nft-input.test.tsx @@ -5,15 +5,11 @@ import mockSendState from '../../../../../test/data/mock-send-state.json'; import configureStore from '../../../../store/store'; import { NFTInput } from './nft-input'; -const createStore = ({ - useNativeCurrencyAsPrimaryCurrency, - sendInputCurrencySwitched, -}: Record) => +const createStore = ({ sendInputCurrencySwitched }: Record) => configureStore({ ...mockSendState, metamask: { ...mockSendState.metamask, - preferences: { useNativeCurrencyAsPrimaryCurrency }, }, appState: { ...mockSendState.appState, sendInputCurrencySwitched }, }); @@ -25,7 +21,6 @@ describe('NFTInput', () => { const { asFragment } = render( @@ -39,7 +34,6 @@ describe('NFTInput', () => { const { getByTestId } = render( @@ -56,7 +50,6 @@ describe('NFTInput', () => { const { queryByTestId } = render( diff --git a/ui/components/multichain/asset-picker-amount/swappable-currency-input/swappable-currency-input.test.tsx b/ui/components/multichain/asset-picker-amount/swappable-currency-input/swappable-currency-input.test.tsx index 693361354f91..8dadccbaf247 100644 --- a/ui/components/multichain/asset-picker-amount/swappable-currency-input/swappable-currency-input.test.tsx +++ b/ui/components/multichain/asset-picker-amount/swappable-currency-input/swappable-currency-input.test.tsx @@ -6,15 +6,11 @@ import mockSendState from '../../../../../test/data/mock-send-state.json'; import configureStore from '../../../../store/store'; import { SwappableCurrencyInput } from './swappable-currency-input'; -const createStore = ({ - useNativeCurrencyAsPrimaryCurrency, - sendInputCurrencySwitched, -}: Record) => +const createStore = ({ sendInputCurrencySwitched }: Record) => configureStore({ ...mockSendState, metamask: { ...mockSendState.metamask, - preferences: { useNativeCurrencyAsPrimaryCurrency }, marketData: { ...mockSendState.metamask.marketData, '0x5': { @@ -37,7 +33,6 @@ describe('SwappableCurrencyInput', () => { const { asFragment, getByText } = render( @@ -68,7 +63,6 @@ describe('SwappableCurrencyInput', () => { const { asFragment, getByText } = render( @@ -101,7 +95,6 @@ describe('SwappableCurrencyInput', () => { const { asFragment } = render( @@ -134,7 +127,6 @@ describe('SwappableCurrencyInput', () => { const { asFragment } = render( diff --git a/ui/components/multichain/asset-picker-amount/utils.test.ts b/ui/components/multichain/asset-picker-amount/utils.test.ts index 91f25dc33d15..c83fe3db797b 100644 --- a/ui/components/multichain/asset-picker-amount/utils.test.ts +++ b/ui/components/multichain/asset-picker-amount/utils.test.ts @@ -2,23 +2,18 @@ import configureStore from '../../../store/store'; import mockSendState from '../../../../test/data/mock-send-state.json'; import { getIsFiatPrimary } from './utils'; -const createStore = ({ - useNativeCurrencyAsPrimaryCurrency, - sendInputCurrencySwitched, -}: Record) => +const createStore = ({ sendInputCurrencySwitched }: Record) => configureStore({ ...mockSendState, metamask: { ...mockSendState.metamask, - preferences: { useNativeCurrencyAsPrimaryCurrency }, }, appState: { ...mockSendState.appState, sendInputCurrencySwitched }, }); describe('getIsFiatPrimary selector', () => { - it('returns true when useNativeCurrencyAsPrimaryCurrency and sendInputCurrencySwitched are both true', () => { + it('returns true when sendInputCurrencySwitched is true', () => { const store = createStore({ - useNativeCurrencyAsPrimaryCurrency: true, sendInputCurrencySwitched: true, }); @@ -26,30 +21,11 @@ describe('getIsFiatPrimary selector', () => { expect(getIsFiatPrimary(state as never)).toBe(true); }); - it('returns true when useNativeCurrencyAsPrimaryCurrency and sendInputCurrencySwitched are both false', () => { + it('returns false when sendInputCurrencySwitched is false', () => { const store = createStore({ - useNativeCurrencyAsPrimaryCurrency: false, sendInputCurrencySwitched: false, }); const state = store.getState(); - expect(getIsFiatPrimary(state as never)).toBe(true); - }); - - it('returns false when useNativeCurrencyAsPrimaryCurrency and sendInputCurrencySwitched have different values', () => { - let store = createStore({ - useNativeCurrencyAsPrimaryCurrency: true, - sendInputCurrencySwitched: false, - }); - - let state = store.getState(); - expect(getIsFiatPrimary(state as never)).toBe(false); - - store = createStore({ - useNativeCurrencyAsPrimaryCurrency: false, - sendInputCurrencySwitched: true, - }); - - state = store.getState(); expect(getIsFiatPrimary(state as never)).toBe(false); }); }); diff --git a/ui/components/multichain/asset-picker-amount/utils.ts b/ui/components/multichain/asset-picker-amount/utils.ts index 664cba0d71f5..afb9927f8646 100644 --- a/ui/components/multichain/asset-picker-amount/utils.ts +++ b/ui/components/multichain/asset-picker-amount/utils.ts @@ -1,17 +1,13 @@ import { createSelector } from 'reselect'; -export const getIsFiatPrimary = createSelector( - (state: { - metamask: { preferences: { useNativeCurrencyAsPrimaryCurrency: boolean } }; - appState: { sendInputCurrencySwitched: boolean }; - }) => state.metamask.preferences, - (state) => state.appState.sendInputCurrencySwitched, - ({ useNativeCurrencyAsPrimaryCurrency }, sendInputCurrencySwitched) => { - const isFiatPrimary = Boolean( - (useNativeCurrencyAsPrimaryCurrency && sendInputCurrencySwitched) || - (!useNativeCurrencyAsPrimaryCurrency && !sendInputCurrencySwitched), - ); +function getSendInputCurrencySwitched(state) { + return state.appState.sendInputCurrencySwitched; +} +export const getIsFiatPrimary = createSelector( + getSendInputCurrencySwitched, + (sendInputCurrencySwitched) => { + const isFiatPrimary = Boolean(sendInputCurrencySwitched); return isFiatPrimary; }, ); diff --git a/ui/components/multichain/pages/send/send.test.js b/ui/components/multichain/pages/send/send.test.js index 164fe2b8bb3c..1b6c895380dd 100644 --- a/ui/components/multichain/pages/send/send.test.js +++ b/ui/components/multichain/pages/send/send.test.js @@ -167,7 +167,6 @@ const baseStore = { }), tokens: [], preferences: { - useNativeCurrencyAsPrimaryCurrency: false, showFiatInTestnets: true, }, currentCurrency: 'USD', diff --git a/ui/components/multichain/token-list-item/token-list-item.test.js b/ui/components/multichain/token-list-item/token-list-item.test.js index d62284c6fb19..795514d866c6 100644 --- a/ui/components/multichain/token-list-item/token-list-item.test.js +++ b/ui/components/multichain/token-list-item/token-list-item.test.js @@ -13,9 +13,7 @@ const state = { ...mockNetworkState({ chainId: CHAIN_IDS.MAINNET }), useTokenDetection: false, currencyRates: {}, - preferences: { - useNativeCurrencyAsPrimaryCurrency: false, - }, + preferences: {}, internalAccounts: { accounts: { 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3': { @@ -107,12 +105,10 @@ describe('TokenListItem', () => { expect(getByText('This is a potential scam')).toBeInTheDocument(); }); - it('should render crypto balance if useNativeCurrencyAsPrimaryCurrency is false', () => { + it('should render crypto balance', () => { const store = configureMockStore()({ ...state, - preferences: { - useNativeCurrencyAsPrimaryCurrency: false, - }, + preferences: {}, }); const propsToUse = { primary: '11.9751 ETH', diff --git a/ui/components/ui/dropdown/dropdown.scss b/ui/components/ui/dropdown/dropdown.scss index e76d7936d303..53e06559b541 100644 --- a/ui/components/ui/dropdown/dropdown.scss +++ b/ui/components/ui/dropdown/dropdown.scss @@ -15,9 +15,9 @@ color: var(--color-text-default); border: 1px solid var(--color-border-default); - border-radius: 4px; + border-radius: 8px; background-color: var(--color-background-default); - padding: 8px 40px 8px 16px; + padding: 12px 40px 12px 16px; width: 100%; [dir='rtl'] & { diff --git a/ui/hooks/useTransactionDisplayData.test.js b/ui/hooks/useTransactionDisplayData.test.js index 55cb05c256b6..ff12975e581b 100644 --- a/ui/hooks/useTransactionDisplayData.test.js +++ b/ui/hooks/useTransactionDisplayData.test.js @@ -209,7 +209,6 @@ const renderHookWithRouter = (cb, tokenAddress) => { currentCurrency: 'ETH', useCurrencyRateCheck: false, // to force getShouldShowFiat to return false preferences: { - useNativeCurrencyAsPrimaryCurrency: true, getShowFiatInTestnets: false, }, allNfts: [], diff --git a/ui/hooks/useUserPreferencedCurrency.js b/ui/hooks/useUserPreferencedCurrency.js index 732d4ec726bb..d0c099b183c3 100644 --- a/ui/hooks/useUserPreferencedCurrency.js +++ b/ui/hooks/useUserPreferencedCurrency.js @@ -49,7 +49,7 @@ export function useUserPreferencedCurrency(type, opts = {}) { account, ); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector( + const { showNativeTokenAsMainBalance } = useSelector( getPreferences, shallowEqual, ); @@ -74,12 +74,21 @@ export function useUserPreferencedCurrency(type, opts = {}) { return nativeReturn; } else if (opts.showFiatOverride) { return fiatReturn; + } else if (!showFiat) { + return nativeReturn; } else if ( - !showFiat || - (type === PRIMARY && useNativeCurrencyAsPrimaryCurrency) || - (type === SECONDARY && !useNativeCurrencyAsPrimaryCurrency) + (opts.withCheckShowNativeToken && showNativeTokenAsMainBalance) || + !opts.withCheckShowNativeToken ) { - return nativeReturn; + return type === PRIMARY ? nativeReturn : fiatReturn; } - return fiatReturn; + return type === PRIMARY ? fiatReturn : nativeReturn; +} + +/* +if ((withCheck && showNat) || !withCheck) { + return primary ? native : fiat; +} else { + return primary ? fiat : native; } +*/ diff --git a/ui/hooks/useUserPreferencedCurrency.test.js b/ui/hooks/useUserPreferencedCurrency.test.js index c4818d9e980d..5a9a7fcdae21 100644 --- a/ui/hooks/useUserPreferencedCurrency.test.js +++ b/ui/hooks/useUserPreferencedCurrency.test.js @@ -8,16 +8,43 @@ import { mockNetworkState } from '../../test/stub/networks'; import { CHAIN_IDS } from '../../shared/constants/network'; import { useUserPreferencedCurrency } from './useUserPreferencedCurrency'; +const renderUseUserPreferencedCurrency = (state, value, restProps) => { + const defaultState = { + ...mockState, + metamask: { + ...mockState.metamask, + completedOnboarding: true, + ...mockNetworkState({ + chainId: state.showFiat ? CHAIN_IDS.MAINNET : CHAIN_IDS.LOCALHOST, + ticker: state?.nativeCurrency, + }), + currentCurrency: state.currentCurrency, + currencyRates: { ETH: { conversionRate: 280.45 } }, + preferences: { + showFiatInTestnets: state.showFiat, + showNativeTokenAsMainBalance: state.showNativeTokenAsMainBalance, + }, + }, + }; + + const wrapper = ({ children }) => ( + {children} + ); + + return renderHook(() => useUserPreferencedCurrency(value, restProps), { + wrapper, + }); +}; const tests = [ { state: { - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, nativeCurrency: 'ETH', showFiat: true, currentCurrency: 'usd', }, params: { - type: 'PRIMARY', + showNativeOverride: true, }, result: { currency: 'ETH', @@ -26,13 +53,13 @@ const tests = [ }, { state: { - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: true, nativeCurrency: 'ETH', showFiat: true, currentCurrency: 'usd', }, params: { - type: 'PRIMARY', + showFiatOverride: true, }, result: { currency: 'usd', @@ -41,45 +68,59 @@ const tests = [ }, { state: { - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, nativeCurrency: 'ETH', showFiat: true, + currentCurrency: 'usd', }, params: { - type: 'SECONDARY', - fiatNumberOfDecimals: 4, - fiatPrefix: '-', + type: 'PRIMARY', + withCheckShowNativeToken: true, }, result: { - currency: undefined, - numberOfDecimals: 4, + currency: 'ETH', + numberOfDecimals: 8, }, }, { state: { - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: false, nativeCurrency: 'ETH', showFiat: true, + currentCurrency: 'usd', }, params: { - type: 'SECONDARY', - fiatNumberOfDecimals: 4, - numberOfDecimals: 3, - fiatPrefix: 'a', + type: 'PRIMARY', }, result: { currency: 'ETH', - numberOfDecimals: 3, + numberOfDecimals: 8, + }, + }, + { + state: { + showNativeTokenAsMainBalance: false, + nativeCurrency: 'ETH', + showFiat: true, + currentCurrency: 'usd', + }, + params: { + type: 'SECONDARY', + }, + result: { + currency: 'usd', + numberOfDecimals: 2, }, }, { state: { - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: false, nativeCurrency: 'ETH', showFiat: false, + currentCurrency: 'usd', }, params: { - type: 'PRIMARY', + type: 'SECONDARY', }, result: { currency: 'ETH', @@ -88,66 +129,54 @@ const tests = [ }, { state: { - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: true, nativeCurrency: 'ETH', showFiat: true, + currentCurrency: 'usd', }, params: { type: 'PRIMARY', }, result: { - currency: undefined, + currency: 'ETH', + numberOfDecimals: 8, + }, + }, + { + state: { + showNativeTokenAsMainBalance: true, + nativeCurrency: 'ETH', + showFiat: true, + currentCurrency: 'usd', + }, + params: { + type: 'SECONDARY', + }, + result: { + currency: 'usd', numberOfDecimals: 2, }, }, { state: { - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: true, nativeCurrency: 'ETH', showFiat: true, + currentCurrency: 'usd', }, params: { - type: 'PRIMARY', + type: 'SECONDARY', + withCheckShowNativeToken: true, }, result: { - currency: undefined, + currency: 'usd', numberOfDecimals: 2, }, }, ]; - -const renderUseUserPreferencedCurrency = (state, value, restProps) => { - const defaultState = { - ...mockState, - metamask: { - ...mockState.metamask, - completedOnboarding: true, - ...mockNetworkState({ - chainId: state.showFiat ? CHAIN_IDS.MAINNET : CHAIN_IDS.LOCALHOST, - ticker: state?.nativeCurrency, - }), - currentCurrency: state.currentCurrency, - currencyRates: { ETH: { conversionRate: 280.45 } }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: - state.useNativeCurrencyAsPrimaryCurrency, - showFiatInTestnets: state.showFiat, - }, - }, - }; - - const wrapper = ({ children }) => ( - {children} - ); - - return renderHook(() => useUserPreferencedCurrency(value, restProps), { - wrapper, - }); -}; - describe('useUserPreferencedCurrency', () => { tests.forEach(({ params: { type, ...otherParams }, state, result }) => { - describe(`when showFiat is ${state.showFiat}, useNativeCurrencyAsPrimary is ${state.useNativeCurrencyAsPrimaryCurrency} and type is ${type}`, () => { + describe(`when showFiat is ${state.showFiat}, withCheckShowNativeToken is ${otherParams.withCheckShowNativeToken}, showNativeTokenAsMainBalance is ${state.showNativeTokenAsMainBalance} and type is ${type}`, () => { const { result: hookResult } = renderUseUserPreferencedCurrency( state, type, diff --git a/ui/pages/asset/components/asset-page.test.tsx b/ui/pages/asset/components/asset-page.test.tsx index bf616d0aaac9..35721a30a1c2 100644 --- a/ui/pages/asset/components/asset-page.test.tsx +++ b/ui/pages/asset/components/asset-page.test.tsx @@ -49,9 +49,7 @@ describe('AssetPage', () => { }, }, useCurrencyRateCheck: true, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, internalAccounts: { accounts: { 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3': { diff --git a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js index 99bcfaaf2042..69dc6c20b9dd 100644 --- a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js +++ b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js @@ -19,6 +19,7 @@ import { formatCurrency } from '../../helpers/utils/confirm-tx.util'; import { getValueFromWeiHex } from '../../../shared/modules/conversion.utils'; import { COPY_OPTIONS } from '../../../shared/constants/copy'; +// As of this PR; This component is is only used in a test file export default class ConfirmDecryptMessage extends Component { static contextTypes = { t: PropTypes.func.isRequired, diff --git a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js index fd6585381a27..88d7c8deb40b 100644 --- a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js +++ b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js @@ -10,9 +10,7 @@ import { decryptMsgInline, } from '../../store/actions'; import { - conversionRateSelector, getCurrentCurrency, - getPreferences, getTargetAccountWithSendEtherInfo, unconfirmedTransactionsListSelector, } from '../../selectors'; @@ -21,13 +19,12 @@ import { getMostRecentOverviewPage } from '../../ducks/history/history'; import { getNativeCurrency } from '../../ducks/metamask/metamask'; import ConfirmDecryptMessage from './confirm-decrypt-message.component'; +// ConfirmDecryptMessage component is not used in codebase, removing usage of useNativeCurrencyAsPrimaryCurrency function mapStateToProps(state) { const { metamask: { subjectMetadata = {} }, } = state; - const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state); - const unconfirmedTransactions = unconfirmedTransactionsListSelector(state); const txData = cloneDeep(unconfirmedTransactions[0]); @@ -43,9 +40,7 @@ function mapStateToProps(state) { fromAccount, requester: null, requesterAddress: null, - conversionRate: useNativeCurrencyAsPrimaryCurrency - ? null - : conversionRateSelector(state), + conversionRate: null, mostRecentOverviewPage: getMostRecentOverviewPage(state), nativeCurrency: getNativeCurrency(state), currentCurrency: getCurrentCurrency(state), diff --git a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js index 1595576a4fac..7d8302d2eecd 100644 --- a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js +++ b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js @@ -13,6 +13,7 @@ import { EtherDenomination } from '../../../shared/constants/common'; import { formatCurrency } from '../../helpers/utils/confirm-tx.util'; import { getValueFromWeiHex } from '../../../shared/modules/conversion.utils'; +// This component is only being used in stories and test file export default class ConfirmEncryptionPublicKey extends Component { static contextTypes = { t: PropTypes.func.isRequired, diff --git a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js index 489d7d088033..3eee79f72b90 100644 --- a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js +++ b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js @@ -9,10 +9,8 @@ import { } from '../../store/actions'; import { - conversionRateSelector, unconfirmedTransactionsListSelector, getTargetAccountWithSendEtherInfo, - getPreferences, getCurrentCurrency, } from '../../selectors'; @@ -21,13 +19,12 @@ import { getMostRecentOverviewPage } from '../../ducks/history/history'; import { getNativeCurrency } from '../../ducks/metamask/metamask'; import ConfirmEncryptionPublicKey from './confirm-encryption-public-key.component'; +// Removing usage of useNativeCurrencyAsPrimaryCurrency because component ConfirmEncryptionPublicKey is not function mapStateToProps(state) { const { metamask: { subjectMetadata = {} }, } = state; - const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state); - const unconfirmedTransactions = unconfirmedTransactionsListSelector(state); const txData = unconfirmedTransactions[0]; @@ -43,9 +40,7 @@ function mapStateToProps(state) { fromAccount, requester: null, requesterAddress: null, - conversionRate: useNativeCurrencyAsPrimaryCurrency - ? null - : conversionRateSelector(state), + conversionRate: null, mostRecentOverviewPage: getMostRecentOverviewPage(state), nativeCurrency: getNativeCurrency(state), currentCurrency: getCurrentCurrency(state), diff --git a/ui/pages/confirmations/components/confirm-gas-display/__snapshots__/confirm-gas-display.test.js.snap b/ui/pages/confirmations/components/confirm-gas-display/__snapshots__/confirm-gas-display.test.js.snap index c6d58247c683..a5bf21022652 100644 --- a/ui/pages/confirmations/components/confirm-gas-display/__snapshots__/confirm-gas-display.test.js.snap +++ b/ui/pages/confirmations/components/confirm-gas-display/__snapshots__/confirm-gas-display.test.js.snap @@ -39,12 +39,12 @@ exports[`ConfirmGasDisplay should match snapshot 1`] = `
- 0.001197 + 0
diff --git a/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.js b/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.js index 34440be28693..70d5ed1070f4 100644 --- a/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.js +++ b/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.js @@ -5,7 +5,6 @@ import { useSelector } from 'react-redux'; import { useI18nContext } from '../../../../../hooks/useI18nContext'; import { getIsMainnet, - getPreferences, getUnapprovedTransactions, getUseCurrencyRateCheck, transactionFeeSelector, @@ -34,7 +33,6 @@ const ConfirmLegacyGasDisplay = ({ 'data-testid': dataTestId } = {}) => { // state selectors const isMainnet = useSelector(getIsMainnet); const useCurrencyRateCheck = useSelector(getUseCurrencyRateCheck); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); const unapprovedTxs = useSelector(getUnapprovedTransactions); const transactionData = useDraftTransactionWithTxParams(); const txData = useSelector((state) => txDataSelector(state)); @@ -108,7 +106,7 @@ const ConfirmLegacyGasDisplay = ({ 'data-testid': dataTestId } = {}) => { ) @@ -119,7 +117,6 @@ const ConfirmLegacyGasDisplay = ({ 'data-testid': dataTestId } = {}) => { { key="editGasSubTextFeeAmount" type={PRIMARY} value={estimatedHexMaxFeeTotal} - hideLabel={!useNativeCurrencyAsPrimaryCurrency} /> diff --git a/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.test.js b/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.test.js index df5b9ea0e50f..4952fb87edca 100644 --- a/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.test.js +++ b/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/confirm-legacy-gas-display.test.js @@ -21,9 +21,6 @@ const mmState = { balance: '0x1F4', }, }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, }, confirmTransaction: { txData: { diff --git a/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/confirm-detail-row.component.test.js b/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/confirm-detail-row.component.test.js index 5b1e505ddc14..5d3065e8a3d3 100644 --- a/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/confirm-detail-row.component.test.js +++ b/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/confirm-detail-row.component.test.js @@ -11,9 +11,7 @@ describe('Confirm Detail Row Component', () => { metamask: { currencyRates: {}, ...mockNetworkState({ chainId: CHAIN_IDS.GOERLI }), - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, internalAccounts: defaultMockState.metamask.internalAccounts, }, }; diff --git a/ui/pages/confirmations/components/confirm-subtitle/confirm-subtitle.js b/ui/pages/confirmations/components/confirm-subtitle/confirm-subtitle.js index e1219d299288..da99ade8210c 100644 --- a/ui/pages/confirmations/components/confirm-subtitle/confirm-subtitle.js +++ b/ui/pages/confirmations/components/confirm-subtitle/confirm-subtitle.js @@ -29,7 +29,6 @@ const ConfirmSubTitle = ({ if (subtitleComponent) { return subtitleComponent; } - return ( { const t = useI18nContext(); - const { useNativeCurrencyAsPrimaryCurrency: isNativeCurrencyUsed } = - useSelector(getPreferences); - const transactionMeta = useSelector( currentConfirmationSelector, ) as TransactionMeta; @@ -59,14 +53,14 @@ export const EditGasFeesRow = ({ color={TextColor.textDefault} data-testid="first-gas-field" > - {isNativeCurrencyUsed ? nativeFee : fiatFee} + {nativeFee} - {isNativeCurrencyUsed ? fiatFee : nativeFee} + {fiatFee} { - const { useNativeCurrencyAsPrimaryCurrency: isNativeCurrencyUsed } = - useSelector(getPreferences); - return ( - {isNativeCurrencyUsed ? nativeFee : fiatFee} - - - {isNativeCurrencyUsed ? fiatFee : nativeFee} + {nativeFee} + {fiatFee} ); diff --git a/ui/pages/confirmations/components/fee-details-component/fee-details-component.js b/ui/pages/confirmations/components/fee-details-component/fee-details-component.js index 7b310b6fb623..1b1545530047 100644 --- a/ui/pages/confirmations/components/fee-details-component/fee-details-component.js +++ b/ui/pages/confirmations/components/fee-details-component/fee-details-component.js @@ -1,5 +1,4 @@ import React, { useCallback, useMemo, useState } from 'react'; -import { useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import { AlignItems, @@ -19,7 +18,6 @@ import { Text, } from '../../../../components/component-library'; import TransactionDetailItem from '../transaction-detail-item/transaction-detail-item.component'; -import { getPreferences } from '../../../../selectors'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import LoadingHeartBeat from '../../../../components/ui/loading-heartbeat'; import UserPreferencedCurrencyDisplay from '../../../../components/app/user-preferenced-currency-display/user-preferenced-currency-display.component'; @@ -35,8 +33,6 @@ export default function FeeDetailsComponent({ const layer1GasFee = txData?.layer1GasFee ?? null; const [expandFeeDetails, setExpandFeeDetails] = useState(false); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); - const t = useI18nContext(); const { minimumCostInHexWei: hexMinimumTransactionFee } = useGasFeeContext(); @@ -62,12 +58,12 @@ export default function FeeDetailsComponent({ color: TextColor.textAlternative, variant: TextVariant.bodySmBold, }} - hideLabel={Boolean(useNativeCurrencyAsPrimaryCurrency)} + hideLabel /> ); }, - [txData, useNativeCurrencyAsPrimaryCurrency], + [txData], ); const renderTotalDetailValue = useCallback( @@ -87,12 +83,11 @@ export default function FeeDetailsComponent({ color: TextColor.textAlternative, variant: TextVariant.bodySm, }} - hideLabel={!useNativeCurrencyAsPrimaryCurrency} /> ); }, - [txData, useNativeCurrencyAsPrimaryCurrency], + [txData], ); const hasLayer1GasFee = layer1GasFee !== null; diff --git a/ui/pages/confirmations/components/gas-details-item/gas-details-item.js b/ui/pages/confirmations/components/gas-details-item/gas-details-item.js index ef02aadbfa33..5a1fbffea38c 100644 --- a/ui/pages/confirmations/components/gas-details-item/gas-details-item.js +++ b/ui/pages/confirmations/components/gas-details-item/gas-details-item.js @@ -17,7 +17,6 @@ import { import { PRIMARY, SECONDARY } from '../../../../helpers/constants/common'; import { PriorityLevels } from '../../../../../shared/constants/gas'; import { - getPreferences, getTxData, getUseCurrencyRateCheck, transactionFeeSelector, @@ -66,8 +65,6 @@ const GasDetailsItem = ({ supportsEIP1559, } = useGasFeeContext(); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); - const useCurrencyRateCheck = useSelector(getUseCurrencyRateCheck); const getTransactionFeeTotal = useMemo(() => { if (layer1GasFee) { @@ -147,8 +144,7 @@ const GasDetailsItem = ({ variant: TextVariant.bodyMdBold, }} type={SECONDARY} - value={getTransactionFeeTotal} - hideLabel={Boolean(useNativeCurrencyAsPrimaryCurrency)} + hideLabel // Sending hideLabel true by default because this should no longer depend on useNativeCurrencyAsPrimaryCurrency and will always display fiat value /> )} @@ -168,7 +164,6 @@ const GasDetailsItem = ({ }} type={PRIMARY} value={getTransactionFeeTotal || draftHexMinimumTransactionFee} - hideLabel={!useNativeCurrencyAsPrimaryCurrency} /> } @@ -216,7 +211,6 @@ const GasDetailsItem = ({ value={ getMaxTransactionFeeTotal || draftHexMaximumTransactionFee } - hideLabel={!useNativeCurrencyAsPrimaryCurrency} /> diff --git a/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js b/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js index 16ba3c892877..a47ed7387bb4 100644 --- a/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js +++ b/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js @@ -35,9 +35,7 @@ const render = async ({ contextProps } = {}) => { balance: '0x1F4', }, }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, gasFeeEstimates: mockEstimates[GasEstimateTypes.feeMarket].gasFeeEstimates, gasFeeEstimatesByChainId: { diff --git a/ui/pages/confirmations/components/signature-request-header/signature-request-header.js b/ui/pages/confirmations/components/signature-request-header/signature-request-header.js index 30f839b3f78c..9c91ca476ebb 100644 --- a/ui/pages/confirmations/components/signature-request-header/signature-request-header.js +++ b/ui/pages/confirmations/components/signature-request-header/signature-request-header.js @@ -9,10 +9,8 @@ import { } from '../../../../ducks/metamask/metamask'; import { accountsWithSendEtherInfoSelector, - conversionRateSelector, getCurrentChainId, getCurrentCurrency, - getPreferences, } from '../../../../selectors'; import { formatCurrency } from '../../../../helpers/utils/confirm-tx.util'; import { @@ -38,11 +36,8 @@ const SignatureRequestHeader = ({ txData }) => { const providerConfig = useSelector(getProviderConfig); const networkName = getNetworkNameFromProviderType(providerConfig.type); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); - const conversionRateFromSelector = useSelector(conversionRateSelector); - const conversionRate = useNativeCurrencyAsPrimaryCurrency - ? null - : conversionRateFromSelector; + + const conversionRate = null; // setting conversion rate to null by default to display balance in native const currentNetwork = networkName === '' diff --git a/ui/pages/confirmations/components/signature-request/signature-request.test.js b/ui/pages/confirmations/components/signature-request/signature-request.test.js index ccaa34c749dc..85ef5525d2be 100644 --- a/ui/pages/confirmations/components/signature-request/signature-request.test.js +++ b/ui/pages/confirmations/components/signature-request/signature-request.test.js @@ -44,9 +44,7 @@ const mockStore = { rpcUrl: 'http://localhost:8545', ticker: 'ETH', }), - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, accounts: { '0xd8f6a2ffb0fc5952d16c9768b71cfd35b6399aa5': { address: '0xd8f6a2ffb0fc5952d16c9768b71cfd35b6399aa5', diff --git a/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.js b/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.js index cbe80f86fe8b..ebd57c35a141 100644 --- a/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.js +++ b/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.js @@ -86,7 +86,6 @@ export default class ConfirmApproveContent extends Component { setUserAcknowledgedGasMissing: PropTypes.func, renderSimulationFailureWarning: PropTypes.bool, useCurrencyRateCheck: PropTypes.bool, - useNativeCurrencyAsPrimaryCurrency: PropTypes.bool, }; state = { @@ -159,7 +158,6 @@ export default class ConfirmApproveContent extends Component { userAcknowledgedGasMissing, renderSimulationFailureWarning, useCurrencyRateCheck, - useNativeCurrencyAsPrimaryCurrency, } = this.props; if ( !hasLayer1GasFee && @@ -183,7 +181,6 @@ export default class ConfirmApproveContent extends Component { } noBold diff --git a/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js b/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js index 916da9c1c58b..14325479e5ec 100644 --- a/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js +++ b/ui/pages/confirmations/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js @@ -11,9 +11,7 @@ const renderComponent = (props) => { const store = configureMockStore([])({ metamask: { ...mockNetworkState({ chainId: '0x0' }), - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, }, }); return renderWithProvider(, store); diff --git a/ui/pages/confirmations/confirm-approve/confirm-approve.js b/ui/pages/confirmations/confirm-approve/confirm-approve.js index 0828c236a38f..a5dcaeb6202d 100644 --- a/ui/pages/confirmations/confirm-approve/confirm-approve.js +++ b/ui/pages/confirmations/confirm-approve/confirm-approve.js @@ -27,7 +27,6 @@ import { getRpcPrefsForCurrentProvider, checkNetworkAndAccountSupports1559, getUseCurrencyRateCheck, - getPreferences, } from '../../../selectors'; import { useApproveTransaction } from '../hooks/useApproveTransaction'; import { useSimulationFailureWarning } from '../hooks/useSimulationFailureWarning'; @@ -84,7 +83,6 @@ export default function ConfirmApprove({ isAddressLedgerByFromAddress(userAddress), ); const useCurrencyRateCheck = useSelector(getUseCurrencyRateCheck); - const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); const [customPermissionAmount, setCustomPermissionAmount] = useState(''); const [submitWarning, setSubmitWarning] = useState(''); const [isContract, setIsContract] = useState(false); @@ -298,9 +296,6 @@ export default function ConfirmApprove({ hasLayer1GasFee={layer1GasFee !== undefined} supportsEIP1559={supportsEIP1559} useCurrencyRateCheck={useCurrencyRateCheck} - useNativeCurrencyAsPrimaryCurrency={ - useNativeCurrencyAsPrimaryCurrency - } /> {showCustomizeGasPopover && !supportsEIP1559 && (
0.000021 + + ETH +
@@ -431,13 +436,18 @@ exports[`Confirm Transaction Base should match snapshot 1`] = `
0.000021 + + ETH +
diff --git a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js index 8caf1043cf4a..0bf7feaf148f 100644 --- a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js @@ -145,7 +145,6 @@ export default class ConfirmTransactionBase extends Component { secondaryTotalTextOverride: PropTypes.string, gasIsLoading: PropTypes.bool, primaryTotalTextOverrideMaxAmount: PropTypes.string, - useNativeCurrencyAsPrimaryCurrency: PropTypes.bool, maxFeePerGas: PropTypes.string, maxPriorityFeePerGas: PropTypes.string, baseFeePerGas: PropTypes.string, @@ -398,7 +397,6 @@ export default class ConfirmTransactionBase extends Component { nextNonce, getNextNonce, txData, - useNativeCurrencyAsPrimaryCurrency, primaryTotalTextOverrideMaxAmount, showLedgerSteps, nativeCurrency, @@ -445,7 +443,6 @@ export default class ConfirmTransactionBase extends Component { type={PRIMARY} key="total-max-amount" value={getTotalAmount(useMaxFee)} - hideLabel={!useNativeCurrencyAsPrimaryCurrency} /> ); } @@ -454,9 +451,8 @@ export default class ConfirmTransactionBase extends Component { const primaryTotal = useMaxFee ? primaryTotalTextOverrideMaxAmount : primaryTotalTextOverride; - const totalMaxAmount = useNativeCurrencyAsPrimaryCurrency - ? primaryTotal - : secondaryTotalTextOverride; + + const totalMaxAmount = primaryTotal; return isBoldTextAndNotOverridden ? ( {totalMaxAmount} @@ -486,14 +482,12 @@ export default class ConfirmTransactionBase extends Component { color: TextColor.textDefault, variant: TextVariant.bodyMdBold, }} - hideLabel={Boolean(useNativeCurrencyAsPrimaryCurrency)} + hideLabel /> ); } - return useNativeCurrencyAsPrimaryCurrency - ? secondaryTotalTextOverride - : primaryTotalTextOverride; + return secondaryTotalTextOverride; }; const nonceField = diff --git a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.container.js b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.container.js index cc3de6095f2d..5ee4c8eb16f3 100644 --- a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.container.js @@ -44,7 +44,6 @@ import { getIsEthGasPriceFetched, getShouldShowFiat, checkNetworkAndAccountSupports1559, - getPreferences, doesAddressRequireLedgerHidConnection, getTokenList, getEnsResolutionByAddress, @@ -263,7 +262,6 @@ const mapStateToProps = (state, ownProps) => { customNonceValue = getCustomNonceValue(state); const isEthGasPriceFetched = getIsEthGasPriceFetched(state); const noGasPrice = !supportsEIP1559 && getNoGasPriceFetched(state); - const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state); const gasFeeIsCustom = fullTxData.userFeeLevel === CUSTOM_GAS_ESTIMATE || txParamsAreDappSuggested(fullTxData); @@ -344,7 +342,6 @@ const mapStateToProps = (state, ownProps) => { noGasPrice, supportsEIP1559, gasIsLoading: isGasEstimatesLoading || gasLoadingAnimationIsShowing, - useNativeCurrencyAsPrimaryCurrency, maxFeePerGas: gasEstimationObject.maxFeePerGas, maxPriorityFeePerGas: gasEstimationObject.maxPriorityFeePerGas, baseFeePerGas: gasEstimationObject.baseFeePerGas, diff --git a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js index 393280aee3f1..5141682fabf5 100644 --- a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js +++ b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js @@ -108,9 +108,7 @@ const baseStore = { chainId: CHAIN_IDS.GOERLI, }), tokens: [], - preferences: { - useNativeCurrencyAsPrimaryCurrency: false, - }, + preferences: {}, currentCurrency: 'USD', currencyRates: {}, featureFlags: { diff --git a/ui/pages/confirmations/send/gas-display/gas-display.js b/ui/pages/confirmations/send/gas-display/gas-display.js index 5fbad8445cd6..33a011c2966a 100644 --- a/ui/pages/confirmations/send/gas-display/gas-display.js +++ b/ui/pages/confirmations/send/gas-display/gas-display.js @@ -48,6 +48,7 @@ import { MetaMetricsContext } from '../../../../contexts/metametrics'; import useRamps from '../../../../hooks/ramps/useRamps/useRamps'; import { getIsNativeTokenBuyable } from '../../../../ducks/ramps'; +// This function is no longer used in codebase, to be deleted. export default function GasDisplay({ gasError }) { const t = useContext(I18nContext); const dispatch = useDispatch(); @@ -61,8 +62,7 @@ export default function GasDisplay({ gasError }) { const isBuyableChain = useSelector(getIsNativeTokenBuyable); const draftTransaction = useSelector(getCurrentDraftTransaction); const useCurrencyRateCheck = useSelector(getUseCurrencyRateCheck); - const { showFiatInTestnets, useNativeCurrencyAsPrimaryCurrency } = - useSelector(getPreferences); + const { showFiatInTestnets } = useSelector(getPreferences); const unapprovedTxs = useSelector(getUnapprovedTransactions); const nativeCurrency = useSelector(getNativeCurrency); const { chainId } = providerConfig; @@ -132,7 +132,6 @@ export default function GasDisplay({ gasError }) { type={PRIMARY} key="total-detail-value" value={hexTransactionTotal} - hideLabel={!useNativeCurrencyAsPrimaryCurrency} /> ); @@ -144,10 +143,9 @@ export default function GasDisplay({ gasError }) { draftTransaction.amount.value, hexMaximumTransactionFee, )} - hideLabel={!useNativeCurrencyAsPrimaryCurrency} /> ); - } else if (useNativeCurrencyAsPrimaryCurrency) { + } else { detailTotal = primaryTotalTextOverrideMaxAmount; maxAmount = primaryTotalTextOverrideMaxAmount; } @@ -177,7 +175,7 @@ export default function GasDisplay({ gasError }) { type={SECONDARY} key="total-detail-text" value={hexTransactionTotal} - hideLabel={Boolean(useNativeCurrencyAsPrimaryCurrency)} + hideLabel /> ) diff --git a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.test.tsx b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.test.tsx index cdefb3986d1f..d7a474ad3b24 100644 --- a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.test.tsx +++ b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.test.tsx @@ -17,9 +17,7 @@ jest.mock('../../../store/institutional/institution-background', () => ({ describe('Confirm Add Custodian Token', () => { const mockStore = { metamask: { - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, institutionalFeatures: { connectRequests: [ { @@ -50,9 +48,7 @@ describe('Confirm Add Custodian Token', () => { it('tries to connect to custodian with empty token', async () => { const customMockedStore = { metamask: { - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, institutionalFeatures: { connectRequests: [ { diff --git a/ui/pages/institutional/confirm-connect-custodian-modal/confirm-connect-custodian-modal.test.tsx b/ui/pages/institutional/confirm-connect-custodian-modal/confirm-connect-custodian-modal.test.tsx index 5719fb38015f..5044d6085812 100644 --- a/ui/pages/institutional/confirm-connect-custodian-modal/confirm-connect-custodian-modal.test.tsx +++ b/ui/pages/institutional/confirm-connect-custodian-modal/confirm-connect-custodian-modal.test.tsx @@ -9,9 +9,7 @@ describe('Confirm Add Custodian Token', () => { const mockStore = { metamask: { - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, }, history: { push: '/', diff --git a/ui/pages/institutional/custody/custody.test.tsx b/ui/pages/institutional/custody/custody.test.tsx index 383e615492da..577e599397ba 100644 --- a/ui/pages/institutional/custody/custody.test.tsx +++ b/ui/pages/institutional/custody/custody.test.tsx @@ -99,9 +99,7 @@ describe('CustodyPage', function () { }, ], }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, appState: { isLoading: false, }, diff --git a/ui/pages/settings/index.scss b/ui/pages/settings/index.scss index 48e12e8adebc..ffdef52effb4 100644 --- a/ui/pages/settings/index.scss +++ b/ui/pages/settings/index.scss @@ -263,11 +263,11 @@ } &__body { - padding: 24px; + padding: 0px 16px 16px 16px; } &__content-row { - padding: 10px 0 20px; + padding: 14px 0 0; @include design-system.screen-sm-max { flex-wrap: wrap; @@ -296,6 +296,12 @@ margin-top: 10px; } + &__title { + font-size: 14px; + font-weight: 500; + line-height: 22px; + } + &__identicon { display: flex; flex-direction: row; @@ -326,10 +332,13 @@ &__description { @include design-system.H6; + font-size: 12px; + + line-height: 20px; + letter-spacing: 0.25px; + margin-top: 8px; margin-bottom: 12px; - color: var(--color-text-default); - font-size: 14px; font-weight: 400; } } diff --git a/ui/pages/settings/settings-tab/settings-tab.component.js b/ui/pages/settings/settings-tab/settings-tab.component.js index 45407ece008d..b3a1e30fa908 100644 --- a/ui/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/pages/settings/settings-tab/settings-tab.component.js @@ -62,10 +62,11 @@ export default class SettingsTab extends PureComponent { currentCurrency: PropTypes.string, nativeCurrency: PropTypes.string, useNativeCurrencyAsPrimaryCurrency: PropTypes.bool, + showNativeTokenAsMainBalance: PropTypes.bool, setUseNativeCurrencyAsPrimaryCurrencyPreference: PropTypes.func, + setShowNativeTokenAsMainBalancePreference: PropTypes.func, hideZeroBalanceTokens: PropTypes.bool, setHideZeroBalanceTokens: PropTypes.func, - lastFetchedConversionDate: PropTypes.number, selectedAddress: PropTypes.string, tokenList: PropTypes.object, theme: PropTypes.string, @@ -92,8 +93,7 @@ export default class SettingsTab extends PureComponent { renderCurrentConversion() { const { t } = this.context; - const { currentCurrency, setCurrentCurrency, lastFetchedConversionDate } = - this.props; + const { currentCurrency, setCurrentCurrency } = this.props; return (
- {t('currencyConversion')} - - {lastFetchedConversionDate - ? t('updatedWithDate', [ - new Date(lastFetchedConversionDate * 1000).toString(), - ]) - : t('noConversionDateAvailable')} - + + {t('currencyConversion')} + + {/* {t('currencyConversion')} */}
@@ -143,9 +143,14 @@ export default class SettingsTab extends PureComponent { flexDirection={FlexDirection.Column} >
- + {t('currentLanguage')} - + + {currentLocaleName} @@ -180,15 +185,20 @@ export default class SettingsTab extends PureComponent { id="toggle-zero-balance" >
- {t('hideZeroBalanceTokens')} + + {t('hideZeroBalanceTokens')} +
setHideZeroBalanceTokens(!value)} - offLabel={t('off')} - onLabel={t('on')} + data-testid="toggle-zero-balance-button" />
@@ -218,14 +228,18 @@ export default class SettingsTab extends PureComponent {
{t('accountIdenticon')} - + {t('jazzAndBlockies')} - +
- 0 + 0.001197
From 1798a91b038fd22265c19e005a9286e918919a07 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 3 Sep 2024 21:04:41 +0200 Subject: [PATCH 05/68] fix: unit test --- .../cancel-transaction-gas-fee.component.js | 4 ++-- .../cancel-transaction-gas-fee.component.test.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js b/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js index d6b8f3f184c8..02583b0298e4 100644 --- a/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js +++ b/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js @@ -16,12 +16,12 @@ export default class CancelTransaction extends PureComponent {
); diff --git a/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js b/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js index 05bce9e841a0..8966fa01b749 100644 --- a/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js +++ b/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js @@ -11,9 +11,7 @@ describe('CancelTransactionGasFee Component', () => { metamask: { ...mockNetworkState({ chainId: CHAIN_IDS.MAINNET }), currencyRates: {}, - preferences: { - useNativeCurrencyAsPrimaryCurrency: false, - }, + preferences: {}, completedOnboarding: true, internalAccounts: mockState.metamask.internalAccounts, }, From 569b65712453925ea95efbe87869efaccea291d1 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 3 Sep 2024 21:20:36 +0200 Subject: [PATCH 06/68] fix: fix build --- .../multichain/account-list-item/account-list-item.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/components/multichain/account-list-item/account-list-item.js b/ui/components/multichain/account-list-item/account-list-item.js index 24ae32e1a3c3..0991b77c3b29 100644 --- a/ui/components/multichain/account-list-item/account-list-item.js +++ b/ui/components/multichain/account-list-item/account-list-item.js @@ -306,7 +306,7 @@ const AccountListItem = ({ account={account} ethNumberOfDecimals={MAXIMUM_CURRENCY_DECIMALS} value={balanceToTranslate} - //type={PRIMARY} + type={PRIMARY} showFiat={showFiat} data-testid="first-currency-display" /> @@ -353,7 +353,7 @@ const AccountListItem = ({ account={account} ethNumberOfDecimals={MAXIMUM_CURRENCY_DECIMALS} value={account.balance} - //type={SECONDARY} + type={SECONDARY} showNative data-testid="second-currency-display" /> From 33dcbcd314975f4e520b62d38d9b1d53ddb17fc3 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 3 Sep 2024 21:42:29 +0200 Subject: [PATCH 07/68] fix: fix lint --- app/scripts/migrations/035.test.js | 4 +--- ui/components/app/confirm/info/row/currency.tsx | 1 - .../transaction-breakdown.component.js | 14 +++++++------- ui/hooks/useUserPreferencedCurrency.js | 2 +- ui/pages/settings/index.scss | 4 +--- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/scripts/migrations/035.test.js b/app/scripts/migrations/035.test.js index 186296576e79..6f730627d708 100644 --- a/app/scripts/migrations/035.test.js +++ b/app/scripts/migrations/035.test.js @@ -59,9 +59,7 @@ describe('migration #35', () => { identities: {}, lostIdentities: {}, forgottenPassword: false, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, completedOnboarding: false, migratedPrivacyMode: false, metaMetricsId: null, diff --git a/ui/components/app/confirm/info/row/currency.tsx b/ui/components/app/confirm/info/row/currency.tsx index a799d1bda712..51ce1fceba28 100644 --- a/ui/components/app/confirm/info/row/currency.tsx +++ b/ui/components/app/confirm/info/row/currency.tsx @@ -1,6 +1,5 @@ import React from 'react'; -import { PRIMARY } from '../../../../../helpers/constants/common'; import { AlignItems, Display, diff --git a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js index 58cfd6d3c181..4a7c1b6c9f32 100644 --- a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js +++ b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js @@ -4,8 +4,8 @@ import classnames from 'classnames'; import CurrencyDisplay from '../../ui/currency-display'; import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display'; import HexToDecimal from '../../ui/hex-to-decimal'; -import { PRIMARY, SECONDARY } from '../../../helpers/constants/common'; import { EtherDenomination } from '../../../../shared/constants/common'; +import { PRIMARY, SECONDARY } from '../../../helpers/constants/common'; import TransactionBreakdownRow from './transaction-breakdown-row'; export default class TransactionBreakdown extends PureComponent { @@ -211,13 +211,13 @@ export default class TransactionBreakdown extends PureComponent { denomination={EtherDenomination.ETH} numberOfDecimals={9} value={maxFeePerGas} - //type={PRIMARY} + type={PRIMARY} showNative /> {showFiat && ( @@ -231,13 +231,13 @@ export default class TransactionBreakdown extends PureComponent { data-testid="transaction-breakdown__l1-gas-total" numberOfDecimals={18} value={l1HexGasTotal} - // type={PRIMARY} + type={PRIMARY} showNative /> {showFiat && ( @@ -247,7 +247,7 @@ export default class TransactionBreakdown extends PureComponent { diff --git a/ui/hooks/useUserPreferencedCurrency.js b/ui/hooks/useUserPreferencedCurrency.js index d0c099b183c3..c04a02a051c3 100644 --- a/ui/hooks/useUserPreferencedCurrency.js +++ b/ui/hooks/useUserPreferencedCurrency.js @@ -6,7 +6,7 @@ import { getMultichainShouldShowFiat, } from '../selectors/multichain'; -import { PRIMARY, SECONDARY } from '../helpers/constants/common'; +import { PRIMARY } from '../helpers/constants/common'; import { EtherDenomination } from '../../shared/constants/common'; import { ETH_DEFAULT_DECIMALS } from '../constants'; import { useMultichainSelector } from './useMultichainSelector'; diff --git a/ui/pages/settings/index.scss b/ui/pages/settings/index.scss index ffdef52effb4..fca97c803eff 100644 --- a/ui/pages/settings/index.scss +++ b/ui/pages/settings/index.scss @@ -263,7 +263,7 @@ } &__body { - padding: 0px 16px 16px 16px; + padding: 0 16px 16px 16px; } &__content-row { @@ -333,10 +333,8 @@ @include design-system.H6; font-size: 12px; - line-height: 20px; letter-spacing: 0.25px; - margin-top: 8px; margin-bottom: 12px; font-weight: 400; From f8119eb103e7f3f9812510cc29c254837826fdaa Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 3 Sep 2024 22:23:47 +0200 Subject: [PATCH 08/68] fix: fix lint --- ui/components/multichain/asset-picker-amount/utils.ts | 3 ++- ui/ducks/app/app.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/components/multichain/asset-picker-amount/utils.ts b/ui/components/multichain/asset-picker-amount/utils.ts index afb9927f8646..ed644c8a86d8 100644 --- a/ui/components/multichain/asset-picker-amount/utils.ts +++ b/ui/components/multichain/asset-picker-amount/utils.ts @@ -1,6 +1,7 @@ import { createSelector } from 'reselect'; +import { AppSliceState } from '../../../ducks/app/app'; -function getSendInputCurrencySwitched(state) { +function getSendInputCurrencySwitched(state: AppSliceState) { return state.appState.sendInputCurrencySwitched; } diff --git a/ui/ducks/app/app.ts b/ui/ducks/app/app.ts index a16508c9a45a..098da9b756ba 100644 --- a/ui/ducks/app/app.ts +++ b/ui/ducks/app/app.ts @@ -101,7 +101,7 @@ type AppState = { snapsInstallPrivacyWarningShown: boolean; }; -type AppSliceState = { +export type AppSliceState = { appState: AppState; }; From dbdff44e124373213a4583345130980415115b41 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 3 Sep 2024 23:01:18 +0200 Subject: [PATCH 09/68] fix: rm unused locales and rm primary currency toggle from setting ui --- app/_locales/am/messages.json | 7 -- app/_locales/ar/messages.json | 3 - app/_locales/bg/messages.json | 3 - app/_locales/bn/messages.json | 7 -- app/_locales/ca/messages.json | 3 - app/_locales/cs/messages.json | 4 - app/_locales/da/messages.json | 3 - app/_locales/de/messages.json | 10 --- app/_locales/el/messages.json | 10 --- app/_locales/en/messages.json | 10 --- app/_locales/en_GB/messages.json | 10 --- app/_locales/es/messages.json | 10 --- app/_locales/es_419/messages.json | 10 --- app/_locales/et/messages.json | 3 - app/_locales/fa/messages.json | 7 -- app/_locales/fi/messages.json | 7 -- app/_locales/fil/messages.json | 3 - app/_locales/fr/messages.json | 10 --- app/_locales/he/messages.json | 7 -- app/_locales/hi/messages.json | 10 --- app/_locales/hn/messages.json | 4 - app/_locales/hr/messages.json | 3 - app/_locales/ht/messages.json | 7 -- app/_locales/hu/messages.json | 3 - app/_locales/id/messages.json | 10 --- app/_locales/it/messages.json | 7 -- app/_locales/ja/messages.json | 10 --- app/_locales/kn/messages.json | 7 -- app/_locales/ko/messages.json | 10 --- app/_locales/lt/messages.json | 7 -- app/_locales/lv/messages.json | 3 - app/_locales/ms/messages.json | 3 - app/_locales/nl/messages.json | 4 - app/_locales/no/messages.json | 3 - app/_locales/ph/messages.json | 7 -- app/_locales/pl/messages.json | 7 -- app/_locales/pt/messages.json | 10 --- app/_locales/pt_BR/messages.json | 10 --- app/_locales/ro/messages.json | 3 - app/_locales/ru/messages.json | 10 --- app/_locales/sk/messages.json | 7 -- app/_locales/sl/messages.json | 7 -- app/_locales/sr/messages.json | 7 -- app/_locales/sv/messages.json | 3 - app/_locales/sw/messages.json | 3 - app/_locales/ta/messages.json | 4 - app/_locales/th/messages.json | 7 -- app/_locales/tl/messages.json | 10 --- app/_locales/tr/messages.json | 10 --- app/_locales/uk/messages.json | 7 -- app/_locales/vi/messages.json | 10 --- app/_locales/zh_CN/messages.json | 10 --- app/_locales/zh_TW/messages.json | 7 -- ui/pages/settings/index.scss | 6 +- .../settings-tab/settings-tab.component.js | 83 +------------------ .../settings-tab/settings-tab.container.js | 12 +-- .../settings-tab/settings-tab.test.js | 24 ------ ui/store/actions.ts | 6 -- 58 files changed, 8 insertions(+), 480 deletions(-) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index cb193bc11c36..992cdc88e24a 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -241,10 +241,6 @@ "fast": { "message": "ፈጣን" }, - "fiat": { - "message": "ፊያት", - "description": "Exchange type" - }, "fileImportFail": { "message": "ፋይል ማስመጣት እየሰራ አይደለም? እዚህ ላይ ጠቅ ያድርጉ!", "description": "Helps user import their account from a JSON file" @@ -768,9 +764,6 @@ "unlockMessage": { "message": "ያልተማከለ ድር ይጠባበቃል" }, - "updatedWithDate": { - "message": "የዘመነ $1" - }, "urlErrorMsg": { "message": "URIs አግባብነት ያለው የ HTTP/HTTPS ቅድመ ቅጥያ ይፈልጋል።" }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index e262cebf3537..0d00ae364528 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -780,9 +780,6 @@ "unlockMessage": { "message": "شبكة الويب اللامركزية بانتظارك" }, - "updatedWithDate": { - "message": "تم تحديث $1" - }, "urlErrorMsg": { "message": "تتطلب الروابط بادئة HTTP/HTTPS مناسبة." }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 2169f13ecf9d..fcd984be91b8 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -779,9 +779,6 @@ "unlockMessage": { "message": "Децентрализираната мрежа очаква" }, - "updatedWithDate": { - "message": "Актуализирано $1 " - }, "urlErrorMsg": { "message": "URI изискват съответния HTTP / HTTPS префикс." }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 29e06173be17..15a5dbcbfd91 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -247,10 +247,6 @@ "fast": { "message": "দ্রুত" }, - "fiat": { - "message": "ফিয়াট", - "description": "Exchange type" - }, "fileImportFail": { "message": "ফাইল আমদানি কাজ করছে না? এখানে ক্লিক করুন!", "description": "Helps user import their account from a JSON file" @@ -777,9 +773,6 @@ "unlockMessage": { "message": "ছড়িয়ে ছিটিয়ে থাকা ওয়েব অপেক্ষা করছে" }, - "updatedWithDate": { - "message": "আপডেট করা $1" - }, "urlErrorMsg": { "message": "URI গুলির যথাযথ HTTP/HTTPS প্রেফিক্সের প্রয়োজন।" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 4393ea21f108..10b6fdd4b0b8 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -758,9 +758,6 @@ "unlockMessage": { "message": "La web descentralitzada està esperant" }, - "updatedWithDate": { - "message": "Actualitzat $1" - }, "urlErrorMsg": { "message": "Els URIs requereixen el prefix HTTP/HTTPS apropiat." }, diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index f67d21b5cb52..05aa80dc66bf 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -105,10 +105,6 @@ "failed": { "message": "Neúspěšné" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "Import souboru nefunguje? Klikněte sem!", "description": "Helps user import their account from a JSON file" diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index f5d7c9c89c3e..fc619bbef0a0 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -752,9 +752,6 @@ "unlockMessage": { "message": "Det decentraliserede internet venter" }, - "updatedWithDate": { - "message": "Opdaterede $1" - }, "urlErrorMsg": { "message": "Links kræver det rette HTTP/HTTPS-præfix." }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 5e1b32229bd1..ab8a8582ca1e 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Details zur Gebühr" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "Dateiimport fehlgeschlagen? Bitte hier klicken!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask ist nicht mit dieser Website verbunden" }, - "noConversionDateAvailable": { - "message": "Kein Umrechnungskursdaten verfügbar" - }, "noConversionRateAvailable": { "message": "Kein Umrechnungskurs verfügbar" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Aktualisierungsanfrage" }, - "updatedWithDate": { - "message": "$1 aktualisiert" - }, "uploadDropFile": { "message": "Legen Sie Ihre Datei hier ab" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index d8f080e7752c..0527c25f4556 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Λεπτομέρειες χρεώσεων" }, - "fiat": { - "message": "Εντολή", - "description": "Exchange type" - }, "fileImportFail": { "message": "Η εισαγωγή αρχείων δεν λειτουργεί; Κάντε κλικ εδώ!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "Το MetaMask δεν συνδέεται με αυτόν τον ιστότοπο" }, - "noConversionDateAvailable": { - "message": "Δεν υπάρχει διαθέσιμη ημερομηνία μετατροπής νομίσματος" - }, "noConversionRateAvailable": { "message": "Δεν υπάρχει διαθέσιμη ισοτιμία μετατροπής" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Αίτημα ενημέρωσης" }, - "updatedWithDate": { - "message": "Ενημερώθηκε $1" - }, "uploadDropFile": { "message": "Αφήστε το αρχείο σας εδώ" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 68d439a784f1..8515d7bf74a9 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1979,10 +1979,6 @@ "feeDetails": { "message": "Fee details" }, - "fiat": { - "message": "Fiat", - "description": "Exchange type" - }, "fileImportFail": { "message": "File import not working? Click here!", "description": "Helps user import their account from a JSON file" @@ -3226,9 +3222,6 @@ "noConnectedAccountTitle": { "message": "MetaMask isn’t connected to this site" }, - "noConversionDateAvailable": { - "message": "No currency conversion date available" - }, "noConversionRateAvailable": { "message": "No conversion rate available" }, @@ -6279,9 +6272,6 @@ "updateRequest": { "message": "Update request" }, - "updatedWithDate": { - "message": "Updated $1" - }, "uploadDropFile": { "message": "Drop your file here" }, diff --git a/app/_locales/en_GB/messages.json b/app/_locales/en_GB/messages.json index b7e15bc86b55..d0b6049dee4c 100644 --- a/app/_locales/en_GB/messages.json +++ b/app/_locales/en_GB/messages.json @@ -1961,10 +1961,6 @@ "feeDetails": { "message": "Fee details" }, - "fiat": { - "message": "Fiat", - "description": "Exchange type" - }, "fileImportFail": { "message": "File import not working? Click here!", "description": "Helps user import their account from a JSON file" @@ -3199,9 +3195,6 @@ "noConnectedAccountTitle": { "message": "MetaMask isn’t connected to this site" }, - "noConversionDateAvailable": { - "message": "No currency conversion date available" - }, "noConversionRateAvailable": { "message": "No conversion rate available" }, @@ -6261,9 +6254,6 @@ "updateRequest": { "message": "Update request" }, - "updatedWithDate": { - "message": "Updated $1" - }, "uploadDropFile": { "message": "Drop your file here" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index a20b831091a0..1bb959942209 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Detalles de la tarifa" }, - "fiat": { - "message": "Fiduciaria", - "description": "Exchange type" - }, "fileImportFail": { "message": "¿No funciona la importación del archivo? Haga clic aquí.", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask no está conectado a este sitio" }, - "noConversionDateAvailable": { - "message": "No hay fecha de conversión de moneda disponible" - }, "noConversionRateAvailable": { "message": "No hay tasa de conversión disponible" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Solicitud de actualización" }, - "updatedWithDate": { - "message": "$1 actualizado" - }, "uploadDropFile": { "message": "Ingrese su archivo aquí" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index c406955c36c9..11f543db6acc 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -791,10 +791,6 @@ "feeAssociatedRequest": { "message": "Esta solicitud tiene asociada una tarifa." }, - "fiat": { - "message": "Fiduciaria", - "description": "Exchange type" - }, "fileImportFail": { "message": "¿No funciona la importación del archivo? ¡Haga clic aquí!", "description": "Helps user import their account from a JSON file" @@ -1342,9 +1338,6 @@ "noAddressForName": { "message": "No se estableció ninguna dirección para este nombre." }, - "noConversionDateAvailable": { - "message": "No hay fecha de conversión de moneda disponible" - }, "noConversionRateAvailable": { "message": "No hay tasa de conversión disponible" }, @@ -2435,9 +2428,6 @@ "message": "El envío de tokens coleccionables (ERC-721) no se admite actualmente", "description": "This is an error message we show the user if they attempt to send an NFT asset type, for which currently don't support sending" }, - "updatedWithDate": { - "message": "$1 actualizado" - }, "urlErrorMsg": { "message": "Las direcciones URL requieren el prefijo HTTP/HTTPS adecuado." }, diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index dbfe1f88fb55..a4fa6b72ecf1 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -773,9 +773,6 @@ "unlockMessage": { "message": "Detsentraliseeritud veeb ootab" }, - "updatedWithDate": { - "message": "Värskendatud $1" - }, "urlErrorMsg": { "message": "URI-d nõuavad sobivat HTTP/HTTPS-i prefiksit." }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index 9f1d89793c1b..c58e01945a51 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "سریع" }, - "fiat": { - "message": "حکم قانونی", - "description": "Exchange type" - }, "fileImportFail": { "message": "وارد کردن فایل کار نمیکند؟ اینجا کلیک نمایید!", "description": "Helps user import their account from a JSON file" @@ -783,9 +779,6 @@ "unlockMessage": { "message": "وب غیر متمرکز شده انتظار میکشد" }, - "updatedWithDate": { - "message": "بروزرسانی شد 1$1" - }, "urlErrorMsg": { "message": "URl ها نیازمند پیشوند مناسب HTTP/HTTPS اند." }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 4f193797912c..530afeafb419 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "Nopea" }, - "fiat": { - "message": "Kiinteä", - "description": "Exchange type" - }, "fileImportFail": { "message": "Eikö tiedoston tuominen onnistu? Klikkaa tästä!", "description": "Helps user import their account from a JSON file" @@ -780,9 +776,6 @@ "unlockMessage": { "message": "Hajautettu verkko odottaa" }, - "updatedWithDate": { - "message": "$1 päivitetty" - }, "urlErrorMsg": { "message": "URI:t vaativat asianmukaisen HTTP/HTTPS-etuliitteen." }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index ab098442e52e..4b1bb1e058ca 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -695,9 +695,6 @@ "unlockMessage": { "message": "Naghihintay ang decentralized web" }, - "updatedWithDate": { - "message": "Na-update ang $1" - }, "urlErrorMsg": { "message": "Kinakailangan ng mga URI ang naaangkop na HTTP/HTTPS prefix." }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 28d08810ae82..855412a7918d 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Détails des frais" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "L’importation de fichier ne fonctionne pas ? Cliquez ici !", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask n’est pas connecté à ce site" }, - "noConversionDateAvailable": { - "message": "Aucune date de conversion des devises n’est disponible" - }, "noConversionRateAvailable": { "message": "Aucun taux de conversion disponible" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Demande de mise à jour" }, - "updatedWithDate": { - "message": "Mis à jour $1" - }, "uploadDropFile": { "message": "Déposez votre fichier ici" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index e29f44c9f834..a7fdf1662184 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "מהיר" }, - "fiat": { - "message": "פיאט", - "description": "Exchange type" - }, "fileImportFail": { "message": "ייבוא הקובץ לא עובד? לחצ/י כאן!", "description": "Helps user import their account from a JSON file" @@ -780,9 +776,6 @@ "unlockMessage": { "message": "הרשת המבוזרת מחכה" }, - "updatedWithDate": { - "message": "עודכן $1" - }, "urlErrorMsg": { "message": "כתובות URI דורשות את קידומת HTTP/HTTPS המתאימה." }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 2371df612b77..0addd64fa409 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "फ़ीस का ब्यौरा" }, - "fiat": { - "message": "फिएट", - "description": "Exchange type" - }, "fileImportFail": { "message": "फाइल इम्पोर्ट काम नहीं कर रहा है? यहां क्लिक करें!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask इस साइट से कनेक्टेड नहीं है।" }, - "noConversionDateAvailable": { - "message": "कोई करेंसी कन्वर्शन तारीख उपलब्ध नहीं है" - }, "noConversionRateAvailable": { "message": "कोई भी कन्वर्शन दर उपलब्ध नहीं है" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "अपडेट का अनुरोध" }, - "updatedWithDate": { - "message": "अपडेट किया गया $1" - }, "uploadDropFile": { "message": "अपनी फ़ाइल यहां छोड़ें" }, diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index 03c87498c87f..85f4af559b60 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -87,10 +87,6 @@ "failed": { "message": "विफल" }, - "fiat": { - "message": "FIAT एक्सचेंज टाइप", - "description": "Exchange type" - }, "fileImportFail": { "message": "फ़ाइल आयात काम नहीं कर रहा है? यहां क्लिक करें!", "description": "Helps user import their account from a JSON file" diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index d7e62da80ba4..26cbd3838807 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -773,9 +773,6 @@ "unlockMessage": { "message": "Decentralizirani internet čeka" }, - "updatedWithDate": { - "message": "Ažurirano $1" - }, "urlErrorMsg": { "message": "URI-jevima se zahtijeva prikladan prefiks HTTP/HTTPS." }, diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 02f06746a58a..267547371bcd 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -153,10 +153,6 @@ "failed": { "message": "Tonbe" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "Enpòte dosye ki pa travay? Klike la a!", "description": "Helps user import their account from a JSON file" @@ -554,9 +550,6 @@ "unlockMessage": { "message": "Entènèt desantralize a ap tann" }, - "updatedWithDate": { - "message": "Mete ajou $1" - }, "urlErrorMsg": { "message": "URIs mande pou apwopriye prefiks HTTP / HTTPS a." }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 456b63710dd6..a244ad8abb7b 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -773,9 +773,6 @@ "unlockMessage": { "message": "A decentralizált hálózat csak önre vár" }, - "updatedWithDate": { - "message": "$1 frissítve" - }, "urlErrorMsg": { "message": "Az URI-hez szükség van a megfelelő HTTP/HTTPS előtagra." }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 0f8ceacc9ea7..ceaffb10c4fa 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Detail biaya" }, - "fiat": { - "message": "Fiat", - "description": "Exchange type" - }, "fileImportFail": { "message": "Impor file tidak bekerja? Klik di sini!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask tidak terhubung ke situs ini" }, - "noConversionDateAvailable": { - "message": "Tanggal konversi mata uang tidak tersedia" - }, "noConversionRateAvailable": { "message": "Nilai konversi tidak tersedia" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Permintaan pembaruan" }, - "updatedWithDate": { - "message": "Diperbarui $1" - }, "uploadDropFile": { "message": "Letakkan fail di sini" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 9f9085f4ed81..770968a70f00 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -830,10 +830,6 @@ "feeAssociatedRequest": { "message": "Una tassa è associata a questa richiesta." }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "Importazione file non funziona? Clicca qui!", "description": "Helps user import their account from a JSON file" @@ -1738,9 +1734,6 @@ "unlockMessage": { "message": "Il web decentralizzato ti attende" }, - "updatedWithDate": { - "message": "Aggiornata $1" - }, "urlErrorMsg": { "message": "Gli URI richiedono un prefisso HTTP/HTTPS." }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 44226098f705..76e759b086d2 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "手数料の詳細" }, - "fiat": { - "message": "法定通貨", - "description": "Exchange type" - }, "fileImportFail": { "message": "ファイルのインポートが機能していない場合、ここをクリックしてください!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMaskはこのサイトに接続されていません" }, - "noConversionDateAvailable": { - "message": "通貨換算日がありません" - }, "noConversionRateAvailable": { "message": "利用可能な換算レートがありません" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "更新リクエスト" }, - "updatedWithDate": { - "message": "$1が更新されました" - }, "uploadDropFile": { "message": "ここにファイルをドロップします" }, diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 0b0479e3dddf..095670da3fb3 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "ವೇಗ" }, - "fiat": { - "message": "ಫಿಯೆಟ್", - "description": "Exchange type" - }, "fileImportFail": { "message": "ಫೈಲ್ ಆಮದು ಮಾಡುವಿಕೆ ಕಾರ್ಯನಿರ್ವಹಿಸುತ್ತಿಲ್ಲವೇ? ಇಲ್ಲಿ ಕ್ಲಿಕ್ ಮಾಡಿ!", "description": "Helps user import their account from a JSON file" @@ -783,9 +779,6 @@ "unlockMessage": { "message": "ವಿಕೇಂದ್ರೀಕೃತ ವೆಬ್ ನಿರೀಕ್ಷಿಸುತ್ತಿದೆ" }, - "updatedWithDate": { - "message": "$1 ನವೀಕರಿಸಲಾಗಿದೆ" - }, "urlErrorMsg": { "message": "URI ಗಳಿಗೆ ಸೂಕ್ತವಾದ HTTP/HTTPS ಪೂರ್ವಪ್ರತ್ಯಯದ ಅಗತ್ಯವಿದೆ." }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 7286eefb09d7..ad7a5cae62c1 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "수수료 세부 정보" }, - "fiat": { - "message": "명목", - "description": "Exchange type" - }, "fileImportFail": { "message": "파일 가져오기가 작동하지 않나요? 여기를 클릭하세요.", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask가 이 사이트와 연결되어 있지 않습니다" }, - "noConversionDateAvailable": { - "message": "사용 가능한 통화 변환 날짜 없음" - }, "noConversionRateAvailable": { "message": "사용 가능한 환율 없음" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "업데이트 요청" }, - "updatedWithDate": { - "message": "$1에 업데이트됨" - }, "uploadDropFile": { "message": "여기에 파일을 드롭" }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 0600ea96f32b..f14348b4000e 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "Greitas" }, - "fiat": { - "message": "Standartinė valiuta", - "description": "Exchange type" - }, "fileImportFail": { "message": "Failo importavimas neveikia? Spustelėkite čia!", "description": "Helps user import their account from a JSON file" @@ -783,9 +779,6 @@ "unlockMessage": { "message": "Laukiančios decentralizuotos svetainės" }, - "updatedWithDate": { - "message": "Atnaujinta $1" - }, "urlErrorMsg": { "message": "URI reikia atitinkamo HTTP/HTTPS priešdėlio." }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index c0dfc6d573b8..596858c017d5 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -779,9 +779,6 @@ "unlockMessage": { "message": "Decentralizētais tīkls jau gaida" }, - "updatedWithDate": { - "message": "Atjaunināts $1" - }, "urlErrorMsg": { "message": "URI jāsākas ar atbilstošo HTTP/HTTPS priedēkli." }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index b8a0cb2ac507..a45288f90ae8 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -760,9 +760,6 @@ "unlockMessage": { "message": "Web ternyahpusat menanti" }, - "updatedWithDate": { - "message": "Dikemaskini $1" - }, "urlErrorMsg": { "message": "URI memerlukan awalan HTTP/HTTPS yang sesuai." }, diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index f3ae82f80616..ea7b275516a1 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -84,10 +84,6 @@ "failed": { "message": "mislukt" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "Bestandsimport werkt niet? Klik hier!", "description": "Helps user import their account from a JSON file" diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 56c05ffd958c..20aa168b32a4 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -758,9 +758,6 @@ "unlockMessage": { "message": "Det desentraliserte internett venter deg" }, - "updatedWithDate": { - "message": "Oppdatert $1" - }, "urlErrorMsg": { "message": "URI-er krever det aktuelle HTTP/HTTPS-prefikset." }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index debc2d35640a..2c1094cff462 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -519,10 +519,6 @@ "feeAssociatedRequest": { "message": "May nauugnay na bayarin para sa request na ito." }, - "fiat": { - "message": "Fiat", - "description": "Exchange type" - }, "fileImportFail": { "message": "Hindi gumagana ang pag-import ng file? Mag-click dito!", "description": "Helps user import their account from a JSON file" @@ -1679,9 +1675,6 @@ "message": "Hindi kinikilala ang custom na network na ito. Inirerekomenda naming $1 ka bago magpatuloy", "description": "$1 is a clickable link with text defined by the 'unrecognizedChanLinkText' key. The link will open to instructions for users to validate custom network details." }, - "updatedWithDate": { - "message": "Na-update noong $1" - }, "urlErrorMsg": { "message": "Kinakailangan ng mga URL ang naaangkop na HTTP/HTTPS prefix." }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index dbc986a194e4..61ea570e855d 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "Szybko" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "Importowanie pliku nie działa? Kliknij tutaj!", "description": "Helps user import their account from a JSON file" @@ -771,9 +767,6 @@ "unlockMessage": { "message": "Zdecentralizowana sieć oczekuje" }, - "updatedWithDate": { - "message": "Zaktualizowano $1" - }, "urlErrorMsg": { "message": "URI wymaga prawidłowego prefiksu HTTP/HTTPS." }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 3a930315bcbc..dfea4b594bf0 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Detalhes da taxa" }, - "fiat": { - "message": "Fiduciária", - "description": "Exchange type" - }, "fileImportFail": { "message": "A importação de arquivo não está funcionando? Clique aqui!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "A MetaMask não está conectada a este site" }, - "noConversionDateAvailable": { - "message": "Não há uma data de conversão de moeda disponível" - }, "noConversionRateAvailable": { "message": "Não há uma taxa de conversão disponível" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Solicitação de atualização" }, - "updatedWithDate": { - "message": "Atualizado em $1" - }, "uploadDropFile": { "message": "Solte seu arquivo aqui" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index a4b211bb0529..ef9f817ebf7f 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -791,10 +791,6 @@ "feeAssociatedRequest": { "message": "Há uma taxa associada a essa solicitação." }, - "fiat": { - "message": "Fiduciária", - "description": "Exchange type" - }, "fileImportFail": { "message": "A importação de arquivo não está funcionando? Clique aqui!", "description": "Helps user import their account from a JSON file" @@ -1342,9 +1338,6 @@ "noAddressForName": { "message": "Não foi configurado nenhum endereço para esse nome." }, - "noConversionDateAvailable": { - "message": "Não há uma data de conversão de moeda disponível" - }, "noConversionRateAvailable": { "message": "Não há uma taxa de conversão disponível" }, @@ -2439,9 +2432,6 @@ "message": "O envio de tokens colecionáveis (ERC-721) não é suportado no momento", "description": "This is an error message we show the user if they attempt to send an NFT asset type, for which currently don't support sending" }, - "updatedWithDate": { - "message": "Atualizado em $1" - }, "urlErrorMsg": { "message": "Os URLs precisam do prefixo HTTP/HTTPS adequado." }, diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index a7f916825e57..a0a15746b4c0 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -764,9 +764,6 @@ "unlockMessage": { "message": "Web-ul descentralizat așteaptă" }, - "updatedWithDate": { - "message": "Actualizat $1" - }, "urlErrorMsg": { "message": "URL necesită prefixul potrivit HTTP/HTTPS." }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index f3f948d9a84e..50fab664b04d 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Сведения о комиссии" }, - "fiat": { - "message": "Фиатная", - "description": "Exchange type" - }, "fileImportFail": { "message": "Импорт файлов не работает? Нажмите здесь!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask не подключен к этому сайту" }, - "noConversionDateAvailable": { - "message": "Дата обмена валюты недоступна" - }, "noConversionRateAvailable": { "message": "Нет доступного обменного курса" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Запрос обновления" }, - "updatedWithDate": { - "message": "Обновлено $1" - }, "uploadDropFile": { "message": "Переместите свой файл сюда" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 79a185cf896c..238edf29c36e 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -244,10 +244,6 @@ "fast": { "message": "Rýchle" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "Import souboru nefunguje? Klikněte sem!", "description": "Helps user import their account from a JSON file" @@ -749,9 +745,6 @@ "unlockMessage": { "message": "Decentralizovaný web čaká" }, - "updatedWithDate": { - "message": "Aktualizované $1" - }, "urlErrorMsg": { "message": "URI vyžadují korektní HTTP/HTTPS prefix." }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index 64e7c5662c3c..ce63cc9ddb21 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "Hiter" }, - "fiat": { - "message": "Klasične", - "description": "Exchange type" - }, "fileImportFail": { "message": "Uvoz z datoteko ne deluje? Kliknite tukaj!", "description": "Helps user import their account from a JSON file" @@ -771,9 +767,6 @@ "unlockMessage": { "message": "Decentralizirana spletna denarnica" }, - "updatedWithDate": { - "message": "Posodobljeno $1" - }, "urlErrorMsg": { "message": "URI zahtevajo ustrezno HTTP/HTTPS predpono." }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 1741b7567833..56d60832dfba 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -247,10 +247,6 @@ "fast": { "message": "Брзо" }, - "fiat": { - "message": "Dekret", - "description": "Exchange type" - }, "fileImportFail": { "message": "Uvoz datoteke ne radi? Kliknite ovde!", "description": "Helps user import their account from a JSON file" @@ -771,9 +767,6 @@ "unlockMessage": { "message": "Decentralizovani veb čeka" }, - "updatedWithDate": { - "message": "Ažuriran $1" - }, "urlErrorMsg": { "message": "URI-ovi zahtevaju odgovarajući prefiks HTTP / HTTPS." }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index df3766108437..43de300985a6 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -758,9 +758,6 @@ "unlockMessage": { "message": "Den decentraliserade webben väntar" }, - "updatedWithDate": { - "message": "Uppdaterat $1" - }, "urlErrorMsg": { "message": "URI:er kräver lämpligt HTTP/HTTPS-prefix." }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 7eb535bee573..65d2079d5990 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -761,9 +761,6 @@ "unlockMessage": { "message": "Wavuti uliotenganishwa unasubiri" }, - "updatedWithDate": { - "message": "Imesasishwa $1" - }, "urlErrorMsg": { "message": "URI huhitaji kiambishi sahihi cha HTTP/HTTPS." }, diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index f9c7274ac55c..df34dd7dddca 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -129,10 +129,6 @@ "fast": { "message": "வேகமான" }, - "fiat": { - "message": "FIAT", - "description": "Exchange type" - }, "fileImportFail": { "message": "கோப்பு இறக்குமதி வேலை செய்யவில்லையா? இங்கே கிளிக் செய்யவும்!", "description": "Helps user import their account from a JSON file" diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 0b2dbb8664aa..f1ba2214637f 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -123,10 +123,6 @@ "fast": { "message": "เร็ว" }, - "fiat": { - "message": "เงินตรา", - "description": "Exchange type" - }, "fileImportFail": { "message": "นำเข้าไฟล์ไม่สำเหร็จ กดที่นี่!", "description": "Helps user import their account from a JSON file" @@ -383,9 +379,6 @@ "unlock": { "message": "ปลดล็อก" }, - "updatedWithDate": { - "message": "อัปเดต $1 แล้ว" - }, "urlErrorMsg": { "message": "URI ต้องมีคำนำหน้าเป็น HTTP หรือ HTTPS" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 7eecf1acfd13..e7347901a9ad 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Mga detalye ng singil" }, - "fiat": { - "message": "Fiat", - "description": "Exchange type" - }, "fileImportFail": { "message": "Hindi gumagana ang pag-import ng file? Mag-click dito!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "Ang MetaMask ay hindi nakakonekta sa site na ito" }, - "noConversionDateAvailable": { - "message": "Walang available na petsa sa pagpapapalit ng currency" - }, "noConversionRateAvailable": { "message": "Hindi available ang rate ng palitan" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Hiling sa pag-update" }, - "updatedWithDate": { - "message": "Na-update noong $1" - }, "uploadDropFile": { "message": "I-drop ang file mo rito" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index cc40ce53b487..159c6a938750 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Ücret bilgileri" }, - "fiat": { - "message": "Fiat Para", - "description": "Exchange type" - }, "fileImportFail": { "message": "Dosya içe aktarma çalışmıyor mu? Buraya tıklayın!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask bu siteye bağlı değil" }, - "noConversionDateAvailable": { - "message": "Para birimi dönüşüm tarihi mevcut değil" - }, "noConversionRateAvailable": { "message": "Dönüşüm oranı mevcut değil" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Talebi güncelle" }, - "updatedWithDate": { - "message": "$1 güncellendi" - }, "uploadDropFile": { "message": "Dosyanızı buraya sürükleyin" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 59bb0b477008..3df0e035eebb 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -250,10 +250,6 @@ "fast": { "message": "Швидка" }, - "fiat": { - "message": "Вказівка", - "description": "Exchange type" - }, "fileImportFail": { "message": "Не працює імпорт файлу? Натисніть тут!", "description": "Helps user import their account from a JSON file" @@ -783,9 +779,6 @@ "unlockMessage": { "message": "Децентралізована мережа очікує" }, - "updatedWithDate": { - "message": "Оновлено $1" - }, "urlErrorMsg": { "message": "URIs вимагають відповідного префікса HTTP/HTTPS." }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index c4795a502a7e..24b23b8e5f8f 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "Chi tiết phí" }, - "fiat": { - "message": "Pháp định", - "description": "Exchange type" - }, "fileImportFail": { "message": "Tính năng nhập tập tin không hoạt động? Nhấp vào đây!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask không được kết nối với trang web này" }, - "noConversionDateAvailable": { - "message": "Hiện không có ngày quy đổi tiền tệ nào" - }, "noConversionRateAvailable": { "message": "Không có sẵn tỷ lệ quy đổi nào" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "Yêu cầu cập nhật" }, - "updatedWithDate": { - "message": "Đã cập nhật $1" - }, "uploadDropFile": { "message": "Thả tập tin của bạn vào đây" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index c834c8a18230..d56db0de1216 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -1928,10 +1928,6 @@ "feeDetails": { "message": "费用详情" }, - "fiat": { - "message": "法币", - "description": "Exchange type" - }, "fileImportFail": { "message": "文件导入失败?点击这里!", "description": "Helps user import their account from a JSON file" @@ -3160,9 +3156,6 @@ "noConnectedAccountTitle": { "message": "MetaMask 未连接到此站点" }, - "noConversionDateAvailable": { - "message": "没有可用的货币转换日期" - }, "noConversionRateAvailable": { "message": "无可用汇率" }, @@ -6174,9 +6167,6 @@ "updateRequest": { "message": "更新请求" }, - "updatedWithDate": { - "message": "已于 $1 更新" - }, "uploadDropFile": { "message": "将您的文件放在此处" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 83c0fc09e565..558963373965 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -521,10 +521,6 @@ "feeAssociatedRequest": { "message": "這個請求會附帶一筆手續費。" }, - "fiat": { - "message": "法定貨幣", - "description": "Exchange type" - }, "fileImportFail": { "message": "檔案匯入失敗?點擊這裡!", "description": "Helps user import their account from a JSON file" @@ -1407,9 +1403,6 @@ "message": "無法辨識這個自訂網路。我們建議您先$1再繼續。", "description": "$1 is a clickable link with text defined by the 'unrecognizedChanLinkText' key. The link will open to instructions for users to validate custom network details." }, - "updatedWithDate": { - "message": "更新時間 $1" - }, "urlErrorMsg": { "message": "URL 需要以適當的 HTTP/HTTPS 作為開頭" }, diff --git a/ui/pages/settings/index.scss b/ui/pages/settings/index.scss index fca97c803eff..cde6ebfe4f49 100644 --- a/ui/pages/settings/index.scss +++ b/ui/pages/settings/index.scss @@ -267,7 +267,7 @@ } &__content-row { - padding: 14px 0 0; + padding: 16px 0 0; @include design-system.screen-sm-max { flex-wrap: wrap; @@ -296,6 +296,10 @@ margin-top: 10px; } + &__dropdown { + height: auto; + } + &__title { font-size: 14px; font-weight: 500; diff --git a/ui/pages/settings/settings-tab/settings-tab.component.js b/ui/pages/settings/settings-tab/settings-tab.component.js index b3a1e30fa908..01d1efbd6d40 100644 --- a/ui/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/pages/settings/settings-tab/settings-tab.component.js @@ -60,10 +60,7 @@ export default class SettingsTab extends PureComponent { currentLocale: PropTypes.string, useBlockie: PropTypes.bool, currentCurrency: PropTypes.string, - nativeCurrency: PropTypes.string, - useNativeCurrencyAsPrimaryCurrency: PropTypes.bool, showNativeTokenAsMainBalance: PropTypes.bool, - setUseNativeCurrencyAsPrimaryCurrencyPreference: PropTypes.func, setShowNativeTokenAsMainBalancePreference: PropTypes.func, hideZeroBalanceTokens: PropTypes.bool, setHideZeroBalanceTokens: PropTypes.func, @@ -120,6 +117,7 @@ export default class SettingsTab extends PureComponent { options={currencyOptions} selectedOption={currentCurrency} onChange={(newCurrency) => setCurrentCurrency(newCurrency)} + className="settings-page__content-item__dropdown" />
@@ -314,84 +312,6 @@ export default class SettingsTab extends PureComponent { ); } - renderUsePrimaryCurrencyOptions() { - const { t } = this.context; - const getPrimaryCurrencySettingForMetrics = (newCurrency) => { - this.context.trackEvent({ - category: MetaMetricsEventCategory.Settings, - event: MetaMetricsEventName.UseNativeCurrencyAsPrimaryCurrency, - properties: { - use_native_currency_as_primary_currency: newCurrency, - }, - }); - }; - const { - nativeCurrency, - setUseNativeCurrencyAsPrimaryCurrencyPreference, - useNativeCurrencyAsPrimaryCurrency, - } = this.props; - return ( - -
- - {t('primaryCurrencySetting')} - -
-
-
-
-
- { - setUseNativeCurrencyAsPrimaryCurrencyPreference(true); - getPrimaryCurrencySettingForMetrics(true); - }} - checked={Boolean(useNativeCurrencyAsPrimaryCurrency)} - /> - -
-
- { - setUseNativeCurrencyAsPrimaryCurrencyPreference(false); - getPrimaryCurrencySettingForMetrics(false); - }} - checked={!useNativeCurrencyAsPrimaryCurrency} - /> - -
-
-
-
-
- ); - } - renderShowNativeTokenAsMainBalance() { const { t } = this.context; const geShowNativeTokenAsMainBalanceForMetrics = (value) => { @@ -511,7 +431,6 @@ export default class SettingsTab extends PureComponent {
{warning ?
{warning}
: null} {this.renderCurrentConversion()} - {this.renderUsePrimaryCurrencyOptions()} {this.renderShowNativeTokenAsMainBalance()} {this.renderCurrentLocale()} {this.renderTheme()} diff --git a/ui/pages/settings/settings-tab/settings-tab.container.js b/ui/pages/settings/settings-tab/settings-tab.container.js index ef1a53e881ae..7de17ffefde4 100644 --- a/ui/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/pages/settings/settings-tab/settings-tab.container.js @@ -3,7 +3,6 @@ import { setCurrentCurrency, setUseBlockie, updateCurrentLocale, - setUseNativeCurrencyAsPrimaryCurrencyPreference, setHideZeroBalanceTokens, setParticipateInMetaMetrics, setTheme, @@ -26,11 +25,8 @@ const mapStateToProps = (state) => { const { currentCurrency, useBlockie, currentLocale } = metamask; const { ticker: nativeCurrency } = getProviderConfig(state); const { address: selectedAddress } = getSelectedInternalAccount(state); - const { - useNativeCurrencyAsPrimaryCurrency, - hideZeroBalanceTokens, - showNativeTokenAsMainBalance, - } = getPreferences(state); + const { hideZeroBalanceTokens, showNativeTokenAsMainBalance } = + getPreferences(state); const tokenList = getTokenList(state); @@ -40,7 +36,6 @@ const mapStateToProps = (state) => { currentCurrency, nativeCurrency, useBlockie, - useNativeCurrencyAsPrimaryCurrency, showNativeTokenAsMainBalance, hideZeroBalanceTokens, selectedAddress, @@ -54,9 +49,6 @@ const mapDispatchToProps = (dispatch) => { setCurrentCurrency: (currency) => dispatch(setCurrentCurrency(currency)), setUseBlockie: (value) => dispatch(setUseBlockie(value)), updateCurrentLocale: (key) => dispatch(updateCurrentLocale(key)), - setUseNativeCurrencyAsPrimaryCurrencyPreference: (value) => { - return dispatch(setUseNativeCurrencyAsPrimaryCurrencyPreference(value)); - }, setShowNativeTokenAsMainBalancePreference: (value) => { return dispatch(setShowNativeTokenAsMainBalancePreference(value)); }, diff --git a/ui/pages/settings/settings-tab/settings-tab.test.js b/ui/pages/settings/settings-tab/settings-tab.test.js index 9313ece639e9..608280dabc14 100644 --- a/ui/pages/settings/settings-tab/settings-tab.test.js +++ b/ui/pages/settings/settings-tab/settings-tab.test.js @@ -9,7 +9,6 @@ import 'jest-canvas-mock'; const mockSetCurrentCurrency = jest.fn(); const mockUpdateCurrentLocale = jest.fn(); -const mockSetUseNativeCurrencyAsPrimaryCurrencyPreference = jest.fn(); const mockSetUseBlockie = jest.fn(); const mockSetHideZeroBalanceTokens = jest.fn(); const mockSetShowNativeTokenAsMainBalance = jest.fn(); @@ -17,8 +16,6 @@ const mockSetShowNativeTokenAsMainBalance = jest.fn(); jest.mock('../../../store/actions.ts', () => ({ setCurrentCurrency: () => mockSetCurrentCurrency, updateCurrentLocale: () => mockUpdateCurrentLocale, - setUseNativeCurrencyAsPrimaryCurrencyPreference: () => - mockSetUseNativeCurrencyAsPrimaryCurrencyPreference, setUseBlockie: () => mockSetUseBlockie, setHideZeroBalanceTokens: () => mockSetHideZeroBalanceTokens, setShowNativeTokenAsMainBalancePreference: () => @@ -31,7 +28,6 @@ describe('Settings Tab', () => { afterEach(() => { mockSetCurrentCurrency.mockReset(); mockUpdateCurrentLocale.mockReset(); - mockSetUseNativeCurrencyAsPrimaryCurrencyPreference.mockReset(); }); it('selects currency', async () => { @@ -54,26 +50,6 @@ describe('Settings Tab', () => { expect(mockUpdateCurrentLocale).toHaveBeenCalled(); }); - it('sets fiat primary currency', async () => { - const { queryByTestId } = renderWithProvider(, mockStore); - - const fiatCurrencyToggle = queryByTestId('toggle-fiat-currency'); - - fireEvent.click(fiatCurrencyToggle); - - expect( - mockSetUseNativeCurrencyAsPrimaryCurrencyPreference, - ).toHaveBeenCalled(); - }); - - it('should display currency symbol for native token', async () => { - const { getByText } = renderWithProvider(, mockStore); - - const textElement = getByText('ETH'); - - expect(textElement).toBeInTheDocument(); - }); - it('clicks jazzicon', () => { const { queryByTestId } = renderWithProvider(, mockStore); diff --git a/ui/store/actions.ts b/ui/store/actions.ts index bc0a10a114a1..a4fccec06364 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -3005,12 +3005,6 @@ export function setDefaultHomeActiveTabName( }; } -export function setUseNativeCurrencyAsPrimaryCurrencyPreference( - value: boolean, -) { - return setPreference('useNativeCurrencyAsPrimaryCurrency', value); -} - export function setShowNativeTokenAsMainBalancePreference(value: boolean) { return setPreference('showNativeTokenAsMainBalance', value); } From d470ebb39c19c52aae9cb705f07a76ed4b50886d Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 3 Sep 2024 23:53:36 +0200 Subject: [PATCH 10/68] fix: fix e2e --- test/e2e/default-fixture.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index 27db906cd754..727889ca7eba 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -198,6 +198,7 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { showTestNetworks: false, smartTransactionsOptInStatus: false, useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, petnamesEnabled: true, isRedesignedConfirmationsDeveloperEnabled: false, showConfirmationAdvancedDetails: false, From 36a48f0af79e21721af2ca5d0645a5fa1c491076 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 10:41:25 +0200 Subject: [PATCH 11/68] fix: fix e2e sentry --- app/scripts/constants/sentry-state.ts | 2 +- .../errors-after-init-opt-in-background-state.json | 1 + .../state-snapshots/errors-after-init-opt-in-ui-state.json | 1 + .../errors-before-init-opt-in-background-state.json | 1 + .../state-snapshots/errors-before-init-opt-in-ui-state.json | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/scripts/constants/sentry-state.ts b/app/scripts/constants/sentry-state.ts index 557a03427b5c..c53e1296da65 100644 --- a/app/scripts/constants/sentry-state.ts +++ b/app/scripts/constants/sentry-state.ts @@ -221,7 +221,7 @@ export const SENTRY_BACKGROUND_STATE = { showTestNetworks: true, smartTransactionsOptInStatus: true, useNativeCurrencyAsPrimaryCurrency: true, - showNativeTokenAsMainBalance: false, + showNativeTokenAsMainBalance: true, petnamesEnabled: true, showConfirmationAdvancedDetails: true, }, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json index 38473a52b36c..b3b29c6cd577 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json @@ -207,6 +207,7 @@ "showTestNetworks": false, "smartTransactionsOptInStatus": false, "useNativeCurrencyAsPrimaryCurrency": true, + "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "isRedesignedConfirmationsDeveloperEnabled": "boolean", "redesignedConfirmationsEnabled": true, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json index 524e5fad9294..de67c8635081 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -33,6 +33,7 @@ "showTestNetworks": false, "smartTransactionsOptInStatus": false, "useNativeCurrencyAsPrimaryCurrency": true, + "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "isRedesignedConfirmationsDeveloperEnabled": "boolean", "redesignedConfirmationsEnabled": true, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json index c30e331583cd..46b4209a9ec3 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json @@ -109,6 +109,7 @@ "showTestNetworks": false, "smartTransactionsOptInStatus": false, "useNativeCurrencyAsPrimaryCurrency": true, + "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "showConfirmationAdvancedDetails": false, "isRedesignedConfirmationsDeveloperEnabled": "boolean" diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json index 16204cb379fc..94319425ac1d 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json @@ -109,6 +109,7 @@ "showTestNetworks": false, "smartTransactionsOptInStatus": false, "useNativeCurrencyAsPrimaryCurrency": true, + "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "showConfirmationAdvancedDetails": false, "isRedesignedConfirmationsDeveloperEnabled": "boolean" From 529fc19985b8173ffe774e777a7fe4208359b1ce Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 11:24:49 +0200 Subject: [PATCH 12/68] fix: fix e2e --- test/e2e/fixture-builder.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index ddc819b2bcf3..113b3f7436a0 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -69,6 +69,7 @@ function onboardingFixture() { showTestNetworks: false, smartTransactionsOptInStatus: false, useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, petnamesEnabled: true, isRedesignedConfirmationsDeveloperEnabled: false, showConfirmationAdvancedDetails: false, From 344303279de03ea88a1ea81b385975f83feb7e44 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 11:56:41 +0200 Subject: [PATCH 13/68] fix: fix e2e --- test/e2e/tests/settings/change-language.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/tests/settings/change-language.spec.ts b/test/e2e/tests/settings/change-language.spec.ts index 578c27be84f6..57ceb9ea4bc6 100644 --- a/test/e2e/tests/settings/change-language.spec.ts +++ b/test/e2e/tests/settings/change-language.spec.ts @@ -16,8 +16,8 @@ const selectors = { ethOverviewSend: '[data-testid="eth-overview-send"]', ensInput: '[data-testid="ens-input"]', nftsTab: '[data-testid="account-overview__nfts-tab"]', - labelSpanish: { tag: 'span', text: 'Idioma actual' }, - currentLanguageLabel: { tag: 'span', text: 'Current language' }, + labelSpanish: { tag: 'p', text: 'Idioma actual' }, + currentLanguageLabel: { tag: 'p', text: 'Current language' }, advanceText: { text: 'Avanceret', tag: 'div' }, waterText: '[placeholder="Søg"]', headerTextDansk: { text: 'Indstillinger', tag: 'h3' }, From 3ea9b327606ab1dd17aec27f06c61d487f8d4a09 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 12:02:13 +0200 Subject: [PATCH 14/68] fix: fix e2e --- test/e2e/tests/settings/localization.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/e2e/tests/settings/localization.spec.js b/test/e2e/tests/settings/localization.spec.js index 707cc120e578..a57b94effa9b 100644 --- a/test/e2e/tests/settings/localization.spec.js +++ b/test/e2e/tests/settings/localization.spec.js @@ -17,6 +17,7 @@ describe('Localization', function () { .withPreferencesController({ preferences: { showFiatInTestnets: true, + showNativeTokenAsMainBalance: false, }, }) .build(), @@ -26,13 +27,12 @@ describe('Localization', function () { async ({ driver }) => { await unlockWallet(driver); - const secondaryBalance = await driver.findElement( - '[data-testid="eth-overview__secondary-currency"]', + // After the removal of displaying secondary currency in coin-overview.tsx, we will test localization on main balance with showNativeTokenAsMainBalance = false + const primaryBalance = await driver.findElement( + '[data-testid="eth-overview__primary-currency"]', ); - const secondaryBalanceText = await secondaryBalance.getText(); - const [fiatAmount, fiatUnit] = secondaryBalanceText - .trim() - .split(/\s+/u); + const balanceText = await primaryBalance.getText(); + const [fiatAmount, fiatUnit] = balanceText.trim().split(/\s+/u); assert.ok(fiatAmount.startsWith('₱')); assert.equal(fiatUnit, 'PHP'); }, From f70cd64df285dc3e860a2584ed23a5ce8d5cf2c5 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 12:36:30 +0200 Subject: [PATCH 15/68] fix: fix e2e --- test/e2e/tests/dapp-interactions/encrypt-decrypt.spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/e2e/tests/dapp-interactions/encrypt-decrypt.spec.js b/test/e2e/tests/dapp-interactions/encrypt-decrypt.spec.js index 2f595138d0cf..393ddf462314 100644 --- a/test/e2e/tests/dapp-interactions/encrypt-decrypt.spec.js +++ b/test/e2e/tests/dapp-interactions/encrypt-decrypt.spec.js @@ -195,7 +195,9 @@ describe('Encrypt Decrypt', function () { ); }); - it('should show balance correctly as Fiat', async function () { + it('should show balance correctly as Native', async function () { + // In component ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js, after removing useNativeCurrencyAsPrimaryCurrency; + // We will display native balance in the confirm-encryption-public-key.component.js await withFixtures( { dapp: true, @@ -203,7 +205,7 @@ describe('Encrypt Decrypt', function () { .withPermissionControllerConnectedToTestDapp() .withPreferencesController({ preferences: { - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: false, }, }) .build(), @@ -231,7 +233,7 @@ describe('Encrypt Decrypt', function () { const accountBalanceLabel = await driver.findElement( '.request-encryption-public-key__balance-value', ); - assert.equal(await accountBalanceLabel.getText(), '$42,500.00 USD'); + assert.equal(await accountBalanceLabel.getText(), '25 ETH'); }, ); }); From 653bee36878a1f133ebfb7b458b125d4d0156c89 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 12:46:12 +0200 Subject: [PATCH 16/68] Empty From 0e4df7de52023d969fad3a80d5770aa29801225c Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 13:40:40 +0200 Subject: [PATCH 17/68] fix: fix e2e --- test/e2e/tests/settings/account-token-list.spec.js | 2 +- ui/pages/settings/settings-tab/settings-tab.component.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/tests/settings/account-token-list.spec.js b/test/e2e/tests/settings/account-token-list.spec.js index 921cacae9e3a..c9b8d218bdf7 100644 --- a/test/e2e/tests/settings/account-token-list.spec.js +++ b/test/e2e/tests/settings/account-token-list.spec.js @@ -56,7 +56,7 @@ describe('Settings', function () { text: 'General', tag: 'div', }); - await driver.clickElement({ text: 'Fiat', tag: 'label' }); + await driver.clickElement('.show-native-token-as-main-balance'); // We now need to enable "Show fiat on testnet" if we are using testnets (and since our custom // network during test is using a testnet chain ID, it will be considered as a test network) await driver.clickElement({ diff --git a/ui/pages/settings/settings-tab/settings-tab.component.js b/ui/pages/settings/settings-tab/settings-tab.component.js index 01d1efbd6d40..be5071785392 100644 --- a/ui/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/pages/settings/settings-tab/settings-tab.component.js @@ -349,6 +349,7 @@ export default class SettingsTab extends PureComponent {
{ setShowNativeTokenAsMainBalancePreference(!value); From 7bb3ff4c96b60eec5f49d5d3b647155b6954b32c Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 4 Sep 2024 15:18:42 +0200 Subject: [PATCH 18/68] fix: remove instances of setting useNativeCurrencyAsPrimaryCurrency --- .storybook/test-data.js | 13 ++++++++----- app/scripts/constants/sentry-state.ts | 1 - app/scripts/controllers/metametrics.js | 2 -- app/scripts/controllers/metametrics.test.js | 14 +++++++------- app/scripts/controllers/preferences.js | 1 - app/scripts/lib/backup.test.js | 1 - app/scripts/migrations/092.3.test.ts | 1 - shared/constants/metametrics.ts | 5 ----- test/data/mock-send-state.json | 3 +-- test/data/mock-state.json | 7 +++---- test/e2e/default-fixture.js | 1 - test/e2e/fixture-builder.js | 1 - test/e2e/restore/MetaMaskUserData.json | 3 +-- .../errors-after-init-opt-in-background-state.json | 1 - .../errors-after-init-opt-in-ui-state.json | 1 - ...errors-before-init-opt-in-background-state.json | 1 - .../errors-before-init-opt-in-ui-state.json | 1 - test/integration/data/integration-init-state.json | 1 - .../data/onboarding-completion-route.json | 1 - .../app/confirm/info/row/currency.stories.tsx | 4 ++-- .../transaction-list-item.component.test.js | 6 +----- .../user-preferenced-currency-display.test.js | 4 +--- ...interactive-replacement-token-modal.stories.tsx | 4 +--- ...tive-replacement-token-notification.stories.tsx | 4 +--- .../asset-picker-modal/asset-picker-modal.test.tsx | 5 +---- ui/ducks/metamask/metamask.js | 1 - .../confirm-gas-display.test.js | 4 +--- .../simulation-details.stories.tsx | 2 +- ui/pages/confirmations/hooks/test-utils.js | 4 ++-- 29 files changed, 31 insertions(+), 66 deletions(-) diff --git a/.storybook/test-data.js b/.storybook/test-data.js index 274fdfdb3651..08a9e7db2ba1 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -673,7 +673,7 @@ const state = { welcomeScreenSeen: false, currentLocale: 'en', preferences: { - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, }, incomingTransactionsPreferences: { [CHAIN_IDS.MAINNET]: true, @@ -1218,7 +1218,8 @@ const state = { accounts: ['0x9d0ba4ddac06032527b140912ec808ab9451b788'], }, ], - ...mockNetworkState({ + ...mockNetworkState( + { id: 'test-networkConfigurationId-1', rpcUrl: 'https://testrpc.com', chainId: '0x1', @@ -1227,14 +1228,16 @@ const state = { metadata: { EIPS: { 1559: true }, status: NetworkStatus.Available, - } - }, { + }, + }, + { id: 'test-networkConfigurationId-2', rpcUrl: 'http://localhost:8545', chainId: '0x539', ticker: 'ETH', nickname: 'Localhost 8545', - }), + }, + ), accountTokens: { '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': { '0x1': [ diff --git a/app/scripts/constants/sentry-state.ts b/app/scripts/constants/sentry-state.ts index c53e1296da65..d0824bc9140b 100644 --- a/app/scripts/constants/sentry-state.ts +++ b/app/scripts/constants/sentry-state.ts @@ -220,7 +220,6 @@ export const SENTRY_BACKGROUND_STATE = { showFiatInTestnets: true, showTestNetworks: true, smartTransactionsOptInStatus: true, - useNativeCurrencyAsPrimaryCurrency: true, showNativeTokenAsMainBalance: true, petnamesEnabled: true, showConfirmationAdvancedDetails: true, diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 1ba6a8e401ab..eb0eba229ae1 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -819,8 +819,6 @@ export default class MetaMetricsController { [MetaMetricsUserTrait.Theme]: metamaskState.theme || 'default', [MetaMetricsUserTrait.TokenDetectionEnabled]: metamaskState.useTokenDetection, - [MetaMetricsUserTrait.UseNativeCurrencyAsPrimaryCurrency]: - metamaskState.useNativeCurrencyAsPrimaryCurrency, [MetaMetricsUserTrait.ShowNativeTokenAsMainBalance]: metamaskState.showNativeTokenAsMainBalance, ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) diff --git a/app/scripts/controllers/metametrics.test.js b/app/scripts/controllers/metametrics.test.js index 40a3f2795f01..8e60dd85b3e4 100644 --- a/app/scripts/controllers/metametrics.test.js +++ b/app/scripts/controllers/metametrics.test.js @@ -1034,7 +1034,7 @@ describe('MetaMetricsController', function () { securityAlertsEnabled: true, theme: 'default', useTokenDetection: true, - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, security_providers: [], names: { [NameType.ETHEREUM_ADDRESS]: { @@ -1089,7 +1089,7 @@ describe('MetaMetricsController', function () { [MetaMetricsUserTrait.ThreeBoxEnabled]: false, [MetaMetricsUserTrait.Theme]: 'default', [MetaMetricsUserTrait.TokenDetectionEnabled]: true, - [MetaMetricsUserTrait.UseNativeCurrencyAsPrimaryCurrency]: true, + [MetaMetricsUserTrait.ShowNativeTokenAsMainBalance]: true, [MetaMetricsUserTrait.SecurityProviders]: ['blockaid'], ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) [MetaMetricsUserTrait.MmiExtensionId]: 'testid', @@ -1127,7 +1127,7 @@ describe('MetaMetricsController', function () { useNftDetection: false, theme: 'default', useTokenDetection: true, - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, }); const updatedTraits = metaMetricsController._buildUserTraitsObject({ @@ -1154,7 +1154,7 @@ describe('MetaMetricsController', function () { useNftDetection: false, theme: 'default', useTokenDetection: true, - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: false, }); expect(updatedTraits).toStrictEqual({ @@ -1162,7 +1162,7 @@ describe('MetaMetricsController', function () { [MetaMetricsUserTrait.NumberOfAccounts]: 3, [MetaMetricsUserTrait.NumberOfTokens]: 1, [MetaMetricsUserTrait.OpenseaApiEnabled]: false, - [MetaMetricsUserTrait.UseNativeCurrencyAsPrimaryCurrency]: false, + [MetaMetricsUserTrait.ShowNativeTokenAsMainBalance]: false, }); }); @@ -1191,7 +1191,7 @@ describe('MetaMetricsController', function () { useNftDetection: true, theme: 'default', useTokenDetection: true, - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, }); const updatedTraits = metaMetricsController._buildUserTraitsObject({ @@ -1213,7 +1213,7 @@ describe('MetaMetricsController', function () { useNftDetection: true, theme: 'default', useTokenDetection: true, - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, }); expect(updatedTraits).toStrictEqual(null); }); diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 49a3f6e147e6..5130ca2b62c7 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -87,7 +87,6 @@ export default class PreferencesController { showFiatInTestnets: false, showTestNetworks: false, smartTransactionsOptInStatus: null, // null means we will show the Smart Transactions opt-in modal to a user if they are eligible - useNativeCurrencyAsPrimaryCurrency: true, showNativeTokenAsMainBalance: false, hideZeroBalanceTokens: false, petnamesEnabled: true, diff --git a/app/scripts/lib/backup.test.js b/app/scripts/lib/backup.test.js index 947761449a36..9253ebbfcd94 100644 --- a/app/scripts/lib/backup.test.js +++ b/app/scripts/lib/backup.test.js @@ -168,7 +168,6 @@ const jsonData = JSON.stringify({ showFiatInTestnets: false, showTestNetworks: true, smartTransactionsOptInStatus: false, - useNativeCurrencyAsPrimaryCurrency: true, }, ipfsGateway: 'dweb.link', ledgerTransportType: 'webhid', diff --git a/app/scripts/migrations/092.3.test.ts b/app/scripts/migrations/092.3.test.ts index f55ea30c6f3f..782b93af0fbd 100644 --- a/app/scripts/migrations/092.3.test.ts +++ b/app/scripts/migrations/092.3.test.ts @@ -27,7 +27,6 @@ const PREFERENCES_CONTROLLER_MOCK = { autoLockTimeLimit: undefined, showFiatInTestnets: false, showTestNetworks: false, - useNativeCurrencyAsPrimaryCurrency: true, hideZeroBalanceTokens: false, }, // ENS decentralized website resolution diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 13806e026985..0d7e1923ae4b 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -445,10 +445,6 @@ export enum MetaMetricsUserTrait { * Identified when the token detection feature is toggled. */ TokenDetectionEnabled = 'token_detection_enabled', - /** - * Identified when the user enables native currency. - */ - UseNativeCurrencyAsPrimaryCurrency = 'use_native_currency_as_primary_currency', /** * Identified when show native token as main balance is toggled. */ @@ -626,7 +622,6 @@ export enum MetaMetricsEventName { TokenHidden = 'Token Hidden', TokenImportCanceled = 'Token Import Canceled', TokenImportClicked = 'Token Import Clicked', - UseNativeCurrencyAsPrimaryCurrency = 'Use Native Currency as Primary Currency', ShowNativeTokenAsMainBalance = 'Show native token as main balance', WalletSetupStarted = 'Wallet Setup Selected', WalletSetupCanceled = 'Wallet Setup Canceled', diff --git a/test/data/mock-send-state.json b/test/data/mock-send-state.json index 09b9cad15757..6e3a719feb8e 100644 --- a/test/data/mock-send-state.json +++ b/test/data/mock-send-state.json @@ -130,8 +130,7 @@ "preferences": { "hideZeroBalanceTokens": false, "showFiatInTestnets": false, - "showTestNetworks": true, - "useNativeCurrencyAsPrimaryCurrency": true + "showTestNetworks": true }, "seedPhraseBackedUp": null, "ensResolutionsByAddress": {}, diff --git a/test/data/mock-state.json b/test/data/mock-state.json index e79f47fd65bb..52cff255e5a2 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -367,13 +367,12 @@ "preferences": { "hideZeroBalanceTokens": false, "isRedesignedConfirmationsDeveloperEnabled": false, + "petnamesEnabled": false, "showExtensionInFullSizeView": false, "showFiatInTestnets": false, - "showTestNetworks": true, - "smartTransactionsOptInStatus": false, - "useNativeCurrencyAsPrimaryCurrency": true, "showNativeTokenAsMainBalance": true, - "petnamesEnabled": false + "showTestNetworks": true, + "smartTransactionsOptInStatus": false }, "ensResolutionsByAddress": {}, "isAccountMenuOpen": false, diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index 727889ca7eba..52fe3258f8b0 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -197,7 +197,6 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { showFiatInTestnets: false, showTestNetworks: false, smartTransactionsOptInStatus: false, - useNativeCurrencyAsPrimaryCurrency: true, showNativeTokenAsMainBalance: true, petnamesEnabled: true, isRedesignedConfirmationsDeveloperEnabled: false, diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 113b3f7436a0..63e86f21ea40 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -68,7 +68,6 @@ function onboardingFixture() { showFiatInTestnets: false, showTestNetworks: false, smartTransactionsOptInStatus: false, - useNativeCurrencyAsPrimaryCurrency: true, showNativeTokenAsMainBalance: true, petnamesEnabled: true, isRedesignedConfirmationsDeveloperEnabled: false, diff --git a/test/e2e/restore/MetaMaskUserData.json b/test/e2e/restore/MetaMaskUserData.json index 0f400e8a34e7..846acc8164cd 100644 --- a/test/e2e/restore/MetaMaskUserData.json +++ b/test/e2e/restore/MetaMaskUserData.json @@ -36,8 +36,7 @@ "showExtensionInFullSizeView": false, "showFiatInTestnets": false, "showTestNetworks": false, - "smartTransactionsOptInStatus": false, - "useNativeCurrencyAsPrimaryCurrency": true + "smartTransactionsOptInStatus": false }, "theme": "light", "useBlockie": false, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json index b3b29c6cd577..6b9120899ffe 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json @@ -206,7 +206,6 @@ "showFiatInTestnets": false, "showTestNetworks": false, "smartTransactionsOptInStatus": false, - "useNativeCurrencyAsPrimaryCurrency": true, "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "isRedesignedConfirmationsDeveloperEnabled": "boolean", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json index de67c8635081..34a04d88985a 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -32,7 +32,6 @@ "showFiatInTestnets": false, "showTestNetworks": false, "smartTransactionsOptInStatus": false, - "useNativeCurrencyAsPrimaryCurrency": true, "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "isRedesignedConfirmationsDeveloperEnabled": "boolean", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json index 46b4209a9ec3..4cb5341041e5 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json @@ -108,7 +108,6 @@ "showFiatInTestnets": false, "showTestNetworks": false, "smartTransactionsOptInStatus": false, - "useNativeCurrencyAsPrimaryCurrency": true, "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "showConfirmationAdvancedDetails": false, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json index 94319425ac1d..4fad39ed98b2 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json @@ -108,7 +108,6 @@ "showFiatInTestnets": false, "showTestNetworks": false, "smartTransactionsOptInStatus": false, - "useNativeCurrencyAsPrimaryCurrency": true, "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "showConfirmationAdvancedDetails": false, diff --git a/test/integration/data/integration-init-state.json b/test/integration/data/integration-init-state.json index 0e935a7a9a8e..2a8de8e6fc1c 100644 --- a/test/integration/data/integration-init-state.json +++ b/test/integration/data/integration-init-state.json @@ -741,7 +741,6 @@ "showFiatInTestnets": false, "showTestNetworks": true, "smartTransactionsOptInStatus": false, - "useNativeCurrencyAsPrimaryCurrency": true, "petnamesEnabled": false, "showConfirmationAdvancedDetails": false }, diff --git a/test/integration/data/onboarding-completion-route.json b/test/integration/data/onboarding-completion-route.json index 1b2379af3a47..45718be0dde3 100644 --- a/test/integration/data/onboarding-completion-route.json +++ b/test/integration/data/onboarding-completion-route.json @@ -207,7 +207,6 @@ "showFiatInTestnets": false, "showTestNetworks": false, "smartTransactionsOptInStatus": null, - "useNativeCurrencyAsPrimaryCurrency": true, "hideZeroBalanceTokens": false, "petnamesEnabled": true, "redesignedConfirmationsEnabled": true, diff --git a/ui/components/app/confirm/info/row/currency.stories.tsx b/ui/components/app/confirm/info/row/currency.stories.tsx index 2a520ca5bd35..ca9926e5cc6b 100644 --- a/ui/components/app/confirm/info/row/currency.stories.tsx +++ b/ui/components/app/confirm/info/row/currency.stories.tsx @@ -12,7 +12,7 @@ const store = configureStore({ ...mockState.metamask, preferences: { ...mockState.metamask.preferences, - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: false, }, }, }); @@ -29,7 +29,7 @@ const ConfirmInfoRowCurrencyStory = { control: 'text', }, }, - decorators: [(story: any) => {story()}] + decorators: [(story: any) => {story()}], }; export const DefaultStory = ({ variant, value }) => ( diff --git a/ui/components/app/transaction-list-item/transaction-list-item.component.test.js b/ui/components/app/transaction-list-item/transaction-list-item.component.test.js index 2d1ce89eed3e..e305040bf969 100644 --- a/ui/components/app/transaction-list-item/transaction-list-item.component.test.js +++ b/ui/components/app/transaction-list-item/transaction-list-item.component.test.js @@ -105,11 +105,7 @@ const generateUseSelectorRouter = (opts) => (selector) => { } else if (selector === getCurrentNetwork) { return { nickname: 'Ethereum Mainnet' }; } else if (selector === getPreferences) { - return ( - opts.preferences ?? { - useNativeCurrencyAsPrimaryCurrency: true, - } - ); + return opts.preferences ?? {}; } else if (selector === getShouldShowFiat) { return opts.shouldShowFiat ?? false; } else if (selector === getTokens) { diff --git a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.test.js b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.test.js index 51ee63d40c17..2a6193847fa4 100644 --- a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.test.js +++ b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.test.js @@ -13,9 +13,7 @@ describe('UserPreferencedCurrencyDisplay Component', () => { ...mockState.metamask, ...mockNetworkState({ chainId: CHAIN_IDS.MAINNET }), currencyRates: {}, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, }, }; const mockStore = configureMockStore()(defaultState); diff --git a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.stories.tsx b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.stories.tsx index 862b98d350f3..f0327aaa227f 100644 --- a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.stories.tsx +++ b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.stories.tsx @@ -47,9 +47,7 @@ const customData = { oldRefreshToken: 'abc', url: 'https://saturn-custody-ui.dev.metamask-institutional.io', }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, }, }; diff --git a/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.stories.tsx b/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.stories.tsx index fd169d23881f..381c4573add3 100644 --- a/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.stories.tsx +++ b/ui/components/institutional/interactive-replacement-token-notification/interactive-replacement-token-notification.stories.tsx @@ -14,9 +14,7 @@ const customData = { '81f96a88b6cbc5f50d3864122349fa9a9755833ee82a7e3cf6f268c78aab51ab', url: 'url', }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, keyrings: [ { type: 'Custody - Saturn', diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.test.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.test.tsx index be0eb8282258..15cc339775c9 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.test.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.test.tsx @@ -14,7 +14,6 @@ import { getCurrentChainId, getCurrentCurrency, getNativeCurrencyImage, - getPreferences, getSelectedAccountCachedBalance, getSelectedInternalAccount, getShouldHideZeroBalanceTokens, @@ -134,9 +133,7 @@ describe('AssetPickerModal', () => { if (selector === getTopAssets) { return []; } - if (selector === getPreferences) { - return { useNativeCurrencyAsPrimaryCurrency: false }; - } + if (selector === getSwapsBlockedTokens) { return new Set(['0xtoken1']); } diff --git a/ui/ducks/metamask/metamask.js b/ui/ducks/metamask/metamask.js index e3d16b6fa78d..e039def4441e 100644 --- a/ui/ducks/metamask/metamask.js +++ b/ui/ducks/metamask/metamask.js @@ -51,7 +51,6 @@ const initialState = { showFiatInTestnets: false, showTestNetworks: false, smartTransactionsOptInStatus: false, - useNativeCurrencyAsPrimaryCurrency: true, petnamesEnabled: true, featureNotificationsEnabled: false, }, diff --git a/ui/pages/confirmations/components/confirm-gas-display/confirm-gas-display.test.js b/ui/pages/confirmations/components/confirm-gas-display/confirm-gas-display.test.js index c80ef735222b..c1d4ae838301 100644 --- a/ui/pages/confirmations/components/confirm-gas-display/confirm-gas-display.test.js +++ b/ui/pages/confirmations/components/confirm-gas-display/confirm-gas-display.test.js @@ -39,9 +39,7 @@ const render = async ({ transactionProp = {}, contextProps = {} } = {}) => { balance: '0x1F4', }, }, - preferences: { - useNativeCurrencyAsPrimaryCurrency: true, - }, + preferences: {}, gasFeeEstimates: mockEstimates[GasEstimateTypes.feeMarket].gasFeeEstimates, gasFeeEstimatesByChainId: { diff --git a/ui/pages/confirmations/components/simulation-details/simulation-details.stories.tsx b/ui/pages/confirmations/components/simulation-details/simulation-details.stories.tsx index 15bfab8a2428..7c4fdc6e0d22 100644 --- a/ui/pages/confirmations/components/simulation-details/simulation-details.stories.tsx +++ b/ui/pages/confirmations/components/simulation-details/simulation-details.stories.tsx @@ -29,7 +29,7 @@ const storeMock = configureStore({ ...mockState.metamask, preferences: { ...mockState.metamask.preferences, - useNativeCurrencyAsPrimaryCurrency: false, + showNativeTokenAsMainBalance: false, }, ...mockNetworkState({ chainId: CHAIN_ID_MOCK }), useTokenDetection: true, diff --git a/ui/pages/confirmations/hooks/test-utils.js b/ui/pages/confirmations/hooks/test-utils.js index 8af6bcf3ba40..908f600564f8 100644 --- a/ui/pages/confirmations/hooks/test-utils.js +++ b/ui/pages/confirmations/hooks/test-utils.js @@ -10,10 +10,10 @@ import { import { getCurrentCurrency, getShouldShowFiat, - getPreferences, txDataSelector, getCurrentKeyring, getTokenExchangeRates, + getPreferences, } from '../../../selectors'; import { @@ -118,7 +118,7 @@ export const generateUseSelectorRouter = } if (selector === getPreferences) { return { - useNativeCurrencyAsPrimaryCurrency: true, + showNativeTokenAsMainBalance: true, }; } if ( From c0a7d31395391c308202aa2722118e4614f4180d Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Thu, 5 Sep 2024 20:41:42 +0200 Subject: [PATCH 19/68] fix: fix --- app/scripts/migrations/035.test.js | 4 +++- app/scripts/migrations/092.3.test.ts | 1 + ui/hooks/useUserPreferencedCurrency.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/scripts/migrations/035.test.js b/app/scripts/migrations/035.test.js index 6f730627d708..186296576e79 100644 --- a/app/scripts/migrations/035.test.js +++ b/app/scripts/migrations/035.test.js @@ -59,7 +59,9 @@ describe('migration #35', () => { identities: {}, lostIdentities: {}, forgottenPassword: false, - preferences: {}, + preferences: { + useNativeCurrencyAsPrimaryCurrency: true, + }, completedOnboarding: false, migratedPrivacyMode: false, metaMetricsId: null, diff --git a/app/scripts/migrations/092.3.test.ts b/app/scripts/migrations/092.3.test.ts index 782b93af0fbd..f55ea30c6f3f 100644 --- a/app/scripts/migrations/092.3.test.ts +++ b/app/scripts/migrations/092.3.test.ts @@ -27,6 +27,7 @@ const PREFERENCES_CONTROLLER_MOCK = { autoLockTimeLimit: undefined, showFiatInTestnets: false, showTestNetworks: false, + useNativeCurrencyAsPrimaryCurrency: true, hideZeroBalanceTokens: false, }, // ENS decentralized website resolution diff --git a/ui/hooks/useUserPreferencedCurrency.js b/ui/hooks/useUserPreferencedCurrency.js index c04a02a051c3..9c2c98740594 100644 --- a/ui/hooks/useUserPreferencedCurrency.js +++ b/ui/hooks/useUserPreferencedCurrency.js @@ -34,7 +34,7 @@ import { useMultichainSelector } from './useMultichainSelector'; * useUserPreferencedCurrency * * returns an object that contains what currency to use for displaying values based - * on the user's preference settings, as well as the significant number of decimals + * on whether the user needs to check showNativeTokenAsMainBalance setting, as well as the significant number of decimals * to display based on the currency * * @param {"PRIMARY" | "SECONDARY"} type - what display type is being rendered From a7b3ff65e43e31a70738013ee7698a8fdc0ae636 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Fri, 6 Sep 2024 13:41:44 +0200 Subject: [PATCH 20/68] fix: added aggregated balance component --- ...referenced-currency-display.component.d.ts | 1 + ...gregated-percentage-overview.test.tsx.snap | 23 + .../aggregated-percentage-overview.test.tsx | 592 ++++++++++++++++++ .../aggregated-percentage-overview.tsx | 131 ++++ .../app/wallet-overview/coin-overview.tsx | 46 +- .../percentage-and-amount-change.tsx | 2 +- .../currency-display.component.js | 3 + ui/hooks/useCurrencyDisplay.js | 7 + 8 files changed, 797 insertions(+), 8 deletions(-) create mode 100644 ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap create mode 100644 ui/components/app/wallet-overview/aggregated-percentage-overview.test.tsx create mode 100644 ui/components/app/wallet-overview/aggregated-percentage-overview.tsx diff --git a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts index a2bab969e9cc..b4210ece87a8 100644 --- a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts +++ b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.d.ts @@ -13,6 +13,7 @@ export type UserPrefrencedCurrencyDisplayProps = OverridingUnion< showNative?: boolean; showCurrencySuffix?: boolean; withCheckShowNativeToken?: boolean; + isAggregatedFiatOverviewBalance?: boolean; } >; diff --git a/ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap b/ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap new file mode 100644 index 000000000000..1209f0e4942c --- /dev/null +++ b/ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AggregatedPercentageOverview render renders correctly 1`] = ` +
+
+

+ +$0.00 +

+

+ (+0.00%) +

+
+
+`; diff --git a/ui/components/app/wallet-overview/aggregated-percentage-overview.test.tsx b/ui/components/app/wallet-overview/aggregated-percentage-overview.test.tsx new file mode 100644 index 000000000000..d9418c1eb912 --- /dev/null +++ b/ui/components/app/wallet-overview/aggregated-percentage-overview.test.tsx @@ -0,0 +1,592 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import '@testing-library/jest-dom'; +import { getIntlLocale } from '../../../ducks/locale/locale'; +import { + getCurrentCurrency, + getSelectedAccount, + getShouldHideZeroBalanceTokens, + getTokensMarketData, +} from '../../../selectors'; +import { useAccountTotalFiatBalance } from '../../../hooks/useAccountTotalFiatBalance'; +import { AggregatedPercentageOverview } from './aggregated-percentage-overview'; + +jest.mock('react-redux', () => ({ + useSelector: jest.fn((selector) => selector()), +})); + +jest.mock('../../../ducks/locale/locale', () => ({ + getIntlLocale: jest.fn(), +})); + +jest.mock('../../../selectors', () => ({ + getCurrentCurrency: jest.fn(), + getSelectedAccount: jest.fn(), + getShouldHideZeroBalanceTokens: jest.fn(), + getTokensMarketData: jest.fn(), +})); + +jest.mock('../../../hooks/useAccountTotalFiatBalance', () => ({ + useAccountTotalFiatBalance: jest.fn(), +})); + +const mockGetIntlLocale = getIntlLocale as unknown as jest.Mock; +const mockGetCurrentCurrency = getCurrentCurrency as jest.Mock; +const mockGetSelectedAccount = getSelectedAccount as unknown as jest.Mock; +const mockGetShouldHideZeroBalanceTokens = + getShouldHideZeroBalanceTokens as jest.Mock; + +const mockGetTOkensMarketData = getTokensMarketData as jest.Mock; + +const selectedAccountMock = { + id: 'd51c0116-de36-4e77-b35b-408d4ea82d01', + address: '0xa259af9db8172f62ef0373d7dfa893a3e245ace9', + options: {}, + methods: [ + 'personal_sign', + 'eth_sign', + 'eth_signTransaction', + 'eth_signTypedData_v1', + 'eth_signTypedData_v3', + 'eth_signTypedData_v4', + ], + type: 'eip155:eoa', + metadata: { + name: 'Account 2', + importTime: 1725467263902, + lastSelected: 1725467263905, + keyring: { + type: 'Simple Key Pair', + }, + }, + balance: '0x0f7e2a03e67666', +}; + +const marketDataMock = { + '0x0000000000000000000000000000000000000000': { + tokenAddress: '0x0000000000000000000000000000000000000000', + currency: 'ETH', + id: 'ethereum', + price: 0.999893213343359, + pricePercentChange1d: -0.7173299395012226, + }, + '0x6B175474E89094C44Da98b954EedeAC495271d0F': { + tokenAddress: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + currency: 'ETH', + id: 'dai', + price: 0.00041861840136257403, + pricePercentChange1d: -0.0862498076183525, + }, + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': { + tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + currency: 'ETH', + id: 'usd-coin', + price: 0.0004185384042093742, + pricePercentChange1d: -0.07612981257899307, + }, + '0xdAC17F958D2ee523a2206206994597C13D831ec7': { + tokenAddress: '0xdAC17F958D2ee523a2206206994597C13D831ec7', + currency: 'ETH', + id: 'tether', + price: 0.0004183549552402562, + pricePercentChange1d: -0.1357979347463155, + }, +}; + +const positiveMarketDataMock = { + '0x0000000000000000000000000000000000000000': { + tokenAddress: '0x0000000000000000000000000000000000000000', + currency: 'ETH', + id: 'ethereum', + price: 0.999893213343359, + pricePercentChange1d: 0.7173299395012226, + }, + '0x6B175474E89094C44Da98b954EedeAC495271d0F': { + tokenAddress: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + currency: 'ETH', + id: 'dai', + price: 0.00041861840136257403, + pricePercentChange1d: 0.0862498076183525, + }, + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': { + tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + currency: 'ETH', + id: 'usd-coin', + price: 0.0004185384042093742, + pricePercentChange1d: 0.07612981257899307, + }, + '0xdAC17F958D2ee523a2206206994597C13D831ec7': { + tokenAddress: '0xdAC17F958D2ee523a2206206994597C13D831ec7', + currency: 'ETH', + id: 'tether', + price: 0.0004183549552402562, + pricePercentChange1d: 0.1357979347463155, + }, +}; + +const mixedMarketDataMock = { + '0x0000000000000000000000000000000000000000': { + tokenAddress: '0x0000000000000000000000000000000000000000', + currency: 'ETH', + id: 'ethereum', + price: 0.999893213343359, + pricePercentChange1d: -0.7173299395012226, + }, + '0x6B175474E89094C44Da98b954EedeAC495271d0F': { + tokenAddress: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + currency: 'ETH', + id: 'dai', + price: 0.00041861840136257403, + pricePercentChange1d: 0.0862498076183525, + }, + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': { + tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + currency: 'ETH', + id: 'usd-coin', + price: 0.0004185384042093742, + pricePercentChange1d: -0.07612981257899307, + }, + '0xdAC17F958D2ee523a2206206994597C13D831ec7': { + tokenAddress: '0xdAC17F958D2ee523a2206206994597C13D831ec7', + currency: 'ETH', + id: 'tether', + price: 0.0004183549552402562, + pricePercentChange1d: 0.1357979347463155, + }, +}; + +describe('AggregatedPercentageOverview', () => { + beforeEach(() => { + mockGetIntlLocale.mockReturnValue('en-US'); + mockGetCurrentCurrency.mockReturnValue('USD'); + mockGetSelectedAccount.mockReturnValue(selectedAccountMock); + mockGetShouldHideZeroBalanceTokens.mockReturnValue(false); + mockGetTOkensMarketData.mockReturnValue(marketDataMock); + + jest.clearAllMocks(); + }); + + describe('render', () => { + it('renders correctly', () => { + (useAccountTotalFiatBalance as jest.Mock).mockReturnValue({ + orderedTokenList: [ + { + iconUrl: './images/eth_logo.svg', + symbol: 'ETH', + fiatBalance: '0', + }, + ], + totalFiatBalance: 0, + }); + const { container } = render(); + expect(container).toMatchSnapshot(); + }); + }); + + it('should display zero percentage and amount if balance is zero', () => { + (useAccountTotalFiatBalance as jest.Mock).mockReturnValue({ + orderedTokenList: [ + { + iconUrl: './images/eth_logo.svg', + symbol: 'ETH', + fiatBalance: '0', + }, + ], + totalFiatBalance: 0, + }); + + render(); + const percentageElement = screen.getByText('(+0.00%)'); + const numberElement = screen.getByText('+$0.00'); + expect(percentageElement).toBeInTheDocument(); + expect(numberElement).toBeInTheDocument(); + }); + + it('should display negative aggregated amount and percentage change with all negative market data', () => { + (useAccountTotalFiatBalance as jest.Mock).mockReturnValue({ + orderedTokenList: [ + { + address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + decimals: 6, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png', + name: 'USDC', + occurrences: 16, + symbol: 'USDC', + balance: '11754897', + string: '11.75489', + balanceError: null, + fiatBalance: '11.77', + }, + { + iconUrl: './images/eth_logo.svg', + symbol: 'ETH', + fiatBalance: '10.45', + }, + { + address: '0x6b175474e89094c44da98b954eedeac495271d0f', + decimals: 18, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x6b175474e89094c44da98b954eedeac495271d0f.png', + name: 'Dai Stablecoin', + occurrences: 17, + symbol: 'DAI', + balance: '6520850325578202013', + string: '6.52085', + balanceError: null, + fiatBalance: '6.53', + }, + { + address: '0xdac17f958d2ee523a2206206994597c13d831ec7', + decimals: 6, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xdac17f958d2ee523a2206206994597c13d831ec7.png', + name: 'Tether USD', + occurrences: 15, + symbol: 'USDT', + balance: '3379966', + string: '3.37996', + balanceError: null, + fiatBalance: '3.38', + }, + ], + totalFiatBalance: 32.13, + }); + const expectedAmountChange = '-$0.09'; + const expectedPercentageChange = '(-0.29%)'; + render(); + const percentageElement = screen.getByText(expectedPercentageChange); + const numberElement = screen.getByText(expectedAmountChange); + expect(percentageElement).toBeInTheDocument(); + expect(numberElement).toBeInTheDocument(); + }); + + it('should display positive aggregated amount and percentage change with all positive market data', () => { + (useAccountTotalFiatBalance as jest.Mock).mockReturnValue({ + orderedTokenList: [ + { + address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + decimals: 6, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png', + name: 'USDC', + occurrences: 16, + symbol: 'USDC', + balance: '11754897', + string: '11.75489', + balanceError: null, + fiatBalance: '11.77', + }, + { + iconUrl: './images/eth_logo.svg', + symbol: 'ETH', + fiatBalance: '10.45', + }, + { + address: '0x6b175474e89094c44da98b954eedeac495271d0f', + decimals: 18, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x6b175474e89094c44da98b954eedeac495271d0f.png', + name: 'Dai Stablecoin', + occurrences: 17, + symbol: 'DAI', + balance: '6520850325578202013', + string: '6.52085', + balanceError: null, + fiatBalance: '6.53', + }, + { + address: '0xdac17f958d2ee523a2206206994597c13d831ec7', + decimals: 6, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xdac17f958d2ee523a2206206994597c13d831ec7.png', + name: 'Tether USD', + occurrences: 15, + symbol: 'USDT', + balance: '3379966', + string: '3.37996', + balanceError: null, + fiatBalance: '3.38', + }, + ], + totalFiatBalance: 32.13, + }); + mockGetTOkensMarketData.mockReturnValue(positiveMarketDataMock); + const expectedAmountChange = '+$0.09'; + const expectedPercentageChange = '(+0.29%)'; + render(); + const percentageElement = screen.getByText(expectedPercentageChange); + const numberElement = screen.getByText(expectedAmountChange); + expect(percentageElement).toBeInTheDocument(); + expect(numberElement).toBeInTheDocument(); + }); + + it('should display correct aggregated amount and percentage change with positive and negative market data', () => { + (useAccountTotalFiatBalance as jest.Mock).mockReturnValue({ + orderedTokenList: [ + { + address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + decimals: 6, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png', + name: 'USDC', + occurrences: 16, + symbol: 'USDC', + balance: '11754897', + string: '11.75489', + balanceError: null, + fiatBalance: '11.77', + }, + { + iconUrl: './images/eth_logo.svg', + symbol: 'ETH', + fiatBalance: '10.45', + }, + { + address: '0x6b175474e89094c44da98b954eedeac495271d0f', + decimals: 18, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x6b175474e89094c44da98b954eedeac495271d0f.png', + name: 'Dai Stablecoin', + occurrences: 17, + symbol: 'DAI', + balance: '6520850325578202013', + string: '6.52085', + balanceError: null, + fiatBalance: '6.53', + }, + { + address: '0xdac17f958d2ee523a2206206994597c13d831ec7', + decimals: 6, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xdac17f958d2ee523a2206206994597c13d831ec7.png', + name: 'Tether USD', + occurrences: 15, + symbol: 'USDT', + balance: '3379966', + string: '3.37996', + balanceError: null, + fiatBalance: '3.38', + }, + ], + totalFiatBalance: 32.13, + }); + mockGetTOkensMarketData.mockReturnValue(mixedMarketDataMock); + const expectedAmountChange = '-$0.07'; + const expectedPercentageChange = '(-0.23%)'; + render(); + const percentageElement = screen.getByText(expectedPercentageChange); + const numberElement = screen.getByText(expectedAmountChange); + expect(percentageElement).toBeInTheDocument(); + expect(numberElement).toBeInTheDocument(); + }); + + it('should display correct aggregated amount and percentage when one ERC20 fiatBalance is undefined', () => { + (useAccountTotalFiatBalance as jest.Mock).mockReturnValue({ + orderedTokenList: [ + { + iconUrl: './images/eth_logo.svg', + symbol: 'ETH', + fiatBalance: '21.12', + }, + { + symbol: 'USDC', + decimals: 6, + occurrences: 16, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png', + address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + name: 'USDC', + balance: '11411142', + string: '11.41114', + balanceError: null, + fiatBalance: '11.4', + }, + { + symbol: 'DAI', + decimals: 18, + occurrences: 17, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x6b175474e89094c44da98b954eedeac495271d0f.png', + address: '0x6b175474e89094c44da98b954eedeac495271d0f', + name: 'Dai Stablecoin', + balance: '3000000000000000000', + string: '3', + balanceError: null, + fiatBalance: '3', + }, + { + symbol: 'OMNI', + decimals: 18, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x36e66fbbce51e4cd5bd3c62b637eb411b18949d4.png', + address: '0x36e66fbbce51e4cd5bd3c62b637eb411b18949d4', + name: 'Omni Network', + balance: '2161382310000000000', + string: '2.16138', + balanceError: null, + }, + ], + totalFiatBalance: 35.52, + }); + mockGetTOkensMarketData.mockReturnValue({ + '0x0000000000000000000000000000000000000000': { + tokenAddress: '0x0000000000000000000000000000000000000000', + currency: 'ETH', + id: 'ethereum', + price: 0.9999598743668833, + marketCap: 120194359.82507178, + allTimeHigh: 2.070186924097962, + allTimeLow: 0.00018374327407907974, + totalVolume: 5495085.267342095, + high1d: 1.022994674939226, + low1d: 0.9882430202069277, + circulatingSupply: 120317181.32366, + dilutedMarketCap: 120194359.82507178, + marketCapPercentChange1d: -1.46534, + priceChange1d: -43.27897193472654, + pricePercentChange1h: 0.39406716228961414, + pricePercentChange1d: -1.8035792813549656, + }, + '0x6B175474E89094C44Da98b954EedeAC495271d0F': { + tokenAddress: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + currency: 'ETH', + id: 'dai', + price: 0.00042436994422149745, + marketCap: 2179091.2357524647, + allTimeHigh: 0.0005177313319502269, + allTimeLow: 0.0003742773160055919, + totalVolume: 25770.310026921918, + high1d: 0.00042564305405416193, + low1d: 0.000422254035679609, + circulatingSupply: 5131139277.03183, + dilutedMarketCap: 2179157.495602445, + marketCapPercentChange1d: -2.78163, + priceChange1d: -0.000450570064429501, + pricePercentChange1h: 0.044140824068107716, + pricePercentChange1d: -0.045030461437871275, + }, + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': { + tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + currency: 'ETH', + id: 'usd-coin', + price: 0.00042436994422149745, + marketCap: 14845337.78504687, + allTimeHigh: 0.000496512834739152, + allTimeLow: 0.00037244700843616456, + totalVolume: 2995848.8988073817, + high1d: 0.0004252186841099404, + low1d: 0.00042304081755619566, + circulatingSupply: 34942418774.2545, + dilutedMarketCap: 14849047.51464122, + marketCapPercentChange1d: 0.25951, + priceChange1d: -0.000469409459860959, + }, + }); + const expectedAmountChange = '-$0.39'; + const expectedPercentageChange = '(-1.09%)'; + render(); + const percentageElement = screen.getByText(expectedPercentageChange); + const numberElement = screen.getByText(expectedAmountChange); + expect(percentageElement).toBeInTheDocument(); + expect(numberElement).toBeInTheDocument(); + }); + it.only('should display correct aggregated amount and percentage when the native fiatBalance is undefined', () => { + (useAccountTotalFiatBalance as jest.Mock).mockReturnValue({ + orderedTokenList: [ + { + iconUrl: './images/eth_logo.svg', + symbol: 'ETH', + }, + { + symbol: 'USDC', + decimals: 6, + occurrences: 16, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png', + address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + name: 'USDC', + balance: '11411142', + string: '11.41114', + balanceError: null, + fiatBalance: '11.4', + }, + { + symbol: 'DAI', + decimals: 18, + occurrences: 17, + iconUrl: + 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x6b175474e89094c44da98b954eedeac495271d0f.png', + address: '0x6b175474e89094c44da98b954eedeac495271d0f', + name: 'Dai Stablecoin', + balance: '3000000000000000000', + string: '3', + balanceError: null, + fiatBalance: '20', + }, + ], + totalFiatBalance: 31.4, + }); + mockGetTOkensMarketData.mockReturnValue({ + '0x0000000000000000000000000000000000000000': { + tokenAddress: '0x0000000000000000000000000000000000000000', + currency: 'ETH', + id: 'ethereum', + price: 0.9999598743668833, + marketCap: 120194359.82507178, + allTimeHigh: 2.070186924097962, + allTimeLow: 0.00018374327407907974, + totalVolume: 5495085.267342095, + high1d: 1.022994674939226, + low1d: 0.9882430202069277, + circulatingSupply: 120317181.32366, + dilutedMarketCap: 120194359.82507178, + marketCapPercentChange1d: -1.46534, + priceChange1d: -43.27897193472654, + pricePercentChange1h: 0.39406716228961414, + pricePercentChange1d: -1.8035792813549656, + }, + '0x6B175474E89094C44Da98b954EedeAC495271d0F': { + tokenAddress: '0x6B175474E89094C44Da98b954EedeAC495271d0F', + currency: 'ETH', + id: 'dai', + price: 0.00042436994422149745, + marketCap: 2179091.2357524647, + allTimeHigh: 0.0005177313319502269, + allTimeLow: 0.0003742773160055919, + totalVolume: 25770.310026921918, + high1d: 0.00042564305405416193, + low1d: 0.000422254035679609, + circulatingSupply: 5131139277.03183, + dilutedMarketCap: 2179157.495602445, + marketCapPercentChange1d: -2.78163, + priceChange1d: -0.000450570064429501, + pricePercentChange1h: 0.044140824068107716, + pricePercentChange1d: -0.045030461437871275, + }, + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': { + tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + currency: 'ETH', + id: 'usd-coin', + price: 0.00042436994422149745, + marketCap: 14845337.78504687, + allTimeHigh: 0.000496512834739152, + allTimeLow: 0.00037244700843616456, + totalVolume: 2995848.8988073817, + high1d: 0.0004252186841099404, + low1d: 0.00042304081755619566, + circulatingSupply: 34942418774.2545, + dilutedMarketCap: 14849047.51464122, + marketCapPercentChange1d: 0.25951, + priceChange1d: -0.000469409459860959, + }, + }); + const expectedAmountChange = '-$0.01'; + const expectedPercentageChange = '(-0.03%)'; + render(); + const percentageElement = screen.getByText(expectedPercentageChange); + const numberElement = screen.getByText(expectedAmountChange); + expect(percentageElement).toBeInTheDocument(); + expect(numberElement).toBeInTheDocument(); + }); +}); diff --git a/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx b/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx new file mode 100644 index 000000000000..f5e76630c86d --- /dev/null +++ b/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx @@ -0,0 +1,131 @@ +import React from 'react'; +import { useSelector } from 'react-redux'; + +import { zeroAddress } from 'ethereumjs-util'; +import { + getCurrentCurrency, + getSelectedAccount, + getShouldHideZeroBalanceTokens, + getTokensMarketData, +} from '../../../selectors'; + +import { useAccountTotalFiatBalance } from '../../../hooks/useAccountTotalFiatBalance'; +import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils'; +import { formatValue, isValidAmount } from '../../../../app/scripts/lib/util'; +import { getIntlLocale } from '../../../ducks/locale/locale'; +import { + Display, + TextColor, + TextVariant, + FontWeight, +} from '../../../helpers/constants/design-system'; +import { Box, Text } from '../../component-library'; + +export const AggregatedPercentageOverview = () => { + const tokensMarketData = useSelector(getTokensMarketData); + const locale = useSelector(getIntlLocale); + const fiatCurrency = useSelector(getCurrentCurrency); + const selectedAccount = useSelector(getSelectedAccount); + const shouldHideZeroBalanceTokens = useSelector( + getShouldHideZeroBalanceTokens, + ); + // Get total balance (native + tokens) + const { totalFiatBalance, orderedTokenList } = useAccountTotalFiatBalance( + selectedAccount, + shouldHideZeroBalanceTokens, + ); + + let totalFiat1dAgo = 0; + orderedTokenList.forEach((token) => { + if (token.address) { + // This is a regular ERC20 token + // find the relevant pricePercentChange1d in tokensMarketData + // Iterate through the keys of the record + let found; + for (const key in tokensMarketData) { + if ( + isEqualCaseInsensitive( + tokensMarketData[key].tokenAddress, + token.address, + ) + ) { + found = tokensMarketData[key]; + } + } + + const tokenFiat1dAgo = + found?.pricePercentChange1d !== undefined && token?.fiatBalance + ? token?.fiatBalance / (1 + found?.pricePercentChange1d / 100) + : token?.fiatBalance ?? 0; + + totalFiat1dAgo += Number(tokenFiat1dAgo); + } else { + // native token + const nativePricePercentChange1d = + tokensMarketData?.[zeroAddress()]?.pricePercentChange1d; + + const nativeFiat1dAgo = + nativePricePercentChange1d !== undefined && token?.fiatBalance + ? token.fiatBalance / (1 + nativePricePercentChange1d / 100) + : token?.fiatBalance ?? 0; + + totalFiat1dAgo += Number(nativeFiat1dAgo); + } + }); + + const totalBalance: number = Number(totalFiatBalance); + const totalBalance1dAgo = totalFiat1dAgo; + + const amountChange = totalBalance - totalBalance1dAgo; + const percentageChange = (amountChange / totalBalance1dAgo) * 100 || 0; + + const formattedPercentChange = formatValue( + amountChange === 0 ? 0 : percentageChange, + true, + ); + + const formattedAmountChange = isValidAmount(amountChange) + ? `${(amountChange as number) >= 0 ? '+' : ''}${Intl.NumberFormat(locale, { + notation: 'compact', + compactDisplay: 'short', + style: 'currency', + currency: fiatCurrency, + maximumFractionDigits: 2, + }).format(amountChange as number)} ` + : ''; + + let color = TextColor.textDefault; + + if (isValidAmount(amountChange)) { + if ((amountChange as number) === 0) { + color = TextColor.textDefault; + } else if ((amountChange as number) > 0) { + color = TextColor.successDefault; + } else { + color = TextColor.errorDefault; + } + } + return ( + + + {formattedAmountChange} + + + {formattedPercentChange} + + + ); +}; diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 0089f06df142..1347afc7ad6f 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -20,6 +20,9 @@ import { getDataCollectionForMarketing, getMetaMetricsId, getParticipateInMetaMetrics, + getPreferences, + getSelectedAccount, + getShouldHideZeroBalanceTokens, getTokensMarketData, ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) SwapsEthToken, @@ -29,8 +32,10 @@ import Spinner from '../../ui/spinner'; import { PercentageAndAmountChange } from '../../multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change'; import { getMultichainIsEvm } from '../../../selectors/multichain'; +import { useAccountTotalFiatBalance } from '../../../hooks/useAccountTotalFiatBalance'; import WalletOverview from './wallet-overview'; import CoinButtons from './coin-buttons'; +import { AggregatedPercentageOverview } from './aggregated-percentage-overview'; export type CoinOverviewProps = { balance: string; @@ -76,6 +81,20 @@ export const CoinOverview = ({ const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics); const isMarketingEnabled = useSelector(getDataCollectionForMarketing); + const selectedAccount = useSelector(getSelectedAccount); + const shouldHideZeroBalanceTokens = useSelector( + getShouldHideZeroBalanceTokens, + ); + const { totalFiatBalance } = useAccountTotalFiatBalance( + selectedAccount, + shouldHideZeroBalanceTokens, + ); + + const { showNativeTokenAsMainBalance } = useSelector(getPreferences); + const balanceToDisplay = showNativeTokenAsMainBalance + ? balance + : totalFiatBalance; + const isEvm = useSelector(getMultichainIsEvm); const tokensMarketData = useSelector(getTokensMarketData); @@ -99,6 +118,20 @@ export const CoinOverview = ({ }); }, [isMarketingEnabled, isMetaMetricsEnabled, metaMetricsId, trackEvent]); + const renderPercentageAndAmountChange = () => { + if (isEvm) { + if (showNativeTokenAsMainBalance) { + return ( + + ); + } + return ; + } + return null; + }; + return (
- {balance ? ( + {balanceToDisplay ? ( ) : ( @@ -143,11 +179,7 @@ export const CoinOverview = ({ )}
- {isEvm && ( - - )} + {renderPercentageAndAmountChange()}
} diff --git a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx index 6bcde93f6a49..2d4a7341cad4 100644 --- a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx +++ b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx @@ -26,7 +26,7 @@ import { isValidAmount, } from '../../../../../../app/scripts/lib/util'; -const renderPercentageWithNumber = ( +export const renderPercentageWithNumber = ( value: string, formattedValuePrice: string, color: TextColor, diff --git a/ui/components/ui/currency-display/currency-display.component.js b/ui/components/ui/currency-display/currency-display.component.js index 15b40ecd8ae5..ca9322661d79 100644 --- a/ui/components/ui/currency-display/currency-display.component.js +++ b/ui/components/ui/currency-display/currency-display.component.js @@ -32,6 +32,7 @@ export default function CurrencyDisplay({ prefixComponentWrapperProps = {}, textProps = {}, suffixProps = {}, + isAggregatedFiatOverviewBalance = false, ...props }) { const [title, parts] = useCurrencyDisplay(value, { @@ -43,6 +44,7 @@ export default function CurrencyDisplay({ denomination, currency, suffix, + isAggregatedFiatOverviewBalance, }); return ( @@ -112,6 +114,7 @@ const CurrencyDisplayPropTypes = { prefixComponentWrapperProps: PropTypes.object, textProps: PropTypes.object, suffixProps: PropTypes.object, + isAggregatedFiatOverviewBalance: PropTypes.bool, }; CurrencyDisplay.propTypes = CurrencyDisplayPropTypes; diff --git a/ui/hooks/useCurrencyDisplay.js b/ui/hooks/useCurrencyDisplay.js index a7798d5ff10e..2a486d204774 100644 --- a/ui/hooks/useCurrencyDisplay.js +++ b/ui/hooks/useCurrencyDisplay.js @@ -135,6 +135,7 @@ export function useCurrencyDisplay( numberOfDecimals, denomination, currency, + isAggregatedFiatOverviewBalance, ...opts }, ) { @@ -151,6 +152,7 @@ export function useCurrencyDisplay( getMultichainConversionRate, account, ); + const isUserPreferredCurrency = currency === currentCurrency; const isNativeCurrency = currency === nativeCurrency; @@ -172,6 +174,10 @@ export function useCurrencyDisplay( }); } + if (isAggregatedFiatOverviewBalance) { + return inputValue; + } + return formatEthCurrencyDisplay({ isNativeCurrency, isUserPreferredCurrency, @@ -194,6 +200,7 @@ export function useCurrencyDisplay( denomination, numberOfDecimals, currentCurrency, + isAggregatedFiatOverviewBalance, ]); let suffix; From d00f2d31542cae5d2879561a07805bb6b06de8d5 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Fri, 13 Sep 2024 17:14:12 +0200 Subject: [PATCH 21/68] fix: aggregated balance ui initial commit --- app/_locales/en/messages.json | 7 + app/scripts/controllers/app-state.js | 11 + app/scripts/metamask-controller.js | 4 + .../app/wallet-overview/coin-buttons.tsx | 9 + .../app/wallet-overview/coin-overview.tsx | 220 +++++++++++++++--- ui/components/app/wallet-overview/index.scss | 40 +++- ui/components/ui/dropdown/dropdown.scss | 2 +- ui/components/ui/icon-button/icon-button.js | 6 +- ui/components/ui/icon-button/icon-button.scss | 12 +- .../ui/text-field/text-field.component.js | 5 +- ui/pages/home/index.scss | 7 + ui/pages/settings/index.scss | 12 +- .../settings-search/settings-search.js | 19 +- .../settings-tab/settings-tab.component.js | 10 +- .../settings-tab/settings-tab.container.js | 6 + ui/selectors/selectors.js | 5 + ui/store/actions.ts | 4 + 17 files changed, 316 insertions(+), 63 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 8515d7bf74a9..70760b75499a 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -396,6 +396,10 @@ "advancedPriorityFeeToolTip": { "message": "Priority fee (aka “miner tip”) goes directly to miners and incentivizes them to prioritize your transaction." }, + "aggregatedBalancePopover": { + "message": "This reflects the value of all tokens you own on a given network. If you prefer seeing this value in ETH or other currencies, go to $1.", + "description": "$1 represents the settings page" + }, "agreeTermsOfUse": { "message": "I agree to MetaMask's $1", "description": "$1 is the `terms` link" @@ -6535,6 +6539,9 @@ "yourBalance": { "message": "Your balance" }, + "yourBalanceIsAggregated": { + "message": "Your balance is aggregated" + }, "yourNFTmayBeAtRisk": { "message": "Your NFT may be at risk" }, diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 08b11facf9ca..4ede462bdccb 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -74,6 +74,7 @@ export default class AppStateController extends EventEmitter { // States used for displaying the changed network toast switchedNetworkDetails: null, switchedNetworkNeverShowMessage: false, + shouldShowAggregatedBalancePopover: true, // by default user should see popover; currentExtensionPopupId: 0, lastInteractedConfirmationInfo: undefined, }); @@ -465,6 +466,16 @@ export default class AppStateController extends EventEmitter { }); } + /** + * Sets shouldShowAggregatedBalancePopover to false once the user toggles + * the setting to show native token as main balance. + */ + setAggregatedBalancePopoverShown() { + this.store.updateState({ + shouldShowAggregatedBalancePopover: false, + }); + } + /** * Sets a property indicating the model of the user's Trezor hardware wallet * diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index be3f1d9c3228..5f8f8806bce3 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -3442,6 +3442,10 @@ export default class MetamaskController extends EventEmitter { appStateController.setSwitchedNetworkNeverShowMessage.bind( appStateController, ), + setAggregatedBalancePopoverShown: + appStateController.setAggregatedBalancePopoverShown.bind( + appStateController, + ), getLastInteractedConfirmationInfo: appStateController.getLastInteractedConfirmationInfo.bind( appStateController, diff --git a/ui/components/app/wallet-overview/coin-buttons.tsx b/ui/components/app/wallet-overview/coin-buttons.tsx index 1bd24c23ecdb..8baeecc0a0e6 100644 --- a/ui/components/app/wallet-overview/coin-buttons.tsx +++ b/ui/components/app/wallet-overview/coin-buttons.tsx @@ -78,6 +78,7 @@ const CoinButtons = ({ defaultSwapsToken, ///: END:ONLY_INCLUDE_IF classPrefix = 'coin', + iconButtonClassName = '', }: { chainId: `0x${string}` | CaipChainId | number; isSwapsChain: boolean; @@ -88,6 +89,7 @@ const CoinButtons = ({ defaultSwapsToken?: SwapsEthToken; ///: END:ONLY_INCLUDE_IF classPrefix?: string; + iconButtonClassName?: string; }) => { const t = useContext(I18nContext); const dispatch = useDispatch(); @@ -189,6 +191,7 @@ const CoinButtons = ({ <> } label={t('stake')} onClick={handleMmiStakingOnClick} @@ -196,6 +199,7 @@ const CoinButtons = ({ {mmiPortfolioEnabled && ( } @@ -306,6 +310,7 @@ const CoinButtons = ({ ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) } @@ -328,6 +333,7 @@ const CoinButtons = ({ { + setIsOpen(true); + }; + + const handleClick = () => { + // todo call dispatch here to isPopoverAlreadyShown to true + setIsOpen(!isOpen); + dispatch(setAggregatedBalancePopover()); + }; + + const [referenceElement, setReferenceElement] = useState(); + + const setBoxRef = (ref) => { + setReferenceElement(ref); + }; const handlePortfolioOnClick = useCallback(() => { const url = getPortfolioUrl( @@ -122,12 +167,51 @@ export const CoinOverview = ({ if (isEvm) { if (showNativeTokenAsMainBalance) { return ( - + + + + + {t('portfolio')} + + + + + ); } - return ; + return ( + + + + + {t('portfolio')} + + + + + + ); } return null; }; @@ -141,35 +225,100 @@ export const CoinOverview = ({ disabled={!balanceIsCached} >
-
- {t('portfolio')} - -
{balanceToDisplay ? ( - + <> + + + + {shouldShowPopover && // make this === null to correct behavior + !showNativeTokenAsMainBalance ? ( + + + + + {t('yourBalanceIsAggregated')} + + + + + + { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore: Expected 0-1 arguments, but got 2. + t('aggregatedBalancePopover', [ + + {t('settings')} + , + ]) + } + + + + ) : null} + ) : ( )} @@ -195,6 +344,7 @@ export const CoinOverview = ({ defaultSwapsToken, ///: END:ONLY_INCLUDE_IF classPrefix, + iconButtonClassName: `${classPrefix}-overview__icon-button`, }} /> } diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index cdeabdd18bdd..269f8d7d4914 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -3,11 +3,9 @@ .wallet-overview { display: flex; justify-content: space-between; - align-items: center; + align-items: start; flex: 1; - min-height: 209px; min-width: 0; - padding-top: 10px; flex-direction: column; width: 100%; @@ -16,15 +14,20 @@ display: flex; gap: 4px; flex-direction: column; - align-items: center; + align-items: start; width: 100%; } + &__icon_button { + margin-top: 0px !important; + } + &__buttons { display: flex; flex-direction: row; - height: 68px; - margin-bottom: 24px; + height: 100%; + margin-bottom: 16px; + padding: 0 16px; } &__portfolio_button { @@ -35,6 +38,12 @@ align-items: center; color: var(--color-primary-default); } + + &__currency-wrapper { + display: flex; + flex-direction: row; + gap: 10px; + } } %asset-buttons { @@ -57,12 +66,16 @@ min-width: 0; gap: 4px; position: relative; - align-items: center; + align-items: start; margin: 16px 0; padding: 0 16px; max-width: 326px; } + &__icon-button { + margin-top: 0px !important; + } + &__primary-container { display: flex; max-width: inherit; @@ -74,6 +87,8 @@ @include design-system.H2; color: var(--color-text-default); + + font-weight: 700; } &__cached-star { @@ -161,3 +176,14 @@ margin-right: 0; } } + +.balance-popover { + &__text { + font-size: 12px; + line-height: 20px; + letter-spacing: 0.25px; + } + &__container { + width: 248px !important; + } +} diff --git a/ui/components/ui/dropdown/dropdown.scss b/ui/components/ui/dropdown/dropdown.scss index 53e06559b541..395a61b68eee 100644 --- a/ui/components/ui/dropdown/dropdown.scss +++ b/ui/components/ui/dropdown/dropdown.scss @@ -3,7 +3,7 @@ .dropdown { position: relative; display: inline-block; - height: 36px; + height: 48px; &__select { appearance: none; diff --git a/ui/components/ui/icon-button/icon-button.js b/ui/components/ui/icon-button/icon-button.js index 326b77249950..8e4befdbc570 100644 --- a/ui/components/ui/icon-button/icon-button.js +++ b/ui/components/ui/icon-button/icon-button.js @@ -16,6 +16,7 @@ export default function IconButton(props) { label, tooltipRender, className, + iconButtonClassName = '', ...otherProps } = props; const renderWrapper = tooltipRender ?? defaultRender; @@ -31,7 +32,9 @@ export default function IconButton(props) { > {renderWrapper( <> -
{Icon}
+
+ {Icon} +
{label.length > 10 ? ( { return ( - + ); }; @@ -93,6 +107,7 @@ export default function SettingsSearch({ autoComplete="off" startAdornment={renderStartAdornment()} endAdornment={renderEndAdornment()} + theme="bordered" /> ); } diff --git a/ui/pages/settings/settings-tab/settings-tab.component.js b/ui/pages/settings/settings-tab/settings-tab.component.js index be5071785392..6782362492b0 100644 --- a/ui/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/pages/settings/settings-tab/settings-tab.component.js @@ -68,6 +68,8 @@ export default class SettingsTab extends PureComponent { tokenList: PropTypes.object, theme: PropTypes.string, setTheme: PropTypes.func, + hideAggregatedBalancePopover: PropTypes.func, + shouldShowAggregatedBalancePopover: PropTypes.bool, }; settingsRefs = Array( @@ -117,7 +119,6 @@ export default class SettingsTab extends PureComponent { options={currencyOptions} selectedOption={currentCurrency} onChange={(newCurrency) => setCurrentCurrency(newCurrency)} - className="settings-page__content-item__dropdown" />
@@ -232,7 +233,7 @@ export default class SettingsTab extends PureComponent { {t('accountIdenticon')} @@ -314,6 +315,8 @@ export default class SettingsTab extends PureComponent { renderShowNativeTokenAsMainBalance() { const { t } = this.context; + const { hideAggregatedBalancePopover, shouldShowAggregatedBalancePopover } = + this.props; const geShowNativeTokenAsMainBalanceForMetrics = (value) => { this.context.trackEvent({ category: MetaMetricsEventCategory.Settings, @@ -352,6 +355,9 @@ export default class SettingsTab extends PureComponent { className="show-native-token-as-main-balance" value={showNativeTokenAsMainBalance} onToggle={(value) => { + if (value && shouldShowAggregatedBalancePopover === true) { + hideAggregatedBalancePopover(); + } setShowNativeTokenAsMainBalancePreference(!value); geShowNativeTokenAsMainBalanceForMetrics(!value); }} diff --git a/ui/pages/settings/settings-tab/settings-tab.container.js b/ui/pages/settings/settings-tab/settings-tab.container.js index 7de17ffefde4..05ef25cb8240 100644 --- a/ui/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/pages/settings/settings-tab/settings-tab.container.js @@ -7,12 +7,14 @@ import { setParticipateInMetaMetrics, setTheme, setShowNativeTokenAsMainBalancePreference, + setAggregatedBalancePopover, } from '../../../store/actions'; import { getTokenList, getPreferences, getTheme, getSelectedInternalAccount, + getShouldShowAggregatedBalancePopover, } from '../../../selectors'; import { getProviderConfig } from '../../../ducks/metamask/metamask'; import SettingsTab from './settings-tab.component'; @@ -24,6 +26,8 @@ const mapStateToProps = (state) => { } = state; const { currentCurrency, useBlockie, currentLocale } = metamask; const { ticker: nativeCurrency } = getProviderConfig(state); + const shouldShowAggregatedBalancePopover = + getShouldShowAggregatedBalancePopover(state); const { address: selectedAddress } = getSelectedInternalAccount(state); const { hideZeroBalanceTokens, showNativeTokenAsMainBalance } = getPreferences(state); @@ -41,6 +45,7 @@ const mapStateToProps = (state) => { selectedAddress, tokenList, theme: getTheme(state), + shouldShowAggregatedBalancePopover, }; }; @@ -57,6 +62,7 @@ const mapDispatchToProps = (dispatch) => { setHideZeroBalanceTokens: (value) => dispatch(setHideZeroBalanceTokens(value)), setTheme: (val) => dispatch(setTheme(val)), + hideAggregatedBalancePopover: () => dispatch(setAggregatedBalancePopover()), }; }; diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 0cd7d62166b1..28e969d1674d 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -1542,6 +1542,11 @@ export const getConnectedSitesList = createDeepEqualSelector( }, ); +export function getShouldShowAggregatedBalancePopover(state) { + console.log('state.metamask', state.metamask); + return state.metamask.shouldShowAggregatedBalancePopover; +} + export const getConnectedSnapsList = createDeepEqualSelector( getSnapsList, (snapsData) => { diff --git a/ui/store/actions.ts b/ui/store/actions.ts index a4fccec06364..ed459bf55e5a 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -4840,6 +4840,10 @@ export function neverShowSwitchedNetworkMessage() { ]); } +export function setAggregatedBalancePopover() { + return submitRequestToBackground('setAggregatedBalancePopoverShown'); +} + /** * Sends the background state the networkClientId and domain upon network switch * From d73a11a23f35e43a9d1f6d667b4f3f725b255a15 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 09:51:58 +0200 Subject: [PATCH 22/68] fix: settings ui fixes --- .../settings-search/settings-search.js | 22 ++++++++----------- .../settings-tab/settings-tab.component.js | 13 +++++------ 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/ui/pages/settings/settings-search/settings-search.js b/ui/pages/settings/settings-search/settings-search.js index a1343a56e42a..b105e09da698 100644 --- a/ui/pages/settings/settings-search/settings-search.js +++ b/ui/pages/settings/settings-search/settings-search.js @@ -4,7 +4,6 @@ import Fuse from 'fuse.js'; import InputAdornment from '@material-ui/core/InputAdornment'; import TextField from '../../../components/ui/text-field'; import { I18nContext } from '../../../contexts/i18n'; -import SearchIcon from '../../../components/ui/icon/search-icon'; import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils'; import { Icon, @@ -21,13 +20,8 @@ export default function SettingsSearch({ const t = useContext(I18nContext); const [searchQuery, setSearchQuery] = useState(''); - const [searchIconColor, setSearchIconColor] = useState( - 'var(--color-icon-muted)', - ); - const [searchIconColorV2, setSearchIconColorV2] = useState( - IconColor.iconMuted, - ); + const [searchIconColor, setSearchIconColor] = useState(IconColor.iconMuted); const settingsRoutesListArray = Object.values(settingsRoutesList); const settingsSearchFuse = new Fuse(settingsRoutesListArray, { @@ -45,11 +39,9 @@ export default function SettingsSearch({ const sanitizedSearchQuery = _searchQuery.trimStart(); setSearchQuery(sanitizedSearchQuery); if (sanitizedSearchQuery === '') { - setSearchIconColor('var(--color-icon-muted)'); - setSearchIconColorV2(IconColor.iconMuted); + setSearchIconColor(IconColor.iconMuted); } else { - setSearchIconColor('var(--color-icon-default)'); - setSearchIconColorV2(IconColor.iconDefault); + setSearchIconColor(IconColor.iconDefault); } const fuseSearchResult = settingsSearchFuse.search(sanitizedSearchQuery); @@ -71,7 +63,7 @@ export default function SettingsSearch({ ); @@ -87,7 +79,11 @@ export default function SettingsSearch({ onClick={() => handleSearch('')} style={{ cursor: 'pointer' }} > - + )} diff --git a/ui/pages/settings/settings-tab/settings-tab.component.js b/ui/pages/settings/settings-tab/settings-tab.component.js index 6782362492b0..fd6e58c39260 100644 --- a/ui/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/pages/settings/settings-tab/settings-tab.component.js @@ -104,12 +104,11 @@ export default class SettingsTab extends PureComponent {
{t('currencyConversion')} - {/* {t('currencyConversion')} */}
@@ -144,7 +143,7 @@ export default class SettingsTab extends PureComponent {
{t('currentLanguage')} @@ -186,7 +185,7 @@ export default class SettingsTab extends PureComponent {
{t('hideZeroBalanceTokens')} @@ -227,7 +226,7 @@ export default class SettingsTab extends PureComponent {
{t('accountIdenticon')} @@ -343,7 +342,7 @@ export default class SettingsTab extends PureComponent {
{t('showNativeTokenAsMainBalance')} @@ -407,7 +406,7 @@ export default class SettingsTab extends PureComponent {
{this.context.t('theme')} From 6194ba19c1bd25a2894cceb6a894d2ef7f1ecd0d Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 11:38:10 +0200 Subject: [PATCH 23/68] fix: lint --- .storybook/test-data.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.storybook/test-data.js b/.storybook/test-data.js index 08a9e7db2ba1..90fa63a6cc7b 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -1236,8 +1236,7 @@ const state = { chainId: '0x539', ticker: 'ETH', nickname: 'Localhost 8545', - }, - ), + }), accountTokens: { '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': { '0x1': [ From 4b9e54878fdb76fd73276d35cda2cbdab5e20cb1 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 11:39:18 +0200 Subject: [PATCH 24/68] fix: fix after merge conflicts --- app/scripts/lib/backup.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/scripts/lib/backup.test.js b/app/scripts/lib/backup.test.js index 9253ebbfcd94..947761449a36 100644 --- a/app/scripts/lib/backup.test.js +++ b/app/scripts/lib/backup.test.js @@ -168,6 +168,7 @@ const jsonData = JSON.stringify({ showFiatInTestnets: false, showTestNetworks: true, smartTransactionsOptInStatus: false, + useNativeCurrencyAsPrimaryCurrency: true, }, ipfsGateway: 'dweb.link', ledgerTransportType: 'webhid', From 96168883e9783af4bf9e863b2ccbfd0aa8d38514 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 11:42:23 +0200 Subject: [PATCH 25/68] fix: fix after merge conflicts --- .../transaction-breakdown.component.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js index 4a7c1b6c9f32..3d5405b57eb5 100644 --- a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js +++ b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js @@ -189,12 +189,12 @@ export default class TransactionBreakdown extends PureComponent { denomination={EtherDenomination.ETH} numberOfDecimals={6} value={hexGasTotal} - showNative + type={PRIMARY} /> {showFiat && ( )} @@ -212,13 +212,11 @@ export default class TransactionBreakdown extends PureComponent { numberOfDecimals={9} value={maxFeePerGas} type={PRIMARY} - showNative /> {showFiat && ( )} @@ -232,13 +230,11 @@ export default class TransactionBreakdown extends PureComponent { numberOfDecimals={18} value={l1HexGasTotal} type={PRIMARY} - showNative /> {showFiat && ( )} @@ -248,7 +244,6 @@ export default class TransactionBreakdown extends PureComponent { @@ -256,7 +251,6 @@ export default class TransactionBreakdown extends PureComponent { )} From cfa53b688fa8568c73432cf2e2ce3c20206fc062 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 12:37:16 +0200 Subject: [PATCH 26/68] fix: fix after merge conflicts --- ui/hooks/useUserPreferencedCurrency.js | 8 -------- .../confirm-encryption-public-key.component.js | 1 - .../confirm-encryption-public-key.container.js | 1 - 3 files changed, 10 deletions(-) diff --git a/ui/hooks/useUserPreferencedCurrency.js b/ui/hooks/useUserPreferencedCurrency.js index 37fb48f94011..5761323eef61 100644 --- a/ui/hooks/useUserPreferencedCurrency.js +++ b/ui/hooks/useUserPreferencedCurrency.js @@ -85,11 +85,3 @@ export function useUserPreferencedCurrency(type, opts = {}) { } return type === PRIMARY ? fiatReturn : nativeReturn; } - -/* -if ((withCheck && showNat) || !withCheck) { - return primary ? native : fiat; -} else { - return primary ? fiat : native; -} -*/ diff --git a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js index 9fe11727e87d..dd84bea68360 100644 --- a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js +++ b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js @@ -11,7 +11,6 @@ import SiteOrigin from '../../components/ui/site-origin'; import { Numeric } from '../../../shared/modules/Numeric'; import { EtherDenomination } from '../../../shared/constants/common'; -// This component is only being used in stories and test file export default class ConfirmEncryptionPublicKey extends Component { static contextTypes = { t: PropTypes.func.isRequired, diff --git a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js index 9a7ff5705d76..554ba41fdaa4 100644 --- a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js +++ b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js @@ -18,7 +18,6 @@ import { getMostRecentOverviewPage } from '../../ducks/history/history'; import { getNativeCurrency } from '../../ducks/metamask/metamask'; import ConfirmEncryptionPublicKey from './confirm-encryption-public-key.component'; -// Removing usage of useNativeCurrencyAsPrimaryCurrency because component ConfirmEncryptionPublicKey is not function mapStateToProps(state) { const { metamask: { subjectMetadata = {} }, From f1308eec5bd1c2cb50e522b7621142a861d89973 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 14:09:23 +0200 Subject: [PATCH 27/68] fix: fix test --- .../customize-nonce/__snapshots__/customize-nonce.test.js.snap | 2 +- ui/components/app/wallet-overview/coin-overview.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap b/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap index cab80e399a43..020adaa0c952 100644 --- a/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap +++ b/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap @@ -75,7 +75,7 @@ exports[`Customize Nonce should match snapshot 1`] = ` class="MuiFormControl-root MuiTextField-root MuiFormControl-marginDense MuiFormControl-fullWidth" >
From a065d714acecb5d2301b077092bf44c8c3933068 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 14:23:45 +0200 Subject: [PATCH 28/68] fix: fix test snapshot --- .../__snapshots__/searchable-item-list.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 651c33786acc..f5e215c9fa5e 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 @@ -5,7 +5,7 @@ exports[`SearchableItemList renders the component with initial props 1`] = ` class="MuiFormControl-root MuiTextField-root searchable-item-list__search MuiFormControl-fullWidth" >
Date: Mon, 16 Sep 2024 14:46:00 +0200 Subject: [PATCH 29/68] fix: fix duplicate button --- .../app/wallet-overview/coin-buttons.tsx | 19 +------------------ .../app/wallet-overview/coin-overview.tsx | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-buttons.tsx b/ui/components/app/wallet-overview/coin-buttons.tsx index 21479da23540..82890f39c257 100644 --- a/ui/components/app/wallet-overview/coin-buttons.tsx +++ b/ui/components/app/wallet-overview/coin-buttons.tsx @@ -332,24 +332,6 @@ const CoinButtons = ({ renderInstitutionalButtons() ///: END:ONLY_INCLUDE_IF } - - - } - disabled={!isSigningEnabled} - label={t('send')} - onClick={handleSendOnClick} - tooltipRender={(contents: React.ReactElement) => - generateTooltip('sendButton', contents) - } - /> Date: Mon, 16 Sep 2024 14:54:52 +0200 Subject: [PATCH 30/68] fix: fix --- .../__snapshots__/dropdown-input-pair.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pages/swaps/dropdown-input-pair/__snapshots__/dropdown-input-pair.test.js.snap b/ui/pages/swaps/dropdown-input-pair/__snapshots__/dropdown-input-pair.test.js.snap index 01a3a89ad4c5..d58907ed2684 100644 --- a/ui/pages/swaps/dropdown-input-pair/__snapshots__/dropdown-input-pair.test.js.snap +++ b/ui/pages/swaps/dropdown-input-pair/__snapshots__/dropdown-input-pair.test.js.snap @@ -5,7 +5,7 @@ exports[`DropdownInputPair renders the component with initial props 1`] = ` class="MuiFormControl-root MuiTextField-root dropdown-input-pair__input MuiFormControl-marginDense MuiFormControl-fullWidth" >
Date: Mon, 16 Sep 2024 15:03:25 +0200 Subject: [PATCH 31/68] fix: fix snapshot --- .../security-tab/__snapshots__/security-tab.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap index e19480ebd7b0..4ef51140155c 100644 --- a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap +++ b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap @@ -1277,7 +1277,7 @@ exports[`Security Tab should match snapshot 1`] = ` class="MuiFormControl-root MuiTextField-root MuiFormControl-marginDense MuiFormControl-fullWidth" >
Date: Mon, 16 Sep 2024 15:04:29 +0200 Subject: [PATCH 32/68] fix: fix snapshot --- .../__snapshots__/advanced-tab.component.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap index fcc11ec8336b..6318abd37570 100644 --- a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap +++ b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap @@ -501,7 +501,7 @@ exports[`AdvancedTab Component should match snapshot 1`] = ` class="MuiFormControl-root MuiTextField-root MuiFormControl-marginDense MuiFormControl-fullWidth" >
Date: Mon, 16 Sep 2024 15:19:13 +0200 Subject: [PATCH 33/68] fix: fix classnames --- ui/components/ui/icon-button/icon-button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/ui/icon-button/icon-button.js b/ui/components/ui/icon-button/icon-button.js index cc4cb8c200e7..30b14c0aa205 100644 --- a/ui/components/ui/icon-button/icon-button.js +++ b/ui/components/ui/icon-button/icon-button.js @@ -34,7 +34,7 @@ export default function IconButton(props) { <>
{Icon}
From c70a448de953b44f3804c5ae9f6bcce1364bc7d6 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 16:53:15 +0200 Subject: [PATCH 34/68] fix: fix e2e --- test/e2e/tests/transaction/send-eth.spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e/tests/transaction/send-eth.spec.js b/test/e2e/tests/transaction/send-eth.spec.js index 5c49bba0cf4e..c1179b68316e 100644 --- a/test/e2e/tests/transaction/send-eth.spec.js +++ b/test/e2e/tests/transaction/send-eth.spec.js @@ -189,7 +189,9 @@ describe('Send ETH', function () { const balance = await driver.findElement( '[data-testid="eth-overview__primary-currency"]', ); - assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); + + assert.ok(/^[\d.]+ETH$/u.test(await balance.getText())); + await driver.clickElement( '[data-testid="account-overview__activity-tab"]', ); From 4835961eefa7df5a86b99fc3c44d24bcfefba448 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 17:10:02 +0200 Subject: [PATCH 35/68] fix: fix e2e --- test/e2e/tests/transaction/send-eth.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/tests/transaction/send-eth.spec.js b/test/e2e/tests/transaction/send-eth.spec.js index c1179b68316e..21da51b60622 100644 --- a/test/e2e/tests/transaction/send-eth.spec.js +++ b/test/e2e/tests/transaction/send-eth.spec.js @@ -222,7 +222,7 @@ describe('Send ETH', function () { const balance = await driver.findElement( '[data-testid="eth-overview__primary-currency"]', ); - assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); + assert.ok(/^[\d.]+ETH$/u.test(await balance.getText())); await openActionMenuAndStartSendFlow(driver); // choose to scan via QR code @@ -439,7 +439,7 @@ describe('Send ETH', function () { const balance = await driver.findElement( '[data-testid="eth-overview__primary-currency"]', ); - assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); + assert.ok(/^[\d.]+ETH$/u.test(await balance.getText())); await openActionMenuAndStartSendFlow(driver); From bb44f6fd09a48e31fb7e86c0f5c226657f491af3 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 17:32:23 +0200 Subject: [PATCH 36/68] fix: fix e2e --- .../errors-after-init-opt-in-background-state.json | 1 + .../state-snapshots/errors-after-init-opt-in-ui-state.json | 1 + 2 files changed, 2 insertions(+) diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json index dc9fa4906b8e..4579001bf8f9 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json @@ -29,6 +29,7 @@ "fullScreenGasPollTokens": "object", "recoveryPhraseReminderHasBeenShown": true, "recoveryPhraseReminderLastShown": "number", + "shouldShowAggregatedBalancePopover": "boolean", "outdatedBrowserWarningLastShown": "object", "nftsDetectionNoticeDismissed": false, "showTestnetMessageInDropdown": true, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json index 82715b80da67..ef4481b47d71 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -87,6 +87,7 @@ "currentMigrationVersion": "number", "balances": "object", "selectedNetworkClientId": "string", + "shouldShowAggregatedBalancePopover": "boolean", "networksMetadata": { "networkConfigurationId": { "EIPS": { "1559": false }, From 5a74891f58bfb8bb64e878d27fb6c21196810fb7 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 19:44:52 +0200 Subject: [PATCH 37/68] fix: fix settings --- test/e2e/tests/settings/account-token-list.spec.js | 2 +- ui/pages/settings/settings-tab/settings-tab.component.js | 7 ------- ui/pages/settings/settings-tab/settings-tab.container.js | 6 ------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/test/e2e/tests/settings/account-token-list.spec.js b/test/e2e/tests/settings/account-token-list.spec.js index c9b8d218bdf7..268d5a42d2a1 100644 --- a/test/e2e/tests/settings/account-token-list.spec.js +++ b/test/e2e/tests/settings/account-token-list.spec.js @@ -78,7 +78,7 @@ describe('Settings', function () { const tokenListAmount = await driver.findElement( '.eth-overview__primary-container', ); - assert.equal(await tokenListAmount.getText(), '$42,500.00\nUSD'); + assert.equal(await tokenListAmount.getText(), '$42,500.00USD'); await driver.clickElement('[data-testid="account-menu-icon"]'); const accountTokenValue = await driver.waitForSelector( '.multichain-account-list-item .multichain-account-list-item__asset', diff --git a/ui/pages/settings/settings-tab/settings-tab.component.js b/ui/pages/settings/settings-tab/settings-tab.component.js index 5929ea420608..c1bf514d7dc1 100644 --- a/ui/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/pages/settings/settings-tab/settings-tab.component.js @@ -68,8 +68,6 @@ export default class SettingsTab extends PureComponent { tokenList: PropTypes.object, theme: PropTypes.string, setTheme: PropTypes.func, - hideAggregatedBalancePopover: PropTypes.func, - shouldShowAggregatedBalancePopover: PropTypes.bool, }; settingsRefs = Array( @@ -316,8 +314,6 @@ export default class SettingsTab extends PureComponent { renderShowNativeTokenAsMainBalance() { const { t } = this.context; - const { hideAggregatedBalancePopover, shouldShowAggregatedBalancePopover } = - this.props; const geShowNativeTokenAsMainBalanceForMetrics = (value) => { this.context.trackEvent({ category: MetaMetricsEventCategory.Settings, @@ -356,9 +352,6 @@ export default class SettingsTab extends PureComponent { className="show-native-token-as-main-balance" value={showNativeTokenAsMainBalance} onToggle={(value) => { - if (value && shouldShowAggregatedBalancePopover === true) { - hideAggregatedBalancePopover(); - } setShowNativeTokenAsMainBalancePreference(!value); geShowNativeTokenAsMainBalanceForMetrics(!value); }} diff --git a/ui/pages/settings/settings-tab/settings-tab.container.js b/ui/pages/settings/settings-tab/settings-tab.container.js index 05ef25cb8240..7de17ffefde4 100644 --- a/ui/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/pages/settings/settings-tab/settings-tab.container.js @@ -7,14 +7,12 @@ import { setParticipateInMetaMetrics, setTheme, setShowNativeTokenAsMainBalancePreference, - setAggregatedBalancePopover, } from '../../../store/actions'; import { getTokenList, getPreferences, getTheme, getSelectedInternalAccount, - getShouldShowAggregatedBalancePopover, } from '../../../selectors'; import { getProviderConfig } from '../../../ducks/metamask/metamask'; import SettingsTab from './settings-tab.component'; @@ -26,8 +24,6 @@ const mapStateToProps = (state) => { } = state; const { currentCurrency, useBlockie, currentLocale } = metamask; const { ticker: nativeCurrency } = getProviderConfig(state); - const shouldShowAggregatedBalancePopover = - getShouldShowAggregatedBalancePopover(state); const { address: selectedAddress } = getSelectedInternalAccount(state); const { hideZeroBalanceTokens, showNativeTokenAsMainBalance } = getPreferences(state); @@ -45,7 +41,6 @@ const mapStateToProps = (state) => { selectedAddress, tokenList, theme: getTheme(state), - shouldShowAggregatedBalancePopover, }; }; @@ -62,7 +57,6 @@ const mapDispatchToProps = (dispatch) => { setHideZeroBalanceTokens: (value) => dispatch(setHideZeroBalanceTokens(value)), setTheme: (val) => dispatch(setTheme(val)), - hideAggregatedBalancePopover: () => dispatch(setAggregatedBalancePopover()), }; }; From 72603c318851564a8d8a542a9e908e0efbe5e618 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 19:50:38 +0200 Subject: [PATCH 38/68] fix: fix close icon color --- ui/components/app/wallet-overview/coin-overview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 3f92eb5b0eba..e827e36de864 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -286,7 +286,7 @@ export const CoinOverview = ({ Date: Mon, 16 Sep 2024 19:59:53 +0200 Subject: [PATCH 39/68] fix: rm popover when user clicks on settings --- ui/components/app/wallet-overview/coin-overview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index e827e36de864..3027bfcc2fee 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -311,8 +311,8 @@ export const CoinOverview = ({ }} as="a" href={`#${GENERAL_ROUTE}`} - // target="_blank" rel="noopener noreferrer" + onClick={handleClick} > {t('settings')} , From b65bc1da3f229a8d8e6f7f1037e673d608723778 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 20:14:14 +0200 Subject: [PATCH 40/68] fix: rm primary currency from settings search and make show native token setting searchable --- ui/helpers/constants/settings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index f4529ed1d6ad..569999f8900e 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -34,9 +34,9 @@ const SETTINGS_CONSTANTS = [ }, { tabMessage: (t) => t('general'), - sectionMessage: (t) => t('primaryCurrencySetting'), - descriptionMessage: (t) => t('primaryCurrencySettingDescription'), - route: `${GENERAL_ROUTE}#primary-currency`, + sectionMessage: (t) => t('showNativeTokenAsMainBalance'), + descriptionMessage: (t) => t('showNativeTokenAsMainBalance'), + route: `${GENERAL_ROUTE}#show-native-token-as-main-balance`, iconName: IconName.Setting, }, { From 00aab64d8e03e64bcb60b5ca40562956781e87d1 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Mon, 16 Sep 2024 21:22:44 +0200 Subject: [PATCH 41/68] fix: fix test --- test/e2e/tests/account/metamask-responsive-ui.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/tests/account/metamask-responsive-ui.spec.js b/test/e2e/tests/account/metamask-responsive-ui.spec.js index d9e9aa2f965c..c77bd6ae4566 100644 --- a/test/e2e/tests/account/metamask-responsive-ui.spec.js +++ b/test/e2e/tests/account/metamask-responsive-ui.spec.js @@ -75,7 +75,7 @@ describe('MetaMask Responsive UI', function () { const balance = await driver.findElement( '[data-testid="eth-overview__primary-currency"]', ); - assert.ok(/^0\sETH$/u.test(await balance.getText())); + assert.ok(/^0ETH$/u.test(await balance.getText())); }, ); }); From 05e181ba23ac86dfe206593d64ae6bee843bf87d Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 00:04:26 +0200 Subject: [PATCH 42/68] fix: css ui feedback --- .../app/wallet-overview/coin-overview.tsx | 70 ++++++++----------- ui/components/app/wallet-overview/index.scss | 8 +-- 2 files changed, 33 insertions(+), 45 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 3027bfcc2fee..29cb61c720f5 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -10,7 +10,6 @@ import { ButtonIconSize, ButtonLink, ButtonLinkSize, - Icon, IconName, IconSize, Popover, @@ -19,12 +18,10 @@ import { } from '../../component-library'; import { AlignItems, - BackgroundColor, Display, IconColor, JustifyContent, TextAlign, - TextColor, TextVariant, } from '../../../helpers/constants/design-system'; import { MetaMetricsContext } from '../../../contexts/metametrics'; @@ -58,6 +55,7 @@ import { getMultichainIsEvm } from '../../../selectors/multichain'; import { useAccountTotalFiatBalance } from '../../../hooks/useAccountTotalFiatBalance'; import { GENERAL_ROUTE } from '../../../helpers/constants/routes'; import { setAggregatedBalancePopover } from '../../../store/actions'; +import { useTheme } from '../../../hooks/useTheme'; import WalletOverview from './wallet-overview'; import CoinButtons from './coin-buttons'; import { AggregatedPercentageOverview } from './aggregated-percentage-overview'; @@ -106,6 +104,7 @@ export const CoinOverview = ({ const metaMetricsId = useSelector(getMetaMetricsId); const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics); const isMarketingEnabled = useSelector(getDataCollectionForMarketing); + const theme = useTheme(); const shouldShowPopover = useSelector(getShouldShowAggregatedBalancePopover); const isTestnet = useSelector(getIsTestnet); @@ -173,45 +172,44 @@ export const CoinOverview = ({ - - - {t('portfolio')} - - - - + {t('portfolio')} + ); } return ( - - - {t('portfolio')} - - - - + {t('portfolio')} + ); } @@ -260,15 +258,12 @@ export const CoinOverview = ({ position={PopoverPosition.BottomStart} // TODO check with design-team about this bottom start issue hasArrow flip - backgroundColor={BackgroundColor.overlayAlternative} // TODO check with DS on this opacity issue + data-theme={theme === 'light' ? 'dark' : 'light'} className="balance-popover__container" padding={3} onClickOutside={handleClick} onPressEscKey={handleClick} preventOverflow - style={{ - zIndex: 66, - }} > { diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index af8d24a456dd..eb829fa2270a 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -31,12 +31,7 @@ } &__portfolio_button { - display: flex; - flex-direction: row; - gap: 6px; - cursor: pointer; - align-items: center; - color: var(--color-primary-default); + margin-left: 6px; } &__currency-wrapper { @@ -185,5 +180,6 @@ &__container { width: 248px !important; + z-index: design-system.$modal-z-index; } } From 232a9c2ad7cc7b364a40984938dfd7bb3811514c Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 01:19:31 +0200 Subject: [PATCH 43/68] fix: css ui feedback --- ui/components/app/wallet-overview/index.scss | 1 - .../price/percentage-change/percentage-change.tsx | 2 +- ui/components/multichain/token-list-item/token-list-item.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index eb829fa2270a..5f895aa55702 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -59,7 +59,6 @@ display: flex; flex-direction: column; min-width: 0; - gap: 4px; position: relative; align-items: start; margin: 16px 0; diff --git a/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx b/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx index bec1857012b1..5393ccd5baa5 100644 --- a/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx +++ b/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx @@ -36,7 +36,7 @@ export const PercentageChange = ({ {primary} {isNativeCurrency ? '' : tokenSymbol} From 74b63f5a093fbc3f8462be0505cb71338907706d Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 01:19:58 +0200 Subject: [PATCH 44/68] fix: rm unused locales --- app/_locales/am/messages.json | 6 ------ app/_locales/ar/messages.json | 6 ------ app/_locales/bg/messages.json | 6 ------ app/_locales/bn/messages.json | 6 ------ app/_locales/ca/messages.json | 6 ------ app/_locales/da/messages.json | 6 ------ app/_locales/de/messages.json | 6 ------ app/_locales/el/messages.json | 6 ------ app/_locales/en/messages.json | 6 ------ app/_locales/en_GB/messages.json | 6 ------ app/_locales/es/messages.json | 6 ------ app/_locales/es_419/messages.json | 6 ------ app/_locales/et/messages.json | 6 ------ app/_locales/fa/messages.json | 6 ------ app/_locales/fi/messages.json | 6 ------ app/_locales/fil/messages.json | 6 ------ app/_locales/fr/messages.json | 6 ------ app/_locales/he/messages.json | 6 ------ app/_locales/hi/messages.json | 6 ------ app/_locales/hr/messages.json | 6 ------ app/_locales/ht/messages.json | 6 ------ app/_locales/hu/messages.json | 6 ------ app/_locales/id/messages.json | 6 ------ app/_locales/it/messages.json | 6 ------ app/_locales/ja/messages.json | 6 ------ app/_locales/kn/messages.json | 6 ------ app/_locales/ko/messages.json | 6 ------ app/_locales/lt/messages.json | 6 ------ app/_locales/lv/messages.json | 6 ------ app/_locales/ms/messages.json | 6 ------ app/_locales/no/messages.json | 6 ------ app/_locales/ph/messages.json | 6 ------ app/_locales/pl/messages.json | 6 ------ app/_locales/pt/messages.json | 6 ------ app/_locales/pt_BR/messages.json | 6 ------ app/_locales/ro/messages.json | 6 ------ app/_locales/ru/messages.json | 6 ------ app/_locales/sk/messages.json | 6 ------ app/_locales/sl/messages.json | 6 ------ app/_locales/sr/messages.json | 6 ------ app/_locales/sv/messages.json | 6 ------ app/_locales/sw/messages.json | 6 ------ app/_locales/tl/messages.json | 6 ------ app/_locales/tr/messages.json | 6 ------ app/_locales/uk/messages.json | 6 ------ app/_locales/vi/messages.json | 6 ------ app/_locales/zh_CN/messages.json | 6 ------ app/_locales/zh_TW/messages.json | 6 ------ 48 files changed, 288 deletions(-) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index 992cdc88e24a..3b06df1b6d7b 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -504,12 +504,6 @@ "prev": { "message": "የቀደመ" }, - "primaryCurrencySetting": { - "message": "ተቀዳሚ የገንዘብ ዓይነት" - }, - "primaryCurrencySettingDescription": { - "message": "ዋጋዎች በራሳቸው የሰንሰለት ገንዘብ ዓይነት (ለምሳሌ ETH) በቅድሚያ እንዲታዪ ይምረጡ። ዋጋዎች በተመረጠ የፊያት ገንዘብ ዓይነት እንዲታዩ ደግሞ ፊያትን ይምረጡ።" - }, "privacyMsg": { "message": "የግለኝነት መጠበቂያ ህግ" }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 0d00ae364528..593babd3a649 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -520,12 +520,6 @@ "prev": { "message": "السابق" }, - "primaryCurrencySetting": { - "message": "العملة الأساسية" - }, - "primaryCurrencySettingDescription": { - "message": "حدد خيار \"المحلية\" لتحديد أولويات عرض القيم بالعملة المحلية للسلسلة (مثلاً ETH). حدد Fiat لتحديد أولويات عرض القيم بعملات fiat المحددة الخاصة بك." - }, "privacyMsg": { "message": "سياسة الخصوصية" }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index fcd984be91b8..6c2888c608c5 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -519,12 +519,6 @@ "prev": { "message": "Предишен" }, - "primaryCurrencySetting": { - "message": "Основна валута" - }, - "primaryCurrencySettingDescription": { - "message": "Изберете местна, за да приоритизирате показването на стойности в основната валута на веригата (например ETH). Изберете Fiat, за да поставите приоритет на показването на стойности в избраната от вас fiat валута." - }, "privacyMsg": { "message": "Политика за поверителност" }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 15a5dbcbfd91..904d516766a7 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -513,12 +513,6 @@ "prev": { "message": "পূর্ববর্তী" }, - "primaryCurrencySetting": { - "message": "প্রাথমিক মুদ্রা" - }, - "primaryCurrencySettingDescription": { - "message": "চেনটিতে (যেমন ETH) দেশীয় মুদ্রায় মানগুলি প্রদর্শনকে অগ্রাধিকার দিতে দেশীয় নির্বাচন করুন। আপনার নির্দেশিত মুদ্রায় মানগুলির প্রদর্শনকে অগ্রাধিকার দিতে নির্দেশিত নির্বাচন করুন।" - }, "privacyMsg": { "message": "সম্মত হয়েছেন" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 10b6fdd4b0b8..55208e7a00d0 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -504,12 +504,6 @@ "personalAddressDetected": { "message": "Adreça personal detectada. Introduir l'adreça del contracte de fitxa." }, - "primaryCurrencySetting": { - "message": "Divisa principal" - }, - "primaryCurrencySettingDescription": { - "message": "Selecciona Natiu per a prioritzar la mostra de valors en la divisa nadiua de la cadena (p. ex. ETH). Selecciona Fiat per prioritzar la mostra de valors en la divisa fiduciària seleccionada." - }, "privacyMsg": { "message": "Política de privadesa" }, diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index fc619bbef0a0..910fc43b07d6 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -504,12 +504,6 @@ "prev": { "message": "Forrige" }, - "primaryCurrencySetting": { - "message": "Primær Valuta" - }, - "primaryCurrencySettingDescription": { - "message": "Vælg lokal for fortrinsvis at vise værdier i kædens (f.eks. ETH) lokale valuta. Vælg Fiat for fortrinsvis at vise værdier i din valgte fiat valuta." - }, "privacyMsg": { "message": "Privatlivspolitik" }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 7b27d7d33230..eb4eea16bc91 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "Preis nicht verfügbar" }, - "primaryCurrencySetting": { - "message": "Hauptwährung" - }, - "primaryCurrencySettingDescription": { - "message": "Wählen Sie 'Nativ', um dem Anzeigen von Werten in der nativen Währung der Chain (z. B. ETH) Vorrang zu geben. Wählen Sie 'Fiat', um dem Anzeigen von Werten in Ihrer gewählten Fiat-Währung Vorrang zu geben." - }, "primaryType": { "message": "Primärer Typ" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 83367518528e..f5c56122ef3e 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "μη διαθέσιμη τιμή" }, - "primaryCurrencySetting": { - "message": "Κύριο νόμισμα" - }, - "primaryCurrencySettingDescription": { - "message": "Επιλέξτε εγχώριο για να δώσετε προτεραιότητα στην εμφάνιση των τιμών στο νόμισμα της αλυσίδας (π.χ. ETH). Επιλέξτε Παραστατικό για να δώσετε προτεραιότητα στην εμφάνιση τιμών στο επιλεγμένο παραστατικό νόμισμα." - }, "primaryType": { "message": "Βασικός τύπος" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 15b12688d7e4..05cd23fe5ad7 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4117,12 +4117,6 @@ "priceUnavailable": { "message": "price unavailable" }, - "primaryCurrencySetting": { - "message": "Primary currency" - }, - "primaryCurrencySettingDescription": { - "message": "Select native to prioritize displaying values in the native currency of the chain (e.g. ETH). Select Fiat to prioritize displaying values in your selected fiat currency." - }, "primaryType": { "message": "Primary type" }, diff --git a/app/_locales/en_GB/messages.json b/app/_locales/en_GB/messages.json index fb3cefda9265..606e8eb6d818 100644 --- a/app/_locales/en_GB/messages.json +++ b/app/_locales/en_GB/messages.json @@ -4024,12 +4024,6 @@ "priceUnavailable": { "message": "price unavailable" }, - "primaryCurrencySetting": { - "message": "Primary currency" - }, - "primaryCurrencySettingDescription": { - "message": "Select native to prioritize displaying values in the native currency of the chain (e.g. ETH). Select Fiat to prioritize displaying values in your selected fiat currency." - }, "primaryType": { "message": "Primary type" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 03182da659a4..3dbff4153784 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -3989,12 +3989,6 @@ "priceUnavailable": { "message": "precio no disponible" }, - "primaryCurrencySetting": { - "message": "Moneda principal" - }, - "primaryCurrencySettingDescription": { - "message": "Seleccione Nativa para dar prioridad a mostrar los valores en la moneda nativa de la cadena (p. ej., ETH). Seleccione Fiduciaria para dar prioridad a mostrar los valores en la moneda fiduciaria seleccionada." - }, "primaryType": { "message": "Tipo principal" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index 11f543db6acc..72e530afc447 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -1509,12 +1509,6 @@ "prev": { "message": "Ant." }, - "primaryCurrencySetting": { - "message": "Moneda principal" - }, - "primaryCurrencySettingDescription": { - "message": "Seleccione Nativa para dar prioridad a mostrar los valores en la moneda nativa de la cadena (p. ej., ETH). Seleccione Fiduciaria para dar prioridad a mostrar los valores en la moneda fiduciaria seleccionada." - }, "priorityFee": { "message": "Tarifa de prioridad" }, diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index a4fa6b72ecf1..d0932270dce2 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -513,12 +513,6 @@ "prev": { "message": "Eelm" }, - "primaryCurrencySetting": { - "message": "Põhivaluuta" - }, - "primaryCurrencySettingDescription": { - "message": "Valige omavääring, et prioriseerida vääringu kuvamist ahela omavääringus (nt ETH). Valige Fiat, et prioriseerida vääringu kuvamist valitud fiat-vääringus." - }, "privacyMsg": { "message": "privaatsuspoliitika" }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index c58e01945a51..d5c93ebe8808 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -519,12 +519,6 @@ "prev": { "message": "قبلی" }, - "primaryCurrencySetting": { - "message": "واحد پول اصلی" - }, - "primaryCurrencySettingDescription": { - "message": "برای اولویت دهی نمایش قیمت ها در واحد پولی اصلی زنجیره (مثلًا ETH)، اصلی را انتخاب کنید. برای اولویت دهی نمایش قیمت ها در فیات واحد پولی شما، فیات را انتخاب کنید." - }, "privacyMsg": { "message": "خط‌مشی رازداری" }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 530afeafb419..a4ad460fb3ca 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -516,12 +516,6 @@ "prev": { "message": "Aiemp." }, - "primaryCurrencySetting": { - "message": "Ensisijainen valuutta" - }, - "primaryCurrencySettingDescription": { - "message": "Valitse natiivivaihtoehto näyttääksesi arvot ensisijaisesti ketjun natiivivaluutalla (esim. ETH). Valitse oletusmääräys asettaaksesi valitsemasi oletusvaluutan ensisijaiseksi." - }, "privacyMsg": { "message": "Tietosuojakäytäntö" }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 4b1bb1e058ca..f78b1df839ef 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -451,12 +451,6 @@ "prev": { "message": "Nakaraan" }, - "primaryCurrencySetting": { - "message": "Pangunahing Currency" - }, - "primaryCurrencySettingDescription": { - "message": "Piliin ang native para bigyang priyoridad ang pagpapakita ng mga halaga sa native currency ng chain (hal. ETH). Piliin ang Fiat para bigyang priyoridad ang pagpapakita ng mga halaga sa napili mong fiat currency." - }, "privacyMsg": { "message": "Patakaran sa Privacy" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index f7164e2d61ea..beefe622b5d0 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "prix non disponible" }, - "primaryCurrencySetting": { - "message": "Devise principale" - }, - "primaryCurrencySettingDescription": { - "message": "Sélectionnez « natif » pour donner la priorité à l’affichage des valeurs dans la devise native de la chaîne (par ex. ETH). Sélectionnez « fiduciaire » pour donner la priorité à l’affichage des valeurs dans la devise de votre choix." - }, "primaryType": { "message": "Type principal" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index a7fdf1662184..b6ec8797a942 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -516,12 +516,6 @@ "prev": { "message": "הקודם" }, - "primaryCurrencySetting": { - "message": "מטבע ראשי" - }, - "primaryCurrencySettingDescription": { - "message": "בחר/י 'מקומי' כדי לתעדף הצגת ערכים במטבע המקומי של הצ'יין (למשל ETH). בחר/י פיאט כדי לתעדף הצגת ערכים במטבע הפיאט שבחרת." - }, "privacyMsg": { "message": "מדיניות הפרטיות" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 1e2f0307bb78..3ebc41409ca1 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "प्राइस अनुपलब्ध है" }, - "primaryCurrencySetting": { - "message": "प्राथमिक मुद्रा" - }, - "primaryCurrencySettingDescription": { - "message": "चेन की ओरिजिनल करेंसी (जैसे ETH) में प्रदर्शित वैल्यूज़ को प्राथमिकता देने के लिए ओरिजिनल को चुनें। अपनी चुना गया फिएट करेंसी में प्रदर्शित वैल्यूज़ को प्राथमिकता देने के लिए फिएट को चुनें।" - }, "primaryType": { "message": "प्राइमरी टाइप" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index 26cbd3838807..b7e337e877aa 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -516,12 +516,6 @@ "prev": { "message": "Prethodno" }, - "primaryCurrencySetting": { - "message": "Glavna valuta" - }, - "primaryCurrencySettingDescription": { - "message": "Odaberite da se prvo prikazuju valute u osnovnoj valuti bloka (npr. ETH). Odaberite mogućnost Fiat za prikazivanje valuta u odabranoj valuti Fiat." - }, "privacyMsg": { "message": "Pravilnik o zaštiti privatnosti" }, diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 267547371bcd..76d0a8726661 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -359,12 +359,6 @@ "prev": { "message": "Avan" }, - "primaryCurrencySetting": { - "message": "Lajan ou itilize pi plis la" - }, - "primaryCurrencySettingDescription": { - "message": "Chwazi ETH pou bay priyorite montre valè nan ETH. Chwazi Fiat priyorite montre valè nan lajan ou chwazi a." - }, "privacyMsg": { "message": "Règleman sou enfòmasyon prive" }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index a244ad8abb7b..933067070194 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -516,12 +516,6 @@ "prev": { "message": "Előző" }, - "primaryCurrencySetting": { - "message": "Elsődleges pénznem" - }, - "primaryCurrencySettingDescription": { - "message": "Válaszd a helyit, hogy az értékek elsősorban a helyi pénznemben jelenjenek meg (pl. ETH). Válaszd a Fiatot, hogy az értékek elsősorban a választott fiat pénznemben jelenjenek meg." - }, "privacyMsg": { "message": "Adatvédelmi szabályzat" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 41bfb6733211..2fd3d6812d9f 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "harga tidak tersedia" }, - "primaryCurrencySetting": { - "message": "Mata uang primer" - }, - "primaryCurrencySettingDescription": { - "message": "Pilih asal untuk memprioritaskan nilai yang ditampilkan dalam mata uang asal chain (contoh, ETH). Pilih Fiat untuk memprioritaskan nilai yang ditampilkan dalam mata uang fiat yang Anda pilih." - }, "primaryType": { "message": "Tipe primer" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 770968a70f00..1f8e49c6a759 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -1198,12 +1198,6 @@ "prev": { "message": "Precedente" }, - "primaryCurrencySetting": { - "message": "Moneta Primaria" - }, - "primaryCurrencySettingDescription": { - "message": "Seleziona ETH per privilegiare la visualizzazione dei valori nella moneta nativa della blockhain. Seleziona Fiat per privilegiare la visualizzazione dei valori nella moneta selezionata." - }, "privacyMsg": { "message": "Politica sulla Privacy" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 184c82751dfa..51a0c7c8a670 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "価格が利用できません" }, - "primaryCurrencySetting": { - "message": "プライマリ通貨" - }, - "primaryCurrencySettingDescription": { - "message": "チェーンのネイティブ通貨 (ETHなど) による値の表示を優先するには、「ネイティブ」を選択します。選択した法定通貨による値の表示を優先するには、「法定通貨」を選択します。" - }, "primaryType": { "message": "基本型" }, diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 095670da3fb3..cf0a72815725 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -519,12 +519,6 @@ "prev": { "message": "ಹಿಂದಿನ" }, - "primaryCurrencySetting": { - "message": "ಪ್ರಾಥಮಿಕ ಕರೆನ್ಸಿ" - }, - "primaryCurrencySettingDescription": { - "message": "ಸರಪಳಿಯ ಸ್ಥಳೀಯ ಕರೆನ್ಸಿಯಲ್ಲಿ ಮೌಲ್ಯಗಳನ್ನು ಪ್ರದರ್ಶಿಸಲು ಆದ್ಯತೆ ನೀಡಲು ಸ್ಥಳೀಯವನ್ನು ಆಯ್ಕೆಮಾಡಿ (ಉದಾ. ETH). ನಿಮ್ಮ ಆಯ್ಕೆಮಾಡಿದ ಫಿಯೆಟ್ ಕರೆನ್ಸಿಯಲ್ಲಿ ಮೌಲ್ಯಗಳನ್ನು ಪ್ರದರ್ಶಿಸಲು ಆದ್ಯತೆ ನೀಡಲು ಫಿಯೆಟ್ ಆಯ್ಕೆಮಾಡಿ." - }, "privacyMsg": { "message": "ಗೌಪ್ಯತೆ ನೀತಿ" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 08c350155187..b7b3f79ee70a 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "가격 사용 불가" }, - "primaryCurrencySetting": { - "message": "기본 통화" - }, - "primaryCurrencySettingDescription": { - "message": "체인의 고유 통화(예: ETH)로 값을 우선 표시하려면 고유를 선택합니다. 선택한 명목 통화로 값을 우선 표시하려면 명목을 선택합니다." - }, "primaryType": { "message": "기본 유형" }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index f14348b4000e..29952fa04cef 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -519,12 +519,6 @@ "prev": { "message": "Peržiūra" }, - "primaryCurrencySetting": { - "message": "Pagrindinė valiuta" - }, - "primaryCurrencySettingDescription": { - "message": "Rinkitės vietinę, kad vertės pirmiausia būtų rodomos vietine grandinės valiuta (pvz., ETH). Rinkitės standartinę, kad vertės pirmiausia būtų rodomos jūsų pasirinkta standartine valiuta." - }, "privacyMsg": { "message": "Privatumo politika" }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 596858c017d5..f2795543268d 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -519,12 +519,6 @@ "prev": { "message": "Iepr." }, - "primaryCurrencySetting": { - "message": "Primārā valūta" - }, - "primaryCurrencySettingDescription": { - "message": "Atlasīt vietējo, lai piešķirtu attēlotajām vērtībām prioritātes ķēdes vietējā vērtībā (piemēram, ETH). Atlasiet Fiat, lai piešķirtu augstāku prioritāti vērtībām jūsu atlasītajā fiat valūtā." - }, "privacyMsg": { "message": "Privātuma politika" }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index a45288f90ae8..0d8543038312 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -503,12 +503,6 @@ "prev": { "message": "Sebelumnya" }, - "primaryCurrencySetting": { - "message": "Mata Wang Utama" - }, - "primaryCurrencySettingDescription": { - "message": "Pilih natif untuk mengutamakan nilai paparan dalam mata wang natif rantaian (cth. ETH). Pilih Fiat untuk mengutamakan nilai paparan dalam mata wang fiat yang anda pilih." - }, "privacyMsg": { "message": "Dasar Privasi" }, diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 20aa168b32a4..aa8bb94b97d0 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -507,12 +507,6 @@ "prev": { "message": "Tidligere" }, - "primaryCurrencySetting": { - "message": "Hovedvaluta " - }, - "primaryCurrencySettingDescription": { - "message": "Velg nasjonal for å prioritere å vise verdier i nasjonal valuta i kjeden (f.eks. ETH). Velg Fiat for å prioritere visning av verdier i den valgte fiat-valutaen." - }, "privacyMsg": { "message": "Personvernerklæring" }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index 2c1094cff462..d2897373e35c 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -972,12 +972,6 @@ "prev": { "message": "Nakaraan" }, - "primaryCurrencySetting": { - "message": "Pangunahing Currency" - }, - "primaryCurrencySettingDescription": { - "message": "Piliin ang native para maisapriyoridad ang pagpapakita ng mga value sa native na currency ng chain (hal. ETH). Piliin ang Fiat para maisapriyoridad ang pagpapakita ng mga value sa napili mong fiat currency." - }, "privacyMsg": { "message": "Patakaran sa Pagkapribado" }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 61ea570e855d..572d3a650c20 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -513,12 +513,6 @@ "prev": { "message": "Poprzednie" }, - "primaryCurrencySetting": { - "message": "Waluta podstawowa" - }, - "primaryCurrencySettingDescription": { - "message": "Wybierz walutę natywną, aby preferować wyświetlanie wartości w walucie natywnej łańcucha (np. ETH). Wybierz walutę fiat, aby preferować wyświetlanie wartości w wybranej przez siebie walucie fiat." - }, "privacyMsg": { "message": "Polityka prywatności" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index fd7de006e21b..4524d95904f0 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "preço não disponível" }, - "primaryCurrencySetting": { - "message": "Moeda principal" - }, - "primaryCurrencySettingDescription": { - "message": "Selecione Nativa para priorizar a exibição de valores na moeda nativa da cadeia (por ex., ETH). Selecione Fiduciária para priorizar a exibição de valores na moeda fiduciária selecionada." - }, "primaryType": { "message": "Tipo primário" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index ef9f817ebf7f..c119d1b537d2 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -1513,12 +1513,6 @@ "prev": { "message": "Anterior" }, - "primaryCurrencySetting": { - "message": "Moeda principal" - }, - "primaryCurrencySettingDescription": { - "message": "Selecione Nativa para priorizar a exibição de valores na moeda nativa da cadeia (por ex., ETH). Selecione Fiduciária para priorizar a exibição de valores na moeda fiduciária selecionada." - }, "priorityFee": { "message": "Taxa de prioridade" }, diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index a0a15746b4c0..b404e4956301 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -510,12 +510,6 @@ "prev": { "message": "Ant" }, - "primaryCurrencySetting": { - "message": "Moneda principală" - }, - "primaryCurrencySettingDescription": { - "message": "Selectați nativ pentru a prioritiza valorile afișate în moneda nativă a lanțului (ex. ETH). Selectați Fiat pentru a prioritiza valorile afișate în moneda selectată fiat." - }, "privacyMsg": { "message": "Politica de Confidențialitate" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 0a67cb30dcb7..d6967b932384 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "цена недоступна" }, - "primaryCurrencySetting": { - "message": "Основная валюта" - }, - "primaryCurrencySettingDescription": { - "message": "Выберите «собственная», чтобы установить приоритет отображения значений в собственной валюте блокчейна (например, ETH). Выберите «Фиатная», чтобы установить приоритет отображения значений в выбранной фиатной валюте." - }, "primaryType": { "message": "Основной тип" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 238edf29c36e..4638a667c9f1 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -491,12 +491,6 @@ "prev": { "message": "Predchádzajúce" }, - "primaryCurrencySetting": { - "message": "Primárna mena" - }, - "primaryCurrencySettingDescription": { - "message": "Vyberte natívne, ak chcete priorizovať zobrazovanie hodnôt v natívnej mene reťazca (napr. ETH). Ak chcete priorizovať zobrazovanie hodnôt vo svojej vybranej mene fiat, zvoľte možnosť Fiat." - }, "privacyMsg": { "message": "Zásady ochrany osobních údajů" }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index ce63cc9ddb21..7379ac81b3f9 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -507,12 +507,6 @@ "prev": { "message": "Prej" }, - "primaryCurrencySetting": { - "message": "Glavna valuta" - }, - "primaryCurrencySettingDescription": { - "message": "Izberite Native za prikaz vrednosti v privzeti valuti verige (npr. ETH). Izberite Klasične za prikaz vrednosti v izbrani klasični valuti." - }, "privacyMsg": { "message": "Zasebnost" }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 56d60832dfba..be81f85bd867 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -510,12 +510,6 @@ "prev": { "message": "Prethodno" }, - "primaryCurrencySetting": { - "message": "Primarna valuta" - }, - "primaryCurrencySettingDescription": { - "message": "Izaberite primarnu da biste postavili prioritete u prikazivanju vrednosti u primarnoj valuti lanca (npr. ETH). Izaberite Fiat da biste postavili prioritete u prikazivanju vrednosti u vašoj izabranoj fiat valuti." - }, "privacyMsg": { "message": "Smernice za privatnost" }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 43de300985a6..96ca181fb43b 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -507,12 +507,6 @@ "prev": { "message": "Föregående" }, - "primaryCurrencySetting": { - "message": "Primär valuta" - }, - "primaryCurrencySettingDescription": { - "message": "Välj native för att prioritera visning av värden i den ursprungliga valutan i kedjan (t.ex. ETH). Välj Fiat för att prioritera visning av värden i din valda fiatvaluta." - }, "privacyMsg": { "message": "Integritetspolicy" }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 65d2079d5990..1dd5c6603ba6 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -501,12 +501,6 @@ "prev": { "message": "Hakiki" }, - "primaryCurrencySetting": { - "message": "Sarafu ya Msingi" - }, - "primaryCurrencySettingDescription": { - "message": "Chagua mzawa ili kuweka kipaumbele kuonyesha thamani kwenye sarafu mzawa ya mnyororo (k.m ETH). Chagua Fiat ili uwelke kipaumbale kuonyesha thamani kwenye sarafu yako ya fiat uliyoichagua." - }, "privacyMsg": { "message": "Sera ya Faragha" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index bf22f698b417..dac50a5bbece 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "hindi available ang presyo" }, - "primaryCurrencySetting": { - "message": "Pangunahing Currency" - }, - "primaryCurrencySettingDescription": { - "message": "Piliin ang native para maisapriyoridad ang pagpapakita ng mga value sa native na currency ng chain (hal. ETH). Piliin ang Fiat para maisapriyoridad ang pagpapakita ng mga value sa napili mong fiat na salapi." - }, "primaryType": { "message": "Pangunahing uri" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 0935ebbcc512..6267e8e5a077 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "fiyat mevcut değil" }, - "primaryCurrencySetting": { - "message": "Öncelikli para birimi" - }, - "primaryCurrencySettingDescription": { - "message": "Değerlerin zincirin yerli para biriminde (ör. ETH) görüntülenmesini önceliklendirmek için yerli seçimi yapın. Seçtiğiniz fiat parada değerlerin gösterilmesini önceliklendirmek için Fiat Para seçin." - }, "primaryType": { "message": "Öncelikli tür" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 3df0e035eebb..3d9de1c7203d 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -519,12 +519,6 @@ "prev": { "message": "Попередній" }, - "primaryCurrencySetting": { - "message": "Первісна валюта" - }, - "primaryCurrencySettingDescription": { - "message": "Оберіть \"рідна\", щоб пріоритезувати показ сум у рідних валютах мережі (напр.ETH). \nОберіть \"фіатна\", щоб пріоритезувати показ сум у ваших обраних фіатних валютах." - }, "privacyMsg": { "message": "Політика конфіденційності" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 3ec031773432..e9fe35668ec0 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "giá không khả dụng" }, - "primaryCurrencySetting": { - "message": "Tiền tệ chính" - }, - "primaryCurrencySettingDescription": { - "message": "Chọn Gốc để ưu tiên hiển thị giá trị bằng đơn vị tiền tệ gốc của chuỗi (ví dụ: ETH). Chọn Pháp định để ưu tiên hiển thị giá trị bằng đơn vị tiền pháp định mà bạn chọn." - }, "primaryType": { "message": "Loại chính" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index de35cd696b5f..86b7eae47799 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -3992,12 +3992,6 @@ "priceUnavailable": { "message": "价格不可用" }, - "primaryCurrencySetting": { - "message": "主要货币" - }, - "primaryCurrencySettingDescription": { - "message": "选择原生以优先显示链的原生货币(例如 ETH)的值。选择法币以优先显示以您所选法币显示的值。" - }, "primaryType": { "message": "主要类型" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 558963373965..68ff3c234969 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -964,12 +964,6 @@ "prev": { "message": "前一頁" }, - "primaryCurrencySetting": { - "message": "主要貨幣" - }, - "primaryCurrencySettingDescription": { - "message": "選擇原生來優先使用鏈上原生貨幣 (例如 ETH) 顯示金額。選擇法定貨幣來優先使用您選擇的法定貨幣顯示金額。" - }, "privacyMsg": { "message": "隱私政策" }, From 7762fc8211b0416864e6493dec709a91f1cfb8cd Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 01:32:32 +0200 Subject: [PATCH 45/68] fix: fix snapshot --- .../token-list-item/__snapshots__/token-list-item.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/multichain/token-list-item/__snapshots__/token-list-item.test.js.snap b/ui/components/multichain/token-list-item/__snapshots__/token-list-item.test.js.snap index 5c75df62eef1..1330a1490244 100644 --- a/ui/components/multichain/token-list-item/__snapshots__/token-list-item.test.js.snap +++ b/ui/components/multichain/token-list-item/__snapshots__/token-list-item.test.js.snap @@ -59,7 +59,7 @@ exports[`TokenListItem should render correctly 1`] = ` data-testid="multichain-token-list-item-secondary-value" />

From 705dbdf7687082aa3f513c98d87ee83cecf07128 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 01:45:10 +0200 Subject: [PATCH 46/68] fix: fix snapshots --- .../assets/token-cell/__snapshots__/token-cell.test.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap b/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap index e40a15f69863..eb23b69f9451 100644 --- a/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap +++ b/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap @@ -52,7 +52,7 @@ exports[`Token Cell should match snapshot 1`] = ` class="mm-box mm-box--display-flex" >

@@ -67,7 +67,7 @@ exports[`Token Cell should match snapshot 1`] = ` 5.00

5 From 171f2320e4aa3f6cdd35dabbae907fd90fd2e92c Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 01:53:46 +0200 Subject: [PATCH 47/68] fix: fix snapshots --- .../__snapshots__/percentage-change.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap b/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap index 3b0d1ec6977a..a704b89f797a 100644 --- a/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap +++ b/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap @@ -6,7 +6,7 @@ exports[`PercentageChange Component - Percentage Display render renders correctl class="mm-box mm-box--display-flex" >

+5.12% From 6319e80c743728855952eb2e8b637564c537b1ec Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 02:04:54 +0200 Subject: [PATCH 48/68] fix: fix snapshots --- .../components/__snapshots__/asset-page.test.tsx.snap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap b/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap index ef6e6331d2ba..3d2b00d67547 100644 --- a/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap +++ b/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap @@ -236,7 +236,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-testid="multichain-token-list-item-secondary-value" />

0 TEST @@ -515,7 +515,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` class="mm-box mm-box--display-flex" >

@@ -528,7 +528,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` data-testid="multichain-token-list-item-secondary-value" />

0 @@ -998,7 +998,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` class="mm-box mm-box--display-flex" >

@@ -1011,7 +1011,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` data-testid="multichain-token-list-item-secondary-value" />

0 From 99866a07d8f3935e111c78d227af6741bf223608 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 02:30:55 +0200 Subject: [PATCH 49/68] fix: fix add testID --- ui/components/app/wallet-overview/coin-overview.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 29cb61c720f5..bbc83a1a68ae 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -185,6 +185,7 @@ export const CoinOverview = ({ }} onClick={handlePortfolioOnClick} as="a" + data-testid="portfolio-link" > {t('portfolio')} @@ -207,6 +208,7 @@ export const CoinOverview = ({ }} onClick={handlePortfolioOnClick} as="a" + data-testid="portfolio-link" > {t('portfolio')} From b4b7442d90e681939dac99ef9d65041cb378b84a Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 02:50:14 +0200 Subject: [PATCH 50/68] fix: fix e2e --- test/e2e/tests/settings/settings-search.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/tests/settings/settings-search.spec.js b/test/e2e/tests/settings/settings-search.spec.js index 9e7dceafabfa..e5310241fe81 100644 --- a/test/e2e/tests/settings/settings-search.spec.js +++ b/test/e2e/tests/settings/settings-search.spec.js @@ -9,7 +9,7 @@ const FixtureBuilder = require('../../fixture-builder'); describe('Settings Search', function () { const settingsSearch = { - general: 'Primary currency', + general: 'Show native token as main balance', advanced: 'State logs', contacts: 'Contacts', security: 'Reveal Secret', From 31895a57f686e5892875aaef94fe537c2f65b63b Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 03:15:28 +0200 Subject: [PATCH 51/68] fix: e2e --- test/e2e/tests/settings/localization.spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/e2e/tests/settings/localization.spec.js b/test/e2e/tests/settings/localization.spec.js index a57b94effa9b..57dbfd5f68cf 100644 --- a/test/e2e/tests/settings/localization.spec.js +++ b/test/e2e/tests/settings/localization.spec.js @@ -32,9 +32,8 @@ describe('Localization', function () { '[data-testid="eth-overview__primary-currency"]', ); const balanceText = await primaryBalance.getText(); - const [fiatAmount, fiatUnit] = balanceText.trim().split(/\s+/u); - assert.ok(fiatAmount.startsWith('₱')); - assert.equal(fiatUnit, 'PHP'); + assert.ok(balanceText.startsWith('₱')); + assert.ok(balanceText.endsWith('PHP')); }, ); }); From c4003433f97d17b2aec90e86067bf5bc1f664e60 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 12:06:47 +0200 Subject: [PATCH 52/68] fix: CSS feedback --- .../aggregated-percentage-overview.tsx | 6 ++-- .../app/wallet-overview/coin-buttons.tsx | 31 ++++++++++++++++--- .../app/wallet-overview/coin-overview.tsx | 16 +++++++--- .../button-icon/button-icon.tsx | 1 + .../button-icon/button-icon.types.ts | 1 + ui/components/ui/icon-button/icon-button.scss | 4 +-- ui/helpers/utils/settings-search.js | 9 ++++++ ui/helpers/utils/settings-search.test.js | 14 +++++++++ ui/pages/home/index.scss | 4 --- 9 files changed, 66 insertions(+), 20 deletions(-) diff --git a/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx b/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx index adbdf5c3c800..a988ebaba864 100644 --- a/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx +++ b/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx @@ -107,8 +107,7 @@ export const AggregatedPercentageOverview = () => { return ( { {formattedAmountChange} } + Icon={ + + } label={t('stake')} onClick={handleMmiStakingOnClick} /> @@ -203,7 +209,11 @@ const CoinButtons = ({ className={`${classPrefix}-overview__button`} iconButtonClassName={iconButtonClassName} Icon={ - + } label={t('portfolio')} onClick={handleMmiPortfolioOnClick} @@ -314,7 +324,11 @@ const CoinButtons = ({ className={`${classPrefix}-overview__button`} iconButtonClassName={iconButtonClassName} Icon={ - + } disabled={!isBuyableChain} data-testid={`${classPrefix}-overview-buy`} @@ -342,6 +356,7 @@ const CoinButtons = ({ } onClick={handleSwapOnClick} @@ -359,7 +374,11 @@ const CoinButtons = ({ disabled={!isBridgeChain || !isSigningEnabled} data-testid={`${classPrefix}-overview-bridge`} Icon={ - + } label={t('bridge')} onClick={handleBridgeOnClick} @@ -377,6 +396,7 @@ const CoinButtons = ({ } disabled={!isSigningEnabled} @@ -402,6 +422,7 @@ const CoinButtons = ({ } label={t('receive')} diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index bbc83a1a68ae..a2def836a71f 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -53,9 +53,9 @@ import Spinner from '../../ui/spinner'; import { PercentageAndAmountChange } from '../../multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change'; import { getMultichainIsEvm } from '../../../selectors/multichain'; import { useAccountTotalFiatBalance } from '../../../hooks/useAccountTotalFiatBalance'; -import { GENERAL_ROUTE } from '../../../helpers/constants/routes'; import { setAggregatedBalancePopover } from '../../../store/actions'; import { useTheme } from '../../../hooks/useTheme'; +import { getSpecificSettingsRoute } from '../../../helpers/utils/settings-search'; import WalletOverview from './wallet-overview'; import CoinButtons from './coin-buttons'; import { AggregatedPercentageOverview } from './aggregated-percentage-overview'; @@ -101,6 +101,12 @@ export const CoinOverview = ({ const dispatch = useDispatch(); const trackEvent = useContext(MetaMetricsContext); + const showNativeTokenAsMainBalanceRoute = getSpecificSettingsRoute( + t, + t('general'), + t('showNativeTokenAsMainBalance'), + ); + const metaMetricsId = useSelector(getMetaMetricsId); const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics); const isMarketingEnabled = useSelector(getDataCollectionForMarketing); @@ -181,7 +187,7 @@ export const CoinOverview = ({ }} size={ButtonLinkSize.Inherit} textProps={{ - variant: TextVariant.bodyMd, + variant: TextVariant.bodyMdMedium, }} onClick={handlePortfolioOnClick} as="a" @@ -204,7 +210,7 @@ export const CoinOverview = ({ }} size={ButtonLinkSize.Inherit} textProps={{ - variant: TextVariant.bodyMd, + variant: TextVariant.bodyMdMedium, }} onClick={handlePortfolioOnClick} as="a" @@ -281,7 +287,7 @@ export const CoinOverview = ({ {t('yourBalanceIsAggregated')} diff --git a/ui/components/component-library/button-icon/button-icon.tsx b/ui/components/component-library/button-icon/button-icon.tsx index e118b9ac3de1..d158a64b04aa 100644 --- a/ui/components/component-library/button-icon/button-icon.tsx +++ b/ui/components/component-library/button-icon/button-icon.tsx @@ -23,6 +23,7 @@ const buttonIconSizeToIconSize: Record = { [ButtonIconSize.Sm]: IconSize.Sm, [ButtonIconSize.Md]: IconSize.Md, [ButtonIconSize.Lg]: IconSize.Lg, + [ButtonIconSize.Xs]: IconSize.Xs, }; export const ButtonIcon: ButtonIconComponent = React.forwardRef( diff --git a/ui/components/component-library/button-icon/button-icon.types.ts b/ui/components/component-library/button-icon/button-icon.types.ts index 6f6c52cb23d7..786320e13f6a 100644 --- a/ui/components/component-library/button-icon/button-icon.types.ts +++ b/ui/components/component-library/button-icon/button-icon.types.ts @@ -6,6 +6,7 @@ export enum ButtonIconSize { Sm = 'sm', Md = 'md', Lg = 'lg', + Xs = 'Xs', } /** diff --git a/ui/components/ui/icon-button/icon-button.scss b/ui/components/ui/icon-button/icon-button.scss index 4d8c98a51cb9..e09373b23744 100644 --- a/ui/components/ui/icon-button/icon-button.scss +++ b/ui/components/ui/icon-button/icon-button.scss @@ -18,8 +18,8 @@ display: flex; justify-content: center; align-items: center; - height: 40px; - width: 40px; + height: 36px; + width: 36px; background: var(--color-primary-default); border-radius: 99px; margin-top: 6px; diff --git a/ui/helpers/utils/settings-search.js b/ui/helpers/utils/settings-search.js index 447a39901059..af13e1d71c65 100644 --- a/ui/helpers/utils/settings-search.js +++ b/ui/helpers/utils/settings-search.js @@ -25,6 +25,15 @@ function getFilteredSettingsRoutes(t, tabMessage) { }); } +export function getSpecificSettingsRoute(t, tabMessage, sectionMessage) { + return getSettingsRoutes().find((routeObject) => { + return ( + routeObject.tabMessage(t) === tabMessage && + routeObject.sectionMessage(t) === sectionMessage + ); + }); +} + /** * @param {Function} t - context.t function * @param {string} tabMessage diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index 709b0354a4e7..1e440b8f0aff 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -4,6 +4,7 @@ import { getSettingsRoutes, getNumberOfSettingRoutesInTab, handleSettingsRefs, + getSpecificSettingsRoute, } from './settings-search'; const t = (key) => { @@ -209,4 +210,17 @@ describe('Settings Search Utils', () => { expect(handleSettingsRefs(t, t('general'), settingsRefs)).toBeUndefined(); }); }); + + describe('getSpecificSettingsRoute', () => { + it('should return show native token as main balance route', () => { + const result = getSpecificSettingsRoute( + t, + t('general'), + t('showNativeTokenAsMainBalance'), + ); + expect(result.route).toBe( + '/settings/general#show-native-token-as-main-balance', + ); + }); + }); }); diff --git a/ui/pages/home/index.scss b/ui/pages/home/index.scss index fe238daaf5cd..5a85a3eb5d3c 100644 --- a/ui/pages/home/index.scss +++ b/ui/pages/home/index.scss @@ -21,10 +21,6 @@ display: flex; flex-direction: column; padding-top: 8px; - - @include design-system.screen-sm-min { - padding: 16px 128px; //TODO verify with design team if this would be okay - } } &__connect-status-text { From ed7439573d24090aaa75f2c61ea48f712a0ea861 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 12:31:53 +0200 Subject: [PATCH 53/68] fix: CSS feedback + snapshot update --- ...gregated-percentage-overview.test.tsx.snap | 4 +- .../__snapshots__/asset-page.test.tsx.snap | 38 +++++++++---------- ui/pages/asset/components/token-buttons.tsx | 28 ++++++++++++-- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap b/ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap index 1209f0e4942c..59dac675d1df 100644 --- a/ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap +++ b/ui/components/app/wallet-overview/__snapshots__/aggregated-percentage-overview.test.tsx.snap @@ -6,14 +6,14 @@ exports[`AggregatedPercentageOverview render renders correctly 1`] = ` class="mm-box mm-box--display-flex" >

+$0.00

(+0.00%) diff --git a/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap b/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap index 3d2b00d67547..8e03944f4ba4 100644 --- a/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap +++ b/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap @@ -43,7 +43,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-theme="light" >

@@ -61,7 +61,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-theme="light" >
@@ -79,7 +79,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-theme="light" >
@@ -99,7 +99,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-theme="light" >
@@ -118,7 +118,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-theme="light" >
@@ -137,7 +137,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-theme="light" >
@@ -156,7 +156,7 @@ exports[`AssetPage should render a native asset 1`] = ` data-theme="light" >
@@ -352,7 +352,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` data-theme="light" >
@@ -371,7 +371,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` data-theme="light" >
@@ -390,7 +390,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` data-theme="light" >
@@ -409,7 +409,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` data-theme="light" >
@@ -427,7 +427,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` data-theme="light" > @@ -446,7 +446,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` data-theme="light" > @@ -835,7 +835,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` data-theme="light" > @@ -854,7 +854,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` data-theme="light" > @@ -873,7 +873,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` data-theme="light" > @@ -892,7 +892,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` data-theme="light" > @@ -910,7 +910,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` data-theme="light" > @@ -929,7 +929,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` data-theme="light" > diff --git a/ui/pages/asset/components/token-buttons.tsx b/ui/pages/asset/components/token-buttons.tsx index a07cdaca2d48..bb3f129bade8 100644 --- a/ui/pages/asset/components/token-buttons.tsx +++ b/ui/pages/asset/components/token-buttons.tsx @@ -48,7 +48,12 @@ import { JustifyContent, } from '../../../helpers/constants/design-system'; import IconButton from '../../../components/ui/icon-button/icon-button'; -import { Box, Icon, IconName } from '../../../components/component-library'; +import { + Box, + Icon, + IconName, + IconSize, +} from '../../../components/component-library'; ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) import { getIsNativeTokenBuyable } from '../../../ducks/ramps'; ///: END:ONLY_INCLUDE_IF @@ -115,7 +120,11 @@ const TokenButtons = ({ + } label={t('buyAndSell')} data-testid="token-overview-buy" @@ -144,7 +153,11 @@ const TokenButtons = ({ + } label={t('stake')} data-testid="token-overview-mmi-stake" @@ -163,6 +176,7 @@ const TokenButtons = ({ } label={t('portfolio')} @@ -215,6 +229,7 @@ const TokenButtons = ({ } label={t('send')} @@ -229,6 +244,7 @@ const TokenButtons = ({ } onClick={() => { @@ -281,7 +297,11 @@ const TokenButtons = ({ className="token-overview__button" data-testid="token-overview-bridge" Icon={ - + } label={t('bridge')} onClick={() => { From 0528eb9c422ba277fc26a2e8db5aff0ce34b4b8e Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 12:45:21 +0200 Subject: [PATCH 54/68] fix: lint --- .../app/wallet-overview/aggregated-percentage-overview.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx b/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx index a988ebaba864..ef8e92989dda 100644 --- a/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx +++ b/ui/components/app/wallet-overview/aggregated-percentage-overview.tsx @@ -17,7 +17,6 @@ import { Display, TextColor, TextVariant, - FontWeight, } from '../../../helpers/constants/design-system'; import { Box, Text } from '../../component-library'; import { getCalculatedTokenAmount1dAgo } from '../../../helpers/utils/util'; From 78bda568a130eb063d52ccbfebbe8cf1e29c9b39 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 13:04:02 +0200 Subject: [PATCH 55/68] fix: css fix --- ui/components/app/wallet-overview/coin-overview.tsx | 2 +- ui/components/app/wallet-overview/index.scss | 4 ++-- .../__snapshots__/percentage-change.test.tsx.snap | 2 +- .../price/percentage-change/percentage-change.tsx | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index a2def836a71f..4c2cc343ecc0 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -290,7 +290,7 @@ export const CoinOverview = ({ size={ButtonIconSize.Xs} onClick={handleClick} iconName={IconName.Close} - justifyContent={JustifyContent.flexEnd} + justifyContent={JustifyContent.center} ariaLabel="close" />
diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index 5f895aa55702..60baba1883cd 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -31,13 +31,13 @@ } &__portfolio_button { - margin-left: 6px; + margin-left: 8px; } &__currency-wrapper { display: flex; flex-direction: row; - gap: 10px; + gap: 8px; } } diff --git a/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap b/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap index a704b89f797a..0f6aeb3367a3 100644 --- a/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap +++ b/ui/components/multichain/token-list-item/price/percentage-change/__snapshots__/percentage-change.test.tsx.snap @@ -6,7 +6,7 @@ exports[`PercentageChange Component - Percentage Display render renders correctl class="mm-box mm-box--display-flex" >

+5.12% diff --git a/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx b/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx index 5393ccd5baa5..e540db80a8f1 100644 --- a/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx +++ b/ui/components/multichain/token-list-item/price/percentage-change/percentage-change.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { Box, Text } from '../../../../component-library'; import { Display, - FontWeight, TextColor, TextVariant, } from '../../../../../helpers/constants/design-system'; @@ -35,7 +34,6 @@ export const PercentageChange = ({ return ( Date: Tue, 17 Sep 2024 13:23:07 +0200 Subject: [PATCH 56/68] fix: update portfolio text css --- ui/components/app/wallet-overview/coin-overview.tsx | 8 ++------ ui/components/app/wallet-overview/index.scss | 6 ++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 4c2cc343ecc0..1bc4308123da 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -186,12 +186,10 @@ export const CoinOverview = ({ className: 'wallet-overview__portfolio_button', }} size={ButtonLinkSize.Inherit} - textProps={{ - variant: TextVariant.bodyMdMedium, - }} onClick={handlePortfolioOnClick} as="a" data-testid="portfolio-link" + className="wallet-overview__portfolio_text" > {t('portfolio')} @@ -209,12 +207,10 @@ export const CoinOverview = ({ className: 'wallet-overview__portfolio_button', }} size={ButtonLinkSize.Inherit} - textProps={{ - variant: TextVariant.bodyMdMedium, - }} onClick={handlePortfolioOnClick} as="a" data-testid="portfolio-link" + className="wallet-overview__portfolio_text" > {t('portfolio')} diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index 60baba1883cd..a601e649106e 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -33,6 +33,12 @@ &__portfolio_button { margin-left: 8px; } + &__portfolio_text{ + font-family: "Euclid Circular B" !important; + font-size: 14px !important; + font-weight: 500 !important; + line-height: 22px !important; + } &__currency-wrapper { display: flex; From 437835f4890ee9b3fcacba54f9a06969cef988df Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 13:31:50 +0200 Subject: [PATCH 57/68] fix: update snapshot --- .../asset/components/__snapshots__/asset-page.test.tsx.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap b/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap index 8e03944f4ba4..95828e3e250e 100644 --- a/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap +++ b/ui/pages/asset/components/__snapshots__/asset-page.test.tsx.snap @@ -515,7 +515,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = ` class="mm-box mm-box--display-flex" >

@@ -998,7 +998,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = ` class="mm-box mm-box--display-flex" >

From 61825b147fa1b63a96384d6c6485527f7d2c6541 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 13:41:11 +0200 Subject: [PATCH 58/68] fix: portfolio text update --- ui/components/app/wallet-overview/index.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index a601e649106e..b3401ebcaefd 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -35,9 +35,12 @@ } &__portfolio_text{ font-family: "Euclid Circular B" !important; - font-size: 14px !important; + font-size: 16px !important; font-weight: 500 !important; line-height: 22px !important; + @include design-system.screen-sm-max { + font-size: 14px !important; + } } &__currency-wrapper { From a6f5fbf21de60788269873bbf1f3fa0be4dae0b4 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 13:51:56 +0200 Subject: [PATCH 59/68] fix: update snapshot --- .../app/assets/token-cell/__snapshots__/token-cell.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap b/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap index eb23b69f9451..3d8322ba141e 100644 --- a/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap +++ b/ui/components/app/assets/token-cell/__snapshots__/token-cell.test.js.snap @@ -52,7 +52,7 @@ exports[`Token Cell should match snapshot 1`] = ` class="mm-box mm-box--display-flex" >

From 523dca356ec32b1b5da340d83177dc27824c7321 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 14:02:24 +0200 Subject: [PATCH 60/68] fix: fix --- .../percentage-and-amount-change.test.tsx.snap | 4 ++-- .../percentage-and-amount-change.tsx | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap index e8ca2345490f..d29c3e40be68 100644 --- a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap +++ b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap @@ -6,14 +6,14 @@ exports[`PercentageChange Component render renders correctly 1`] = ` class="mm-box mm-box--display-flex" >

+$12.21

(+5.12%) diff --git a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx index 2d4a7341cad4..daff27d6cddf 100644 --- a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx +++ b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change.tsx @@ -5,7 +5,6 @@ import { isHexString, zeroAddress } from 'ethereumjs-util'; import { Text, Box } from '../../../../component-library'; import { Display, - FontWeight, TextColor, TextVariant, } from '../../../../../helpers/constants/design-system'; @@ -34,8 +33,7 @@ export const renderPercentageWithNumber = ( return ( Date: Tue, 17 Sep 2024 14:08:36 +0200 Subject: [PATCH 61/68] fix: fix --- .../__snapshots__/percentage-and-amount-change.test.tsx.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap index d29c3e40be68..7f88ca5456ec 100644 --- a/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap +++ b/ui/components/multichain/token-list-item/price/percentage-and-amount-change/__snapshots__/percentage-and-amount-change.test.tsx.snap @@ -6,14 +6,14 @@ exports[`PercentageChange Component render renders correctly 1`] = ` class="mm-box mm-box--display-flex" >

+$12.21

(+5.12%) From ba47af85a78837b09b678e68967a41840194848a Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 14:17:18 +0200 Subject: [PATCH 62/68] fix: lint --- ui/components/app/wallet-overview/index.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index b3401ebcaefd..f574c5e46376 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -33,11 +33,13 @@ &__portfolio_button { margin-left: 8px; } - &__portfolio_text{ + + &__portfolio_text { font-family: "Euclid Circular B" !important; font-size: 16px !important; font-weight: 500 !important; line-height: 22px !important; + @include design-system.screen-sm-max { font-size: 14px !important; } From 34b2a84c28c45dc7c11b931a47353cfbb29d15db Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Tue, 17 Sep 2024 23:09:12 +0200 Subject: [PATCH 63/68] fix: rm portfolio button class --- ui/components/app/wallet-overview/coin-overview.tsx | 4 ++-- ui/components/app/wallet-overview/index.scss | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 1bc4308123da..1a1ceb82b372 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -183,7 +183,7 @@ export const CoinOverview = ({ endIconProps={{ size: IconSize.Sm, color: IconColor.primaryDefault, - className: 'wallet-overview__portfolio_button', + marginLeft: 2, }} size={ButtonLinkSize.Inherit} onClick={handlePortfolioOnClick} @@ -204,7 +204,7 @@ export const CoinOverview = ({ endIconProps={{ size: IconSize.Sm, color: IconColor.primaryDefault, - className: 'wallet-overview__portfolio_button', + marginLeft: 2, }} size={ButtonLinkSize.Inherit} onClick={handlePortfolioOnClick} diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index f574c5e46376..5e187e7e7e55 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -30,10 +30,6 @@ padding: 0 16px; } - &__portfolio_button { - margin-left: 8px; - } - &__portfolio_text { font-family: "Euclid Circular B" !important; font-size: 16px !important; From 52a8669072e05aef09347df60e9ae1459dd543d3 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 18 Sep 2024 00:11:32 +0200 Subject: [PATCH 64/68] fix: fix portfolio buttonLink --- .../app/wallet-overview/coin-overview.tsx | 19 +++-------------- ui/components/app/wallet-overview/index.scss | 21 ------------------- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 1a1ceb82b372..f06f9964edae 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -11,7 +11,6 @@ import { ButtonLink, ButtonLinkSize, IconName, - IconSize, Popover, PopoverPosition, Text, @@ -19,7 +18,6 @@ import { import { AlignItems, Display, - IconColor, JustifyContent, TextAlign, TextVariant, @@ -178,18 +176,13 @@ export const CoinOverview = ({ + {t('portfolio')} @@ -201,16 +194,10 @@ export const CoinOverview = ({ {t('portfolio')} diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index 5e187e7e7e55..a4e3aca3d6fa 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -30,17 +30,6 @@ padding: 0 16px; } - &__portfolio_text { - font-family: "Euclid Circular B" !important; - font-size: 16px !important; - font-weight: 500 !important; - line-height: 22px !important; - - @include design-system.screen-sm-max { - font-size: 14px !important; - } - } - &__currency-wrapper { display: flex; flex-direction: row; @@ -95,11 +84,6 @@ margin-left: 4px; } - &__portfolio-button { - height: inherit; - padding-inline-start: 16px; - } - &__cached-balance, &__cached-star { color: var(--color-warning-default); @@ -167,11 +151,6 @@ color: var(--color-text-alternative); } - &__portfolio-button { - height: inherit; - padding-inline-start: 16px; - } - &__button:last-of-type { margin-right: 0; } From fa835b12d05ca8fe3994d5316913d9ed4e7b2bdc Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 18 Sep 2024 00:49:35 +0200 Subject: [PATCH 65/68] fix: add coin buttons storybook --- .../wallet-overview/coin-buttons.stories.js | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ui/components/app/wallet-overview/coin-buttons.stories.js diff --git a/ui/components/app/wallet-overview/coin-buttons.stories.js b/ui/components/app/wallet-overview/coin-buttons.stories.js new file mode 100644 index 000000000000..40a6879673a8 --- /dev/null +++ b/ui/components/app/wallet-overview/coin-buttons.stories.js @@ -0,0 +1,37 @@ +import React from 'react'; +import CoinButtons from './coin-buttons'; + +export default { + title: 'Components/App/WalletOverview/CoinButtons', + args: { + chainId: '1', + trackingLocation: 'home', + isSwapsChain: true, + isSigningEnabled: true, + isBridgeChain: true, + isBuyableChain: true, + defaultSwapsToken: { + symbol: 'ETH', + name: 'Ether', + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + iconUrl: './images/eth_logo.svg', + balance: '3093640202103801', + string: '0.0031', + }, + classPrefix: 'coin', + iconButtonClassName: '', + }, + component: CoinButtons, + parameters: { + docs: { + description: { + component: 'A component that displays coin buttons', + }, + }, + }, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); From 9fe85ddcd7b5a0e029eba222c1990023e74a5123 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 18 Sep 2024 01:23:47 +0200 Subject: [PATCH 66/68] fix: revert XS buttonIcon change --- ui/components/app/wallet-overview/coin-overview.tsx | 2 +- ui/components/component-library/button-icon/button-icon.tsx | 1 - .../component-library/button-icon/button-icon.types.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index f06f9964edae..2e05b1f731df 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -270,7 +270,7 @@ export const CoinOverview = ({ {t('yourBalanceIsAggregated')} = { [ButtonIconSize.Sm]: IconSize.Sm, [ButtonIconSize.Md]: IconSize.Md, [ButtonIconSize.Lg]: IconSize.Lg, - [ButtonIconSize.Xs]: IconSize.Xs, }; export const ButtonIcon: ButtonIconComponent = React.forwardRef( diff --git a/ui/components/component-library/button-icon/button-icon.types.ts b/ui/components/component-library/button-icon/button-icon.types.ts index 786320e13f6a..6f6c52cb23d7 100644 --- a/ui/components/component-library/button-icon/button-icon.types.ts +++ b/ui/components/component-library/button-icon/button-icon.types.ts @@ -6,7 +6,6 @@ export enum ButtonIconSize { Sm = 'sm', Md = 'md', Lg = 'lg', - Xs = 'Xs', } /** From 5e720c6ca6d693fd7006e113861c9c3e0a054ade Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 18 Sep 2024 19:43:12 +0200 Subject: [PATCH 67/68] fix: fix popover text css --- ui/components/app/wallet-overview/coin-overview.tsx | 8 +++----- ui/components/app/wallet-overview/index.scss | 7 ------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 2e05b1f731df..b67311403309 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -17,6 +17,7 @@ import { } from '../../component-library'; import { AlignItems, + BlockSize, Display, JustifyContent, TextAlign, @@ -251,6 +252,7 @@ export const CoinOverview = ({ flip data-theme={theme === 'light' ? 'dark' : 'light'} className="balance-popover__container" + width={BlockSize.Full} padding={3} onClickOutside={handleClick} onPressEscKey={handleClick} @@ -265,7 +267,6 @@ export const CoinOverview = ({ variant={TextVariant.bodySmBold} textAlign={TextAlign.Left} alignItems={AlignItems.flexStart} - className="balance-popover__text" > {t('yourBalanceIsAggregated')} @@ -278,10 +279,7 @@ export const CoinOverview = ({ /> - + { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Expected 0-1 arguments, but got 2. diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index a4e3aca3d6fa..32135fac6fda 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -157,14 +157,7 @@ } .balance-popover { - &__text { - font-size: 12px; - line-height: 20px; - letter-spacing: 0.25px; - } - &__container { - width: 248px !important; z-index: design-system.$modal-z-index; } } From a771b7579f5bc3432ced683dcccc6d101a695312 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 18 Sep 2024 20:03:13 +0200 Subject: [PATCH 68/68] fix: rm font-size from setting css --- ui/pages/settings/index.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/pages/settings/index.scss b/ui/pages/settings/index.scss index 3aff63b6a499..b4cea4bef630 100644 --- a/ui/pages/settings/index.scss +++ b/ui/pages/settings/index.scss @@ -332,7 +332,6 @@ &__description { @include design-system.H6; - font-size: 14px; line-height: 22px; } }