From 84adb8af253b9d5ef7095376d7318ba47ee783f9 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Thu, 10 Oct 2024 16:02:22 -0700 Subject: [PATCH 1/2] Update copy on `SwapSuccessScene` --- src/components/scenes/SwapSuccessScene.tsx | 4 ++-- src/locales/en_US.ts | 4 ++-- src/locales/strings/enUS.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/scenes/SwapSuccessScene.tsx b/src/components/scenes/SwapSuccessScene.tsx index 34197b673fe..227b1e270a3 100644 --- a/src/components/scenes/SwapSuccessScene.tsx +++ b/src/components/scenes/SwapSuccessScene.tsx @@ -65,10 +65,10 @@ export const SwapSuccessScene = (props: Props) => { {lstrings.exchange_congratulations} - {lstrings.exchange_congratulations_msg} + {lstrings.exchange_congratulations_success} - {lstrings.exchange_congratulations_msg_info} + {lstrings.exchange_congratulations_note} diff --git a/src/locales/en_US.ts b/src/locales/en_US.ts index 07fee2f4d5b..b25d0285d0c 100644 --- a/src/locales/en_US.ts +++ b/src/locales/en_US.ts @@ -154,8 +154,8 @@ const strings = { 'The "%1$s" application is requesting full access to your account and all wallets. \n\nOnly accept this login request if you trust this application and where it was downloaded from.', exchange_failed: 'Exchange Failed', exchange_congratulations: 'Congratulations!', - exchange_congratulations_msg: 'Your exchange has been successfully completed!', - exchange_congratulations_msg_info: 'Exchanges may take a few minutes and up to 24 hours to process.', + exchange_congratulations_success: 'Your exchange is being processed!', + exchange_congratulations_note: 'Processing may take up to 24 hours to complete.', no_exchange_amount: 'No Amount Selected', select_exchange_amount: 'Please enter an amount to exchange', select_exchange_amount_short: 'Enter an Amount', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 7883b6a8a41..8c6f3016d63 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -101,8 +101,8 @@ "edge_description_warning": "The \"%1$s\" application is requesting full access to your account and all wallets. \n\nOnly accept this login request if you trust this application and where it was downloaded from.", "exchange_failed": "Exchange Failed", "exchange_congratulations": "Congratulations!", - "exchange_congratulations_msg": "Your exchange has been successfully completed!", - "exchange_congratulations_msg_info": "Exchanges may take a few minutes and up to 24 hours to process.", + "exchange_congratulations_success": "Your exchange is being processed!", + "exchange_congratulations_note": "Processing may take up to 24 hours to complete.", "no_exchange_amount": "No Amount Selected", "select_exchange_amount": "Please enter an amount to exchange", "select_exchange_amount_short": "Enter an Amount", From 4371903db6cea30821a6a146b0ee3ef12a33ff16 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Thu, 10 Oct 2024 17:04:32 -0700 Subject: [PATCH 2/2] Add "Transaction Details" button to `SwapSuccessScene` --- CHANGELOG.md | 2 ++ .../scenes/SwapSuccessScene.test.tsx | 22 ++++++++++++++- .../SwapSuccessScene.test.tsx.snap | 4 +-- .../scenes/SwapConfirmationScene.tsx | 5 +++- src/components/scenes/SwapSuccessScene.tsx | 27 +++++++++++++++---- src/locales/en_US.ts | 1 + src/locales/strings/enUS.json | 1 + src/types/routerTypes.tsx | 3 ++- 8 files changed, 55 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 890f773888f..d31fb118390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,13 @@ ## Unreleased +- added: "Transaction Details" button to `SwapSuccessScene` - added: `WalletRestoreScene` - added: Button to access the `WalletRestoreScene` on `WalletListScene` if applicable - added: "Go to Parent Wallet" `WalletListMenuModal` option - added: Earn Scene - added: Include wallet creation date in wallet data in log output +- changed: Wording on `SwapSuccessScene` - changed: `SettingsScene` disables "Restore Wallets" option if there are no wallets to restore - changed: FIO Home Scene tile replaced with Earn - changed: Stake Overview Scene `StakingReturnsCard` redesigned diff --git a/src/__tests__/scenes/SwapSuccessScene.test.tsx b/src/__tests__/scenes/SwapSuccessScene.test.tsx index 6a70d010ab5..5a6368f093a 100644 --- a/src/__tests__/scenes/SwapSuccessScene.test.tsx +++ b/src/__tests__/scenes/SwapSuccessScene.test.tsx @@ -62,7 +62,27 @@ describe('SwapSuccessSceneComponent', () => { const renderer = TestRenderer.create( - + ) diff --git a/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap index df57edb844d..29da9d903b8 100644 --- a/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap @@ -290,7 +290,7 @@ exports[`SwapSuccessSceneComponent should render with loading props 1`] = ` ] } > - Your exchange has been successfully completed! + Your exchange is being processed! - Exchanges may take a few minutes and up to 24 hours to process. + Processing may take up to 24 hours to complete. , diff --git a/src/components/scenes/SwapConfirmationScene.tsx b/src/components/scenes/SwapConfirmationScene.tsx index 12ff809c8ad..8f34b223aa3 100644 --- a/src/components/scenes/SwapConfirmationScene.tsx +++ b/src/components/scenes/SwapConfirmationScene.tsx @@ -186,7 +186,10 @@ export const SwapConfirmationScene = (props: Props) => { nativeAmount ${networkFee.nativeAmount} `) - navigation.push('swapSuccess') + navigation.push('swapSuccess', { + edgeTransaction: result.transaction, + walletId: request.fromWallet.id + }) // Dispatch the success action and callback onApprove() diff --git a/src/components/scenes/SwapSuccessScene.tsx b/src/components/scenes/SwapSuccessScene.tsx index 227b1e270a3..b363840a53f 100644 --- a/src/components/scenes/SwapSuccessScene.tsx +++ b/src/components/scenes/SwapSuccessScene.tsx @@ -1,3 +1,4 @@ +import { EdgeTransaction } from 'edge-core-js' import * as React from 'react' import { View } from 'react-native' import ConfettiCannon from 'react-native-confetti-cannon' @@ -14,6 +15,11 @@ import { SceneWrapper } from '../common/SceneWrapper' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' +export interface SwapSuccessParams { + edgeTransaction: EdgeTransaction + walletId: string +} + interface Props extends EdgeSceneProps<'swapSuccess'> {} const confettiProps = { @@ -23,7 +29,8 @@ const confettiProps = { } export const SwapSuccessScene = (props: Props) => { - const { navigation } = props + const { navigation, route } = props + const { edgeTransaction, walletId } = route.params const theme = useTheme() const styles = getStyles(theme) @@ -33,11 +40,15 @@ export const SwapSuccessScene = (props: Props) => { const userId = useSelector(state => state.core.account.id) const disklet = useSelector(state => state.core.disklet) - const done = useHandler(() => { + const handleDone = useHandler(() => { setShowButton(false) navigation.navigate('swapTab', { screen: 'swapCreate' }) }) + const handleTransactionDetails = useHandler(() => { + navigation.replace('transactionDetails', { edgeTransaction, walletId }) + }) + useAsyncEffect( async () => { const show: boolean = await needToShowConfetti(userId, disklet) @@ -71,7 +82,13 @@ export const SwapSuccessScene = (props: Props) => { {lstrings.exchange_congratulations_note} - + {renderConfetti()} @@ -82,8 +99,8 @@ export const SwapSuccessScene = (props: Props) => { const getStyles = cacheStyles((theme: Theme) => ({ animOverlay: { position: 'absolute', - width: '100%', - height: '100%' + height: '100%', + width: '100%' }, container: { flexGrow: 1, diff --git a/src/locales/en_US.ts b/src/locales/en_US.ts index b25d0285d0c..cbc6c6ce6d8 100644 --- a/src/locales/en_US.ts +++ b/src/locales/en_US.ts @@ -678,6 +678,7 @@ const strings = { trade_currency: 'Trade', trade_s: 'Trade %1$s', swap_s_to_from_crypto: 'Swap %1$s to/from another crypto', + transaction_details: 'Transaction Details', transaction_details_category_title: 'Category', transaction_details_payee: 'Payee', transaction_details_payer: 'Payer', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 8c6f3016d63..77fa588b8ff 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -610,6 +610,7 @@ "trade_currency": "Trade", "trade_s": "Trade %1$s", "swap_s_to_from_crypto": "Swap %1$s to/from another crypto", + "transaction_details": "Transaction Details", "transaction_details_category_title": "Category", "transaction_details_payee": "Payee", "transaction_details_payer": "Payer", diff --git a/src/types/routerTypes.tsx b/src/types/routerTypes.tsx index c436d300bf1..60f208df801 100644 --- a/src/types/routerTypes.tsx +++ b/src/types/routerTypes.tsx @@ -53,6 +53,7 @@ import type { StakeOverviewParams } from '../components/scenes/Staking/StakeOver import type { SwapConfirmationParams } from '../components/scenes/SwapConfirmationScene' import type { SwapCreateParams } from '../components/scenes/SwapCreateScene' import type { SwapProcessingParams } from '../components/scenes/SwapProcessingScene' +import { SwapSuccessParams } from '../components/scenes/SwapSuccessScene' import type { SweepPrivateKeyCalculateFeeParams } from '../components/scenes/SweepPrivateKeyCalculateFeeScene' import type { SweepPrivateKeyCompletionParams } from '../components/scenes/SweepPrivateKeyCompletionScene' import type { SweepPrivateKeyProcessingParams } from '../components/scenes/SweepPrivateKeyProcessingScene' @@ -186,7 +187,7 @@ export type EdgeAppStackParamList = {} & { stakeOptions: StakeOptionsParams stakeOverview: StakeOverviewParams swapSettings: undefined - swapSuccess: undefined + swapSuccess: SwapSuccessParams sweepPrivateKeyCalculateFee: SweepPrivateKeyCalculateFeeParams sweepPrivateKeyCompletion: SweepPrivateKeyCompletionParams sweepPrivateKeyProcessing: SweepPrivateKeyProcessingParams