From 65dd30e4303c3b253eb0377b42d48fd6ee2301eb Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Fri, 29 Nov 2024 10:51:20 +0100 Subject: [PATCH 1/7] fix(wallet-mobile): allow screenshot toggle in android production (#3748) --- .../useCases/changeAppSettings/ApplicationSettingsScreen.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wallet-mobile/src/features/Settings/useCases/changeAppSettings/ApplicationSettingsScreen.tsx b/apps/wallet-mobile/src/features/Settings/useCases/changeAppSettings/ApplicationSettingsScreen.tsx index 5c40a0ee25..3a9c361d47 100644 --- a/apps/wallet-mobile/src/features/Settings/useCases/changeAppSettings/ApplicationSettingsScreen.tsx +++ b/apps/wallet-mobile/src/features/Settings/useCases/changeAppSettings/ApplicationSettingsScreen.tsx @@ -7,7 +7,7 @@ import {SafeAreaView} from 'react-native-safe-area-context' import {Icon} from '../../../../components/Icon' import {Spacer} from '../../../../components/Spacer/Spacer' -import {isNightly, isProduction} from '../../../../kernel/env' +import {isNightly} from '../../../../kernel/env' import {useLanguage} from '../../../../kernel/i18n' import {themeNames} from '../../../../kernel/i18n/global-messages' import {defaultLanguage} from '../../../../kernel/i18n/languages' @@ -40,7 +40,7 @@ export const ApplicationSettingsScreen = () => { const {network} = useSelectedNetwork() const {data: screenShareEnabled} = useScreenShareSettingEnabled() - const displayScreenShareSetting = Platform.OS === 'android' && !isProduction + const displayScreenShareSetting = Platform.OS === 'android' const onToggleAuthWithOs = () => { if (authSetting === 'os') { From ed6624fb0177bb8ce2410665875ddcaa9fd5ae86 Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Fri, 29 Nov 2024 11:15:10 +0100 Subject: [PATCH 2/7] fix(wallet-mobile): Fallback number for missing data in fetchPtPrice (#3749) --- .../src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx b/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx index 026d6c48ba..465573e394 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx @@ -46,8 +46,8 @@ export const usePrimaryTokenActivity = ({ // NOTE: transformer const tickers = response.value.data.tickers const ts = tickers[0]?.timestamp ?? 0 - const close = tickers[0]?.prices[to] ?? 1 - const open = tickers[1]?.prices[to] ?? 1 + const close = tickers[0]?.prices[to] ?? 0 + const open = tickers[1]?.prices[to] ?? 0 return { ts, close, From 77e0e188f7a0c3a441b9e30fe9fcb04171630698 Mon Sep 17 00:00:00 2001 From: banklesss <105349292+banklesss@users.noreply.github.com> Date: Fri, 29 Nov 2024 11:15:26 +0100 Subject: [PATCH 3/7] feat(wallet-mobile): new tx review success/failed tx screens (#3747) Signed-off-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com> Co-authored-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com> --- .../ReviewTx/common/hooks/useOnConfirm.tsx | 10 +- .../src/features/Send/common/navigation.ts | 2 + .../src/features/Send/common/strings.tsx | 4 +- .../ListAmountsToSendScreen.tsx | 3 + .../ShowFailedTxScreen/FailedTxScreen.tsx | 77 ++ .../SubmittedTxScreen.tsx | 78 ++ .../Governance/GovernanceNavigator.tsx | 6 + .../Staking/Governance/common/helpers.tsx | 6 + .../Staking/Governance/common/navigation.ts | 4 + .../Staking/Governance/common/strings.ts | 31 + .../ShowFailedTxScreen/FailedTxScreen.tsx | 76 ++ .../SubmittedTxScreen.tsx | 77 ++ .../src/features/Swap/common/navigation.ts | 15 + .../src/features/Swap/common/strings.ts | 31 + .../Swap/useCases/ReviewSwap/ReviewSwap.tsx | 8 + .../ShowFailedTxScreen/FailedTxScreen.tsx | 76 ++ .../SubmittedTxScreen.tsx | 84 ++ .../Transactions/TxHistoryNavigator.tsx | 38 + .../src/kernel/i18n/locales/en-US.json | 22 +- apps/wallet-mobile/src/kernel/navigation.tsx | 6 + .../src/legacy/Dashboard/Dashboard.tsx | 4 +- .../legacy/Dashboard/DashboardNavigator.tsx | 18 + .../ShowFailedTxScreen/FailedTxScreen.tsx | 103 ++ .../SubmittedTxScreen.tsx | 104 ++ .../Staking/StakingCenter/StakingCenter.tsx | 14 +- .../src/features/Send/common/strings.json | 74 +- .../ListAmountsToSendScreen.json | 8 +- .../Staking/Governance/common/strings.json | 506 +++++--- .../src/features/Swap/common/strings.json | 1122 +++++++++-------- .../Transactions/TxHistoryNavigator.json | 184 +-- .../src/legacy/Dashboard/Dashboard.json | 8 +- .../legacy/Dashboard/DashboardNavigator.json | 8 +- .../ShowFailedTxScreen/FailedTxScreen.json | 47 + .../SubmittedTxScreen.json | 47 + .../Staking/StakingCenter/StakingCenter.json | 16 +- 35 files changed, 2036 insertions(+), 881 deletions(-) create mode 100644 apps/wallet-mobile/src/features/Send/useCases/ShowFailedTxScreen/FailedTxScreen.tsx create mode 100644 apps/wallet-mobile/src/features/Send/useCases/ShowSubmittedTxScreen/SubmittedTxScreen.tsx create mode 100644 apps/wallet-mobile/src/features/Staking/Governance/useCases/ShowFailedTxScreen/FailedTxScreen.tsx create mode 100644 apps/wallet-mobile/src/features/Staking/Governance/useCases/ShowSubmittedTxScreen/SubmittedTxScreen.tsx create mode 100644 apps/wallet-mobile/src/features/Swap/useCases/ShowFailedTxScreen/FailedTxScreen.tsx create mode 100644 apps/wallet-mobile/src/features/Swap/useCases/ShowSubmittedTxScreen/SubmittedTxScreen.tsx create mode 100644 apps/wallet-mobile/src/legacy/Dashboard/ShowFailedTxScreen/FailedTxScreen.tsx create mode 100644 apps/wallet-mobile/src/legacy/Dashboard/ShowSubmittedTxScreen/SubmittedTxScreen.tsx create mode 100644 apps/wallet-mobile/translations/messages/src/legacy/Dashboard/ShowFailedTxScreen/FailedTxScreen.json create mode 100644 apps/wallet-mobile/translations/messages/src/legacy/Dashboard/ShowSubmittedTxScreen/SubmittedTxScreen.json diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useOnConfirm.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useOnConfirm.tsx index f2c01967e2..74cb199dc3 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useOnConfirm.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useOnConfirm.tsx @@ -30,11 +30,17 @@ export const useOnConfirm = ({ const navigateTo = useNavigateTo() const handleOnSuccess = (signedTx: YoroiSignedTx) => { - onSuccess?.(signedTx) + if (onSuccess) { + onSuccess(signedTx) + return + } navigateTo.showSubmittedTxScreen() } const handleOnError = () => { - onError?.() + if (onError) { + onError() + return + } navigateTo.showFailedTxScreen() } diff --git a/apps/wallet-mobile/src/features/Send/common/navigation.ts b/apps/wallet-mobile/src/features/Send/common/navigation.ts index 1a61f36940..e7f5972e40 100644 --- a/apps/wallet-mobile/src/features/Send/common/navigation.ts +++ b/apps/wallet-mobile/src/features/Send/common/navigation.ts @@ -15,6 +15,8 @@ export const useNavigateTo = () => { startTx: () => navigation.navigate('send-start-tx'), editAmount: () => navigation.navigate('send-edit-amount'), reader: () => navigation.navigate('scan-start', {insideFeature: 'send'}), + submittedTx: () => navigation.navigate('send-submitted-tx'), + failedTx: () => navigation.navigate('send-failed-tx'), startTxAfterReset: () => navigation.reset({ index: 0, diff --git a/apps/wallet-mobile/src/features/Send/common/strings.tsx b/apps/wallet-mobile/src/features/Send/common/strings.tsx index 2d02071dc1..f0c5300e47 100644 --- a/apps/wallet-mobile/src/features/Send/common/strings.tsx +++ b/apps/wallet-mobile/src/features/Send/common/strings.tsx @@ -253,7 +253,7 @@ const messages = defineMessages({ }, submittedTxTitle: { id: 'components.send.sendscreen.submittedTxTitle', - defaultMessage: '!!!Transaction submitted', + defaultMessage: '!!!Transaction signed', }, submittedTxText: { id: 'components.send.sendscreen.submittedTxText', @@ -261,7 +261,7 @@ const messages = defineMessages({ }, submittedTxButton: { id: 'components.send.sendscreen.submittedTxButton', - defaultMessage: '!!!Go to transactions', + defaultMessage: '!!!Close', }, failedTxTitle: { id: 'components.send.sendscreen.failedTxTitle', diff --git a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx index 5dbeebbcd4..3d9d90072e 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx @@ -87,10 +87,13 @@ export const ListAmountsToSendScreen = () => { if (memo.length > 0) { saveMemo({txId: signedTx.signedTx.id, memo: memo.trim()}) } + + navigateTo.submittedTx() } const onError = () => { track.sendSummarySubmitted(sendProperties) + navigateTo.failedTx() } const onNext = () => { diff --git a/apps/wallet-mobile/src/features/Send/useCases/ShowFailedTxScreen/FailedTxScreen.tsx b/apps/wallet-mobile/src/features/Send/useCases/ShowFailedTxScreen/FailedTxScreen.tsx new file mode 100644 index 0000000000..a24c35371d --- /dev/null +++ b/apps/wallet-mobile/src/features/Send/useCases/ShowFailedTxScreen/FailedTxScreen.tsx @@ -0,0 +1,77 @@ +import {useTheme} from '@yoroi/theme' +import * as React from 'react' +import {StyleSheet, Text, View} from 'react-native' + +import {Button} from '../../../../components/Button/Button' +import {SafeArea} from '../../../../components/SafeArea' +import {Space} from '../../../../components/Space/Space' +import {Spacer} from '../../../../components/Spacer/Spacer' +import {useBlockGoBack, useWalletNavigation} from '../../../../kernel/navigation' +import {FailedTxIcon} from '../../../ReviewTx/illustrations/FailedTxIcon' +import {useStrings} from '../../common/strings' + +export const FailedTxScreen = () => { + useBlockGoBack() + const strings = useStrings() + const {styles} = useStyles() + const {resetToStartTransfer} = useWalletNavigation() + + return ( + + + + + + + + + + {strings.failedTxTitle} + + {strings.failedTxText} + + + + +