Renamed metametrics.new.js to metametrics.js (#14327)

feature/default_network_editable
filipsekulic 3 years ago committed by GitHub
parent cb963f3c29
commit 8cb1f4af2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      .storybook/metametrics.js
  2. 2
      ui/components/app/asset-list-item/asset-list-item.js
  3. 2
      ui/components/app/asset-list/asset-list.js
  4. 2
      ui/components/app/create-new-vault/create-new-vault.js
  5. 2
      ui/components/app/edit-gas-display/edit-gas-display.component.js
  6. 2
      ui/components/app/import-token-link/import-token-link.component.js
  7. 2
      ui/components/app/menu-bar/account-options-menu.js
  8. 2
      ui/components/app/menu-bar/menu-bar.js
  9. 2
      ui/components/app/transaction-list-item/transaction-list-item.component.js
  10. 2
      ui/components/app/wallet-overview/eth-overview.js
  11. 2
      ui/components/app/wallet-overview/token-overview.js
  12. 0
      ui/contexts/metametrics.js
  13. 2
      ui/pages/asset/components/native-asset.js
  14. 2
      ui/pages/asset/components/token-asset.js
  15. 4
      ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js
  16. 4
      ui/pages/confirm-import-token/confirm-import-token.js
  17. 14
      ui/pages/index.js
  18. 2
      ui/pages/onboarding-flow/create-password/create-password.js
  19. 2
      ui/pages/onboarding-flow/creation-successful/creation-successful.js
  20. 2
      ui/pages/onboarding-flow/metametrics/metametrics.js
  21. 2
      ui/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.js
  22. 2
      ui/pages/send/send.js
  23. 2
      ui/pages/swaps/awaiting-signatures/awaiting-signatures.js
  24. 2
      ui/pages/swaps/awaiting-swap/awaiting-swap.js
  25. 2
      ui/pages/swaps/awaiting-swap/view-on-ether-scan-link/view-on-ether-scan-link.js
  26. 2
      ui/pages/swaps/build-quote/build-quote.js
  27. 2
      ui/pages/swaps/dropdown-search-list/dropdown-search-list.js
  28. 2
      ui/pages/swaps/fee-card/fee-card.js
  29. 2
      ui/pages/swaps/index.js
  30. 2
      ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes.js
  31. 2
      ui/pages/swaps/searchable-item-list/item-list/item-list.component.js
  32. 2
      ui/pages/swaps/smart-transaction-status/smart-transaction-status.js
  33. 2
      ui/pages/swaps/view-quote/view-quote.js

@ -1,16 +1,16 @@
import React from 'react';
import {
MetaMetricsProvider as NewMetaMetricsProvider,
LegacyMetaMetricsProvider as NewLegacyMetaMetricsProvider,
} from '../ui/contexts/metametrics.new';
MetaMetricsProvider,
LegacyMetaMetricsProvider
} from '../ui/contexts/metametrics';
const MetaMetricsProviderStorybook = (props) =>
(
<NewMetaMetricsProvider>
<NewLegacyMetaMetricsProvider>
<MetaMetricsProvider>
<LegacyMetaMetricsProvider>
{props.children}
</NewLegacyMetaMetricsProvider>
</NewMetaMetricsProvider>
</LegacyMetaMetricsProvider>
</MetaMetricsProvider>
);
export default MetaMetricsProviderStorybook

@ -14,7 +14,7 @@ import { SEND_ROUTE } from '../../../helpers/constants/routes';
import { SEVERITIES } from '../../../helpers/constants/design-system';
import { INVALID_ASSET_TYPE } from '../../../helpers/constants/error-keys';
import { ASSET_TYPES } from '../../../../shared/constants/transaction';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
const AssetListItem = ({
className,

@ -25,7 +25,7 @@ import {
JUSTIFY_CONTENT,
} from '../../../helpers/constants/design-system';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
const AssetList = ({ onClickAsset }) => {
const t = useI18nContext();

@ -1,7 +1,7 @@
import React, { useCallback, useContext, useState } from 'react';
import PropTypes from 'prop-types';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import TextField from '../../ui/text-field';
import Button from '../../ui/button';
import CheckBox from '../../ui/check-box';

@ -35,7 +35,7 @@ import ActionableMessage from '../../ui/actionable-message/actionable-message';
import { I18nContext } from '../../../contexts/i18n';
import GasTiming from '../gas-timing';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
export default function EditGasDisplay({
mode = EDIT_GAS_MODES.MODIFY_IN_PLACE,

@ -7,7 +7,7 @@ import Button from '../../ui/button';
import Box from '../../ui/box/box';
import { TEXT_ALIGN } from '../../../helpers/constants/design-system';
import { detectNewTokens } from '../../../store/actions';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
export default function ImportTokenLink({ isMainnet }) {
const trackEvent = useContext(MetaMetricsContext);

@ -17,7 +17,7 @@ import {
import { useI18nContext } from '../../../hooks/useI18nContext';
import { getEnvironmentType } from '../../../../app/scripts/lib/util';
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../shared/constants/app';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
export default function AccountOptionsMenu({ anchorElement, onClose }) {
const t = useI18nContext();

@ -9,7 +9,7 @@ import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app';
import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { getOriginOfCurrentTab } from '../../../selectors';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import AccountOptionsMenu from './account-options-menu';
export default function MenuBar() {

@ -37,7 +37,7 @@ import CancelButton from '../cancel-button';
import CancelSpeedupPopover from '../cancel-speedup-popover';
import EditGasFeePopover from '../edit-gas-fee-popover';
import EditGasPopover from '../edit-gas-popover';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
function TransactionListItemInner({
transactionGroup,

@ -30,7 +30,7 @@ import SendIcon from '../../ui/icon/overview-send-icon.component';
import { setSwapsFromToken } from '../../../ducks/swaps/swaps';
import IconButton from '../../ui/icon-button';
import { isHardwareKeyring } from '../../../helpers/utils/hardware';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import WalletOverview from './wallet-overview';
const EthOverview = ({ className }) => {

@ -27,7 +27,7 @@ import SendIcon from '../../ui/icon/overview-send-icon.component';
import IconButton from '../../ui/icon-button';
import { INVALID_ASSET_TYPE } from '../../../helpers/constants/error-keys';
import { showModal } from '../../../store/actions';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import { ASSET_TYPES } from '../../../../shared/constants/transaction';
import WalletOverview from './wallet-overview';

@ -14,7 +14,7 @@ import {
import { showModal } from '../../../store/actions';
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes';
import { getURLHostName } from '../../../helpers/utils/util';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import AssetNavigation from './asset-navigation';
import AssetOptions from './asset-options';

@ -16,7 +16,7 @@ import {
} from '../../../helpers/constants/routes';
import { getURLHostName } from '../../../helpers/utils/util';
import { showModal } from '../../../store/actions';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import AssetNavigation from './asset-navigation';
import AssetOptions from './asset-options';

@ -6,7 +6,7 @@ import Button from '../../components/ui/button';
import Identicon from '../../components/ui/identicon';
import TokenBalance from '../../components/ui/token-balance';
import { I18nContext } from '../../contexts/i18n';
import { MetaMetricsContext as NewMetaMetricsContext } from '../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../contexts/metametrics';
import { getMostRecentOverviewPage } from '../../ducks/history/history';
import { getTokens } from '../../ducks/metamask/metamask';
import ZENDESK_URLS from '../../helpers/constants/zendesk-url';
@ -67,7 +67,7 @@ const ConfirmAddSuggestedToken = () => {
const suggestedAssets = useSelector(getSuggestedAssets);
const tokens = useSelector(getTokens);
const trackEvent = useContext(NewMetaMetricsContext);
const trackEvent = useContext(MetaMetricsContext);
const knownTokenActionableMessage = useMemo(() => {
return (

@ -9,7 +9,7 @@ import Button from '../../components/ui/button';
import Identicon from '../../components/ui/identicon';
import TokenBalance from '../../components/ui/token-balance';
import { I18nContext } from '../../contexts/i18n';
import { MetaMetricsContext as NewMetaMetricsContext } from '../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../contexts/metametrics';
import { getMostRecentOverviewPage } from '../../ducks/history/history';
import { getPendingTokens } from '../../ducks/metamask/metamask';
import { addTokens, clearPendingTokens } from '../../store/actions';
@ -24,7 +24,7 @@ const ConfirmImportToken = () => {
const t = useContext(I18nContext);
const dispatch = useDispatch();
const history = useHistory();
const trackEvent = useContext(NewMetaMetricsContext);
const trackEvent = useContext(MetaMetricsContext);
const mostRecentOverviewPage = useSelector(getMostRecentOverviewPage);
const pendingTokens = useSelector(getPendingTokens);

@ -5,9 +5,9 @@ import { HashRouter } from 'react-router-dom';
import * as Sentry from '@sentry/browser';
import { I18nProvider, LegacyI18nProvider } from '../contexts/i18n';
import {
MetaMetricsProvider as NewMetaMetricsProvider,
LegacyMetaMetricsProvider as NewLegacyMetaMetricsProvider,
} from '../contexts/metametrics.new';
MetaMetricsProvider,
LegacyMetaMetricsProvider,
} from '../contexts/metametrics';
import ErrorPage from './error';
import Routes from './routes';
@ -41,15 +41,15 @@ class Index extends PureComponent {
return (
<Provider store={store}>
<HashRouter hashType="noslash">
<NewMetaMetricsProvider>
<NewLegacyMetaMetricsProvider>
<MetaMetricsProvider>
<LegacyMetaMetricsProvider>
<I18nProvider>
<LegacyI18nProvider>
<Routes />
</LegacyI18nProvider>
</I18nProvider>
</NewLegacyMetaMetricsProvider>
</NewMetaMetricsProvider>
</LegacyMetaMetricsProvider>
</MetaMetricsProvider>
</HashRouter>
</Provider>
);

@ -29,7 +29,7 @@ import {
import ZENDESK_URLS from '../../../helpers/constants/zendesk-url';
import { getFirstTimeFlowType } from '../../../selectors';
import { FIRST_TIME_FLOW_TYPES } from '../../../helpers/constants/onboarding';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
export default function CreatePassword({
createNewAccount,

@ -16,7 +16,7 @@ import {
} from '../../../helpers/constants/routes';
import { setCompletedOnboarding } from '../../../store/actions';
import { getFirstTimeFlowType } from '../../../selectors';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
export default function CreationSuccessful() {
const firstTimeFlowTypeNameMap = {

@ -17,7 +17,7 @@ import {
getParticipateInMetaMetrics,
} from '../../../selectors';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
const firstTimeFlowTypeNameMap = {
create: 'Selected Create New Wallet',

@ -7,7 +7,7 @@ import {
toggleSendMaxMode,
} from '../../../../../ducks/send';
import { useI18nContext } from '../../../../../hooks/useI18nContext';
import { MetaMetricsContext } from '../../../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../../../contexts/metametrics';
export default function AmountMaxButton() {
const isDraftTransactionInvalid = useSelector(isSendFormInvalid);

@ -16,7 +16,7 @@ import {
import { getCurrentChainId, isCustomPriceExcessive } from '../../selectors';
import { getSendHexDataFeatureFlagState } from '../../ducks/metamask/metamask';
import { showQrScanner } from '../../store/actions';
import { MetaMetricsContext } from '../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../contexts/metametrics';
import SendHeader from './send-header';
import AddRecipient from './send-content/add-recipient';
import SendContent from './send-content';

@ -32,7 +32,7 @@ import {
DISPLAY,
} from '../../../helpers/constants/design-system';
import SwapsFooter from '../swaps-footer';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import SwapStepIcon from './swap-step-icon';
export default function AwaitingSignatures() {

@ -7,7 +7,7 @@ import isEqual from 'lodash/isEqual';
import { getBlockExplorerLink } from '@metamask/etherscan-link';
import { I18nContext } from '../../../contexts/i18n';
import { SUPPORT_LINK } from '../../../helpers/constants/common';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import {
getCurrentChainId,

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classnames from 'classnames';
import { I18nContext } from '../../../../contexts/i18n';
import { getURLHostName } from '../../../../helpers/utils/util';
import { MetaMetricsContext } from '../../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../../contexts/metametrics';
export default function ViewOnEtherScanLink({
txHash,

@ -6,7 +6,7 @@ import classnames from 'classnames';
import { uniqBy, isEqual } from 'lodash';
import { useHistory } from 'react-router-dom';
import { getTokenTrackerLink } from '@metamask/etherscan-link';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import {
useTokensToSearch,
getRenderableTokenData,

@ -28,7 +28,7 @@ import {
getSmartTransactionsEnabled,
getCurrentSmartTransactionsEnabled,
} from '../../../ducks/swaps/swaps';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
export default function DropdownSearchList({
searchListClassName,

@ -19,7 +19,7 @@ import {
FONT_WEIGHT,
} from '../../../helpers/constants/design-system';
import GasDetailsItemTitle from '../../../components/app/gas-details-item/gas-details-item-title';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
const GAS_FEES_LEARN_MORE_URL =
'https://community.metamask.io/t/what-is-gas-why-do-transactions-take-so-long/3172';

@ -85,7 +85,7 @@ import { useGasFeeEstimates } from '../../hooks/useGasFeeEstimates';
import FeatureToggledRoute from '../../helpers/higher-order-components/feature-toggled-route';
import { TRANSACTION_STATUSES } from '../../../shared/constants/transaction';
import ActionableMessage from '../../components/ui/actionable-message';
import { MetaMetricsContext } from '../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../contexts/metametrics';
import {
fetchTokens,
fetchTopAssets,

@ -18,7 +18,7 @@ import {
getHardwareWalletType,
} from '../../../selectors/selectors';
import { I18nContext } from '../../../contexts/i18n';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import Mascot from '../../../components/ui/mascot';
import SwapsFooter from '../swaps-footer';
import BackgroundAnimation from './background-animation';

@ -13,7 +13,7 @@ import {
} from '../../../../selectors';
import { SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP } from '../../../../../shared/constants/swaps';
import { getURLHostName } from '../../../../helpers/utils/util';
import { MetaMetricsContext } from '../../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../../contexts/metametrics';
export default function ItemList({
results = [],

@ -44,7 +44,7 @@ import { SMART_TRANSACTION_STATUSES } from '../../../../shared/constants/transac
import SwapsFooter from '../swaps-footer';
import { calcTokenAmount } from '../../../helpers/utils/token-util';
import { showRemainingTimeInMinAndSec } from '../swaps.util';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import SuccessIcon from './success-icon';
import RevertedIcon from './reverted-icon';
import CanceledIcon from './canceled-icon';

@ -17,7 +17,7 @@ import { useEthFiatAmount } from '../../../hooks/useEthFiatAmount';
import { useEqualityCheck } from '../../../hooks/useEqualityCheck';
import { usePrevious } from '../../../hooks/usePrevious';
import { useGasFeeInputs } from '../../../hooks/gasFeeInput/useGasFeeInputs';
import { MetaMetricsContext } from '../../../contexts/metametrics.new';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import FeeCard from '../fee-card';
import EditGasPopover from '../../../components/app/edit-gas-popover/edit-gas-popover.component';
import {

Loading…
Cancel
Save