diff --git a/src/fiatExchanges/saga.test.ts b/src/fiatExchanges/saga.test.ts index 40a054d27c3..804ee205792 100644 --- a/src/fiatExchanges/saga.test.ts +++ b/src/fiatExchanges/saga.test.ts @@ -108,7 +108,7 @@ describe(watchBidaliPaymentRequests, () => { .dispatch(sendPaymentSuccess({ amount, tokenId: expectedTokenId })) .run() - expect(navigate).toHaveBeenCalledWith(Screens.SendConfirmationModal, { + expect(navigate).toHaveBeenCalledWith(Screens.SendConfirmationFromExternal, { origin: SendOrigin.Bidali, transactionData: { inputAmount: amount, @@ -162,7 +162,7 @@ describe(watchBidaliPaymentRequests, () => { .dispatch(activeScreenChanged(Screens.BidaliScreen)) .run() - expect(navigate).toHaveBeenCalledWith(Screens.SendConfirmationModal, { + expect(navigate).toHaveBeenCalledWith(Screens.SendConfirmationFromExternal, { origin: SendOrigin.Bidali, transactionData: { inputAmount: amount, diff --git a/src/fiatExchanges/saga.ts b/src/fiatExchanges/saga.ts index 2973fc942db..a598f3d3f20 100644 --- a/src/fiatExchanges/saga.ts +++ b/src/fiatExchanges/saga.ts @@ -78,7 +78,7 @@ function* bidaliPaymentRequest({ tokenAmount: new BigNumber(amount), } - navigate(Screens.SendConfirmationModal, { + navigate(Screens.SendConfirmationFromExternal, { transactionData, origin: SendOrigin.Bidali, isFromScan: false, diff --git a/src/navigator/Navigator.tsx b/src/navigator/Navigator.tsx index 107ecb3ff2f..a7ae1ac25f5 100644 --- a/src/navigator/Navigator.tsx +++ b/src/navigator/Navigator.tsx @@ -690,7 +690,7 @@ const modalAnimatedScreens = (Navigator: typeof Stack) => ( options={SelectCountry.navigationOptions as NativeStackNavigationOptions} /> diff --git a/src/navigator/Screens.tsx b/src/navigator/Screens.tsx index 1d49bc47fad..2a1f664aa7a 100644 --- a/src/navigator/Screens.tsx +++ b/src/navigator/Screens.tsx @@ -77,7 +77,7 @@ export enum Screens { SelectProvider = 'SelectProvider', SendSelectRecipient = 'SendSelectRecipient', SendConfirmation = 'SendConfirmation', - SendConfirmationModal = 'SendConfirmationModal', + SendConfirmationFromExternal = 'SendConfirmationFromExternal', SendEnterAmount = 'SendEnterAmount', SignInWithEmail = 'SignInWithEmail', Simplex = 'Simplex', diff --git a/src/navigator/types.tsx b/src/navigator/types.tsx index 0a405b1917b..ed33cd6f505 100644 --- a/src/navigator/types.tsx +++ b/src/navigator/types.tsx @@ -248,7 +248,7 @@ export type StackParamList = { } | undefined [Screens.SendConfirmation]: SendConfirmationParams - [Screens.SendConfirmationModal]: SendConfirmationParams + [Screens.SendConfirmationFromExternal]: SendConfirmationParams [Screens.SendEnterAmount]: SendEnterAmountParams [Screens.JumpstartEnterAmount]: undefined [Screens.JumpstartSendConfirmation]: { diff --git a/src/send/SendConfirmation.test.tsx b/src/send/SendConfirmation.test.tsx index 329ee6e8a60..b486bfc8f43 100644 --- a/src/send/SendConfirmation.test.tsx +++ b/src/send/SendConfirmation.test.tsx @@ -68,7 +68,7 @@ const mockPrepareTransactionsResultPossible: PreparedTransactionsPossible = { type ScreenProps = NativeStackScreenProps< StackParamList, - Screens.SendConfirmation | Screens.SendConfirmationModal + Screens.SendConfirmation | Screens.SendConfirmationFromExternal > describe('SendConfirmation', () => { diff --git a/src/send/SendConfirmation.tsx b/src/send/SendConfirmation.tsx index 35d61493103..0b4f32202c7 100644 --- a/src/send/SendConfirmation.tsx +++ b/src/send/SendConfirmation.tsx @@ -41,7 +41,7 @@ import { walletAddressSelector } from 'src/web3/selectors' type Props = NativeStackScreenProps< StackParamList, - Screens.SendConfirmation | Screens.SendConfirmationModal + Screens.SendConfirmation | Screens.SendConfirmationFromExternal > const DEBOUNCE_TIME_MS = 250 @@ -65,7 +65,7 @@ export default function SendConfirmation(props: Props) { prepareTransactionLoading, } = usePrepareSendTransactions() - const fromModal = props.route.name === Screens.SendConfirmationModal + const fromExternal = props.route.name === Screens.SendConfirmationFromExternal const tokenInfo = useTokenInfo(tokenId) const isSending = useSelector(isSendingSelector) const localCurrencyCode = useSelector(getLocalCurrencyCode) @@ -139,8 +139,7 @@ export default function SendConfirmation(props: Props) { tokenId, usdAmount, recipient, - // TODO rename "fromModal" in all related files to "fromExternal" - fromModal, + fromExternal, getSerializablePreparedTransaction(preparedTransaction) ) ) diff --git a/src/send/actions.ts b/src/send/actions.ts index f4d8139aa25..f4072135a47 100644 --- a/src/send/actions.ts +++ b/src/send/actions.ts @@ -43,7 +43,7 @@ export interface SendPaymentAction { tokenId: string usdAmount: BigNumber | null recipient: Recipient - fromModal: boolean + fromExternal: boolean preparedTransaction: SerializableTransactionRequest } @@ -108,7 +108,7 @@ export const sendPayment = ( tokenId: string, usdAmount: BigNumber | null, recipient: Recipient, - fromModal: boolean, + fromExternal: boolean, preparedTransaction: SerializableTransactionRequest ): SendPaymentAction => ({ type: Actions.SEND_PAYMENT, @@ -116,7 +116,7 @@ export const sendPayment = ( tokenId, usdAmount, recipient, - fromModal, + fromExternal, preparedTransaction, }) diff --git a/src/send/saga.test.ts b/src/send/saga.test.ts index e9256ff04ca..ce57bd1fbde 100644 --- a/src/send/saga.test.ts +++ b/src/send/saga.test.ts @@ -77,7 +77,7 @@ describe(sendPaymentSaga, () => { tokenId: mockCusdTokenId, usdAmount: amount, recipient: mockQRCodeRecipient, - fromModal: false, + fromExternal: false, preparedTransaction: { from: '0xfrom', to: '0xto', @@ -118,18 +118,18 @@ describe(sendPaymentSaga, () => { it.each([ { testSuffix: 'navigates home when not initiated from modal', - fromModal: false, + fromExternal: false, navigateFn: navigateHome, }, { testSuffix: 'navigates back when initiated from modal', - fromModal: true, + fromExternal: true, navigateFn: navigateBack, }, ])( 'sends a payment successfully with viem and $testSuffix', - async ({ fromModal, navigateFn }) => { - await expectSaga(sendPaymentSaga, { ...sendAction, fromModal }) + async ({ fromExternal, navigateFn }) => { + await expectSaga(sendPaymentSaga, { ...sendAction, fromExternal }) .withState(createMockStore({}).getState()) .provide(createDefaultProviders()) .call(getViemWallet, networkConfig.viemChain.celo, false) diff --git a/src/send/saga.ts b/src/send/saga.ts index b2df74fe7d8..adf48da71ef 100644 --- a/src/send/saga.ts +++ b/src/send/saga.ts @@ -44,7 +44,7 @@ export function* sendPaymentSaga({ tokenId, usdAmount, recipient, - fromModal, + fromExternal, preparedTransaction: serializablePreparedTransaction, }: SendPaymentAction) { try { @@ -123,7 +123,7 @@ export function* sendPaymentSaga({ }) } - if (fromModal) { + if (fromExternal) { navigateBack() } else { navigateHome() diff --git a/test/RootStateSchema.json b/test/RootStateSchema.json index 8b442dabe76..15fa1cea4be 100644 --- a/test/RootStateSchema.json +++ b/test/RootStateSchema.json @@ -3755,7 +3755,7 @@ "SelectLocalCurrency", "SelectProvider", "SendConfirmation", - "SendConfirmationModal", + "SendConfirmationFromExternal", "SendEnterAmount", "SendSelectRecipient", "SettingsMenu", @@ -6073,7 +6073,7 @@ "SelectLocalCurrency", "SelectProvider", "SendConfirmation", - "SendConfirmationModal", + "SendConfirmationFromExternal", "SendEnterAmount", "SendSelectRecipient", "SettingsMenu",