diff --git a/ui/components/app/wallet-overview/coin-buttons.tsx b/ui/components/app/wallet-overview/coin-buttons.tsx index 5a8f1a1dea6f..426713f5d086 100644 --- a/ui/components/app/wallet-overview/coin-buttons.tsx +++ b/ui/components/app/wallet-overview/coin-buttons.tsx @@ -65,8 +65,8 @@ import IconButton from '../../ui/icon-button'; ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) import useRamps from '../../../hooks/ramps/useRamps/useRamps'; import useBridging from '../../../hooks/bridge/useBridging'; -import { ReceiveModal } from '../../multichain/receive-modal'; ///: END:ONLY_INCLUDE_IF +import { ReceiveModal } from '../../multichain/receive-modal'; const CoinButtons = ({ chainId, diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index ad47813f1808..0293876539e1 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -1,28 +1,36 @@ -import React, { useContext, useCallback } from 'react'; +import React, { + useContext, + ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) + useCallback, + ///: END:ONLY_INCLUDE_IF +} from 'react'; import { useSelector } from 'react-redux'; import classnames from 'classnames'; import { zeroAddress } from 'ethereumjs-util'; import { CaipChainId } from '@metamask/utils'; import type { Hex } from '@metamask/utils'; +///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) import { Icon, IconName, IconSize } from '../../component-library'; import { IconColor } from '../../../helpers/constants/design-system'; +import { getPortfolioUrl } from '../../../helpers/utils/portfolio'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { MetaMetricsEventCategory, MetaMetricsEventName, } from '../../../../shared/constants/metametrics'; -import { getPortfolioUrl } from '../../../helpers/utils/portfolio'; +///: END:ONLY_INCLUDE_IF + 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 { - getDataCollectionForMarketing, - getMetaMetricsId, - getParticipateInMetaMetrics, getPreferences, getTokensMarketData, ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) + getDataCollectionForMarketing, + getMetaMetricsId, + getParticipateInMetaMetrics, SwapsEthToken, ///: END:ONLY_INCLUDE_IF } from '../../../selectors'; @@ -76,11 +84,14 @@ export const CoinOverview = ({ ///: END:ONLY_INCLUDE_IF const t = useContext(I18nContext); + + ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) const trackEvent = useContext(MetaMetricsContext); const metaMetricsId = useSelector(getMetaMetricsId); const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics); const isMarketingEnabled = useSelector(getDataCollectionForMarketing); + ///: END:ONLY_INCLUDE_IF const isEvm = useSelector(getMultichainIsEvm); const showFiat = useSelector(getMultichainShouldShowFiat); @@ -94,6 +105,7 @@ export const CoinOverview = ({ ); const tokensMarketData = useSelector(getTokensMarketData); + ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) const handlePortfolioOnClick = useCallback(() => { const url = getPortfolioUrl( '', @@ -112,6 +124,7 @@ export const CoinOverview = ({ }, }); }, [isMarketingEnabled, isMetaMetricsEnabled, metaMetricsId, trackEvent]); + ///: END:ONLY_INCLUDE_IF return ( )} -
- {t('portfolio')} - -
+ { + ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) +
+ {t('portfolio')} + +
+ ///: END:ONLY_INCLUDE_IF + } {isEvm && ( { getIsNoteToTraderSupported(state, fromChecksumHexAddress), ); + const MAX_LENGTH = 280; + useEffect(() => { const timer = setTimeout(() => { dispatch(setNoteToTraderMessage(noteText)); @@ -42,7 +44,11 @@ const NoteToTrader: React.FC = () => { return () => clearTimeout(timer); }, [noteText]); - return isNoteToTraderSupported && !isSignature ? ( + if (!isNoteToTraderSupported || isSignature) { + return null; + } + + return ( { > - {noteText.length}/{280} + {noteText.length}/{MAX_LENGTH} { value={noteText} height={BlockSize.Full} width={BlockSize.Full} - maxLength={280} + maxLength={MAX_LENGTH} placeholder={t('notePlaceholder')} padding={2} /> - ) : null; + ); }; export default NoteToTrader;