From f0cc923459236a6d4ee898bdcd00d4f7ed0d0871 Mon Sep 17 00:00:00 2001 From: digiwand <20778143+digiwand@users.noreply.github.com> Date: Fri, 10 Jan 2025 19:15:10 -0800 Subject: [PATCH] build: mv permit simulation files --- .../Info/TypedSign/PermitSimulation/index.ts | 1 - .../Info/TypedSignV3V4/TypedSignV3V4.tsx | 2 +- .../Permit/Permit.test.tsx} | 6 ++-- .../Permit/Permit.tsx} | 18 +++++----- .../ValueDisplay/ValueDisplay.styles.ts | 2 +- .../ValueDisplay/ValueDisplay.test.tsx | 16 ++++----- .../Permit}/ValueDisplay/ValueDisplay.tsx | 36 +++++++++---------- .../Permit}/ValueDisplay/index.ts | 0 .../Confirm/Simulation/Permit/index.ts | 1 + 9 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/index.ts rename app/components/Views/confirmations/components/Confirm/{Info/TypedSign/PermitSimulation/PermitSimulation.test.tsx => Simulation/Permit/Permit.test.tsx} (78%) rename app/components/Views/confirmations/components/Confirm/{Info/TypedSign/PermitSimulation/PermitSimulation.tsx => Simulation/Permit/Permit.tsx} (82%) rename app/components/Views/confirmations/components/Confirm/{Info/TypedSign/PermitSimulation => Simulation/Permit}/ValueDisplay/ValueDisplay.styles.ts (98%) rename app/components/Views/confirmations/components/Confirm/{Info/TypedSign/PermitSimulation => Simulation/Permit}/ValueDisplay/ValueDisplay.test.tsx (87%) rename app/components/Views/confirmations/components/Confirm/{Info/TypedSign/PermitSimulation => Simulation/Permit}/ValueDisplay/ValueDisplay.tsx (79%) rename app/components/Views/confirmations/components/Confirm/{Info/TypedSign/PermitSimulation => Simulation/Permit}/ValueDisplay/index.ts (100%) create mode 100644 app/components/Views/confirmations/components/Confirm/Simulation/Permit/index.ts diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/index.ts b/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/index.ts deleted file mode 100644 index 43538766e64..00000000000 --- a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './PermitSimulation'; diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSignV3V4/TypedSignV3V4.tsx b/app/components/Views/confirmations/components/Confirm/Info/TypedSignV3V4/TypedSignV3V4.tsx index 89a953d71e5..4d0fe51abc5 100644 --- a/app/components/Views/confirmations/components/Confirm/Info/TypedSignV3V4/TypedSignV3V4.tsx +++ b/app/components/Views/confirmations/components/Confirm/Info/TypedSignV3V4/TypedSignV3V4.tsx @@ -4,7 +4,7 @@ import { selectUseTransactionSimulations } from '../../../../../../../selectors/ import useApprovalRequest from '../../../../hooks/useApprovalRequest'; import { isRecognizedPermit } from '../../../../utils/signature'; import InfoRowOrigin from '../Shared/InfoRowOrigin'; -import PermitSimulation from '../TypedSign/PermitSimulation/PermitSimulation'; +import PermitSimulation from '../../Simulation/PermitSimulation'; import Message from './Message'; const TypedSignV3V4 = () => { diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/PermitSimulation.test.tsx b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/Permit.test.tsx similarity index 78% rename from app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/PermitSimulation.test.tsx rename to app/components/Views/confirmations/components/Confirm/Simulation/Permit/Permit.test.tsx index 5b7157bd1d2..a9e1f651d41 100644 --- a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/PermitSimulation.test.tsx +++ b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/Permit.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import renderWithProvider from '../../../../../../../../util/test/renderWithProvider'; -import { typedSignV4ConfirmationState } from '../../../../../../../../util/test/confirm-data-helpers'; -import PermitSimulation from './PermitSimulation'; +import renderWithProvider from '../../../../../../../util/test/renderWithProvider'; +import { typedSignV4ConfirmationState } from '../../../../../../../util/test/confirm-data-helpers'; +import PermitSimulation from './Permit'; describe('PermitSimulation', () => { it('should render correctly for personal sign', async () => { diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/PermitSimulation.tsx b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/Permit.tsx similarity index 82% rename from app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/PermitSimulation.tsx rename to app/components/Views/confirmations/components/Confirm/Simulation/Permit/Permit.tsx index cc80cae0f26..929dd8c7c2d 100644 --- a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/PermitSimulation.tsx +++ b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/Permit.tsx @@ -2,15 +2,15 @@ import React from 'react'; import { useSelector } from 'react-redux'; import { StyleSheet, View } from 'react-native'; -import { strings } from '../../../../../../../../../locales/i18n'; -import { useStyles } from '../../../../../../../../component-library/hooks'; -import { selectChainId } from '../../../../../../../../selectors/networkController'; -import { safeToChecksumAddress } from '../../../../../../../../util/address'; -import { PrimaryType } from '../../../../../constants/signatures'; -import useApprovalRequest from '../../../../../hooks/useApprovalRequest'; -import { parseTypedDataMessage } from '../../../../../utils/signature'; -import InfoRow from '../../../../UI/InfoRow'; -import InfoSection from '../../../../UI/InfoRow/InfoSection'; +import { strings } from '../../../../../../../../locales/i18n'; +import { useStyles } from '../../../../../../../component-library/hooks'; +import { selectChainId } from '../../../../../../../selectors/networkController'; +import { safeToChecksumAddress } from '../../../../../../../util/address'; +import { PrimaryType } from '../../../../constants/signatures'; +import useApprovalRequest from '../../../../hooks/useApprovalRequest'; +import { parseTypedDataMessage } from '../../../../utils/signature'; +import InfoRow from '../../../UI/InfoRow'; +import InfoSection from '../../../UI/InfoRow/InfoSection'; import PermitSimulationValueDisplay from './ValueDisplay'; const styleSheet = () => diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.styles.ts b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.styles.ts similarity index 98% rename from app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.styles.ts rename to app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.styles.ts index 6ffd38f4ffc..b4269038bac 100644 --- a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.styles.ts +++ b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.styles.ts @@ -1,6 +1,6 @@ import { StyleSheet } from 'react-native'; import { Theme } from '@metamask/design-tokens'; -import { fontStyles, colors as importedColors } from '../../../../../../../../../styles/common'; +import { fontStyles, colors as importedColors } from '../../../../../../../../styles/common'; const styleSheet = (colors: Theme['colors']) => StyleSheet.create({ diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.test.tsx b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.test.tsx similarity index 87% rename from app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.test.tsx rename to app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.test.tsx index 7f570674a9d..f73178c150f 100644 --- a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.test.tsx +++ b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.test.tsx @@ -3,14 +3,14 @@ import React from 'react'; import { act } from '@testing-library/react-native'; import PermitSimulationValueDisplay from './ValueDisplay'; -import { memoizedGetTokenStandardAndDetails } from '../../../../../../utils/token'; -import useGetTokenStandardAndDetails from '../../../../../../hooks/useGetTokenStandardAndDetails'; -import { TokenStandard } from '../../../../../../../../UI/SimulationDetails/types'; -import { getTokenDetails } from '../../../../../../../../../util/address'; -import { backgroundState } from '../../../../../../../../../util/test/initial-root-state'; -import renderWithProvider from '../../../../../../../../../util/test/renderWithProvider'; -import { useMetrics } from '../../../../../../../../../components/hooks/useMetrics'; -import { MetricsEventBuilder } from '../../../../../../../../../core/Analytics/MetricsEventBuilder'; +import { memoizedGetTokenStandardAndDetails } from '../../../../../utils/token'; +import useGetTokenStandardAndDetails from '../../../../../hooks/useGetTokenStandardAndDetails'; +import { TokenStandard } from '../../../../../../../UI/SimulationDetails/types'; +import { getTokenDetails } from '../../../../../../../../util/address'; +import { backgroundState } from '../../../../../../../../util/test/initial-root-state'; +import renderWithProvider from '../../../../../../../../util/test/renderWithProvider'; +import { useMetrics } from '../../../../../../../hooks/useMetrics'; +import { MetricsEventBuilder } from '../../../../../../../../core/Analytics/MetricsEventBuilder'; const mockInitialState = { engine: { diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.tsx b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.tsx similarity index 79% rename from app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.tsx rename to app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.tsx index e2b1aaee662..77fc99e6dd9 100644 --- a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/ValueDisplay.tsx +++ b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/ValueDisplay.tsx @@ -3,32 +3,32 @@ import { TouchableOpacity, View } from 'react-native'; import { useSelector } from 'react-redux'; import { Hex } from '@metamask/utils'; -import ButtonPill from '../../../../../../../../../component-library/components-temp/Buttons/ButtonPill/ButtonPill'; -import { ButtonIconSizes } from '../../../../../../../../../component-library/components/Buttons/ButtonIcon/ButtonIcon.types'; -import ButtonIcon from '../../../../../../../../../component-library/components/Buttons/ButtonIcon/ButtonIcon'; -import { IconName , IconColor } from '../../../../../../../../../component-library/components/Icons/Icon'; -import Text from '../../../../../../../../../component-library/components/Texts/Text'; +import ButtonPill from '../../../../../../../../component-library/components-temp/Buttons/ButtonPill/ButtonPill'; +import { ButtonIconSizes } from '../../../../../../../../component-library/components/Buttons/ButtonIcon/ButtonIcon.types'; +import ButtonIcon from '../../../../../../../../component-library/components/Buttons/ButtonIcon/ButtonIcon'; +import { IconName , IconColor } from '../../../../../../../../component-library/components/Icons/Icon'; +import Text from '../../../../../../../../component-library/components/Texts/Text'; -import { IndividualFiatDisplay } from '../../../../../../../../UI/SimulationDetails/FiatDisplay/FiatDisplay'; +import { IndividualFiatDisplay } from '../../../../../../../UI/SimulationDetails/FiatDisplay/FiatDisplay'; import { formatAmount, formatAmountMaxPrecision, -} from '../../../../../../../../UI/SimulationDetails/formatAmount'; +} from '../../../../../../../UI/SimulationDetails/formatAmount'; -import Box from '../../../../../../../../UI/Ramp/components/Box'; -import Address from '../../../../../UI/InfoRow/InfoValue/Address/Address'; +import Box from '../../../../../../../UI/Ramp/components/Box'; +import Address from '../../../../UI/InfoRow/InfoValue/Address/Address'; -import { selectContractExchangeRates } from '../../../../../../../../../selectors/tokenRatesController'; +import { selectContractExchangeRates } from '../../../../../../../../selectors/tokenRatesController'; -import Logger from '../../../../../../../../../util/Logger'; -import { shortenString } from '../../../../../../../../../util/notifications/methods/common'; -import { useTheme } from '../../../../../../../../../util/theme'; -import { calcTokenAmount } from '../../../../../../../../../util/transactions'; +import Logger from '../../../../../../../../util/Logger'; +import { shortenString } from '../../../../../../../../util/notifications/methods/common'; +import { useTheme } from '../../../../../../../../util/theme'; +import { calcTokenAmount } from '../../../../../../../../util/transactions'; -import useGetTokenStandardAndDetails from '../../../../../../hooks/useGetTokenStandardAndDetails'; -import useTrackERC20WithoutDecimalInformation from '../../../../../../hooks/useTrackERC20WithoutDecimalInformation'; -import { TokenDetailsERC20 } from '../../../../../../utils/token'; -import BottomModal from '../../../../../UI/BottomModal'; +import useGetTokenStandardAndDetails from '../../../../../hooks/useGetTokenStandardAndDetails'; +import useTrackERC20WithoutDecimalInformation from '../../../../../hooks/useTrackERC20WithoutDecimalInformation'; +import { TokenDetailsERC20 } from '../../../../../utils/token'; +import BottomModal from '../../../../UI/BottomModal'; import styleSheet from './ValueDisplay.styles'; diff --git a/app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/index.ts b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/index.ts similarity index 100% rename from app/components/Views/confirmations/components/Confirm/Info/TypedSign/PermitSimulation/ValueDisplay/index.ts rename to app/components/Views/confirmations/components/Confirm/Simulation/Permit/ValueDisplay/index.ts diff --git a/app/components/Views/confirmations/components/Confirm/Simulation/Permit/index.ts b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/index.ts new file mode 100644 index 00000000000..c08b448a956 --- /dev/null +++ b/app/components/Views/confirmations/components/Confirm/Simulation/Permit/index.ts @@ -0,0 +1 @@ +export { default } from './Permit';