From 1dccc4cc806bc34707de19853812432a27ec677c Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Fri, 2 Aug 2024 11:54:15 +0200 Subject: [PATCH 1/2] fix(staking): deregistration confirm tx screen title removal --- .../src/components/TwoActionView/TwoActionView.tsx | 10 ++++++---- .../ConfirmTx/ConfirmTxWithPassword.tsx | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/wallet-mobile/src/components/TwoActionView/TwoActionView.tsx b/apps/wallet-mobile/src/components/TwoActionView/TwoActionView.tsx index ed1f739d10..6367ffb6d2 100644 --- a/apps/wallet-mobile/src/components/TwoActionView/TwoActionView.tsx +++ b/apps/wallet-mobile/src/components/TwoActionView/TwoActionView.tsx @@ -8,7 +8,7 @@ import {Spacer} from '../Spacer' import {Text} from '../Text' type Props = { - title: string + title?: string children: React.ReactNode primaryButton: { disabled?: boolean @@ -35,9 +35,11 @@ export const TwoActionView = ({title, children, primaryButton, secondaryButton}: testID="twoActionView" > - - {title} - + {title !== undefined && ( + + {title} + + )} {children} diff --git a/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx index 7bca788756..777e0e975d 100644 --- a/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx @@ -31,7 +31,6 @@ export const ConfirmTxWithPassword = ({wallet, onSuccess, onCancel, unsignedTx}: return ( <> Date: Fri, 2 Aug 2024 15:23:42 +0200 Subject: [PATCH 2/2] fix(staking): styling --- .../TransferSummary/TransferSummary.tsx | 116 +++++++++--------- .../TransferSummary/TransferSummary.json | 32 ++--- 2 files changed, 75 insertions(+), 73 deletions(-) diff --git a/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx index 4f2259c0da..dfba82272c 100644 --- a/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx @@ -2,9 +2,9 @@ import {useExplorers} from '@yoroi/explorers' import {useTheme} from '@yoroi/theme' import React from 'react' import {defineMessages, useIntl} from 'react-intl' -import {Linking, StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' +import {Linking, StyleSheet, Text, TouchableOpacity} from 'react-native' -import {Text} from '../../../../components' +import {Space} from '../../../../components/Space/Space' import {confirmationMessages, txLabels} from '../../../../kernel/i18n/global-messages' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' import {YoroiStaking, YoroiUnsignedTx} from '../../../../yoroi-wallets/types' @@ -21,29 +21,27 @@ export const TransferSummary = ({wallet, unsignedTx}: {wallet: YoroiWallet; unsi return ( <> - - {strings.balanceLabel} + {strings.balanceLabel} - - {formatTokenWithText(refundAmount.quantity, wallet.primaryToken)} - - + + {formatTokenWithText(refundAmount.quantity, wallet.primaryToken)} + - - {strings.fees} + - - {formatTokenWithText(feeAmount.quantity, wallet.primaryToken)} - - + {strings.fees} - - {strings.finalBalanceLabel} + + {formatTokenWithText(feeAmount.quantity, wallet.primaryToken)} + - - {formatTokenWithText(totalAmount.quantity, wallet.primaryToken)} - - + + + {strings.finalBalanceLabel} + + + {formatTokenWithText(totalAmount.quantity, wallet.primaryToken)} + {withdrawals && } @@ -79,14 +77,17 @@ const Withdrawals = ({ withdrawals: NonNullable }) => { const strings = useStrings() + const styles = useStyles() const explorers = useExplorers(wallet.networkManager.network) const addresses = Entries.toAddresses(withdrawals) if (addresses.length < 1) return null return ( - - {strings.withdrawals} + <> + + + {strings.withdrawals} {Object.keys(withdrawals).map((address) => ( Linking.openURL(explorers.cardanoscan.address(address))} > - + {address} ))} - + + + ) } @@ -111,6 +114,7 @@ const Deregistrations = ({ deregistrations: NonNullable }) => { const strings = useStrings() + const styles = useStyles() const explorers = useExplorers(wallet.networkManager.network) const refundAmounts = Entries.toAmounts(deregistrations) @@ -121,38 +125,35 @@ const Deregistrations = ({ return ( <> - - {strings.stakeDeregistration} - - {addresses.map((address) => ( - Linking.openURL(explorers.cardanoscan.address(address))} - > - - {address} - - - ))} - - - - - {strings.unregisterExplanation({ - refundAmount: formatTokenWithText(primaryAmount.quantity, wallet.primaryToken), - })} - - + + + {strings.stakeDeregistration} + + {addresses.map((address) => ( + Linking.openURL(explorers.cardanoscan.address(address))} + > + + {address} + + + ))} + + + + + {strings.unregisterExplanation({ + refundAmount: formatTokenWithText(primaryAmount.quantity, wallet.primaryToken), + })} + + + ) } -const Item = (props: ViewProps) => { - const styles = useStyles() - return -} - const useStrings = () => { const intl = useIntl() @@ -195,12 +196,13 @@ const messages = defineMessages({ const useStyles = () => { const {atoms, color} = useTheme() const styles = StyleSheet.create({ - item: { - ...atoms.pb_xs, - }, balanceAmount: { - color: color.secondary_c500, - ...atoms.body_1_lg_regular, + color: color.primary_c500, + ...atoms.body_1_lg_medium, + }, + balanceLabel: { + color: color.text_gray_medium, + ...atoms.body_2_md_regular, }, }) return styles diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json index f14d143a12..bc4a0b12e2 100644 --- a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!From", "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", "start": { - "line": 175, + "line": 176, "column": 13, - "index": 5571 + "index": 5722 }, "end": { - "line": 178, + "line": 179, "column": 3, - "index": 5684 + "index": 5835 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Recovered balance", "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", "start": { - "line": 179, + "line": 180, "column": 16, - "index": 5702 + "index": 5853 }, "end": { - "line": 182, + "line": 183, "column": 3, - "index": 5831 + "index": 5982 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Final balance", "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", "start": { - "line": 183, + "line": 184, "column": 21, - "index": 5854 + "index": 6005 }, "end": { - "line": 186, + "line": 187, "column": 3, - "index": 5984 + "index": 6135 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!This transaction will unregister one or more staking keys, giving you back your {refundAmount} from your deposit", "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", "start": { - "line": 187, + "line": 188, "column": 25, - "index": 6011 + "index": 6162 }, "end": { - "line": 192, + "line": 193, "column": 3, - "index": 6246 + "index": 6397 } } ] \ No newline at end of file