From 6508b76e254e2b03d04e4e033ef01927dafb476c Mon Sep 17 00:00:00 2001 From: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:35:07 +0100 Subject: [PATCH] chore(wallet-mobile) tx-details title --- .../Transactions/TxHistoryNavigator.tsx | 44 +++-- .../useCases/TxDetails/TxDetails.tsx | 20 +- .../src/kernel/i18n/locales/en-US.json | 1 + .../Transactions/TxHistoryNavigator.json | 183 ++++++++++-------- 4 files changed, 138 insertions(+), 110 deletions(-) diff --git a/apps/wallet-mobile/src/features/Transactions/TxHistoryNavigator.tsx b/apps/wallet-mobile/src/features/Transactions/TxHistoryNavigator.tsx index b670fd2e61..4210feab44 100644 --- a/apps/wallet-mobile/src/features/Transactions/TxHistoryNavigator.tsx +++ b/apps/wallet-mobile/src/features/Transactions/TxHistoryNavigator.tsx @@ -164,7 +164,12 @@ export const TxHistoryNavigator = () => { }} /> - + {() => ( @@ -526,33 +531,38 @@ const messages = defineMessages({ id: 'rampOnOff.rampOnOffScreen.exchangeSelectProvider.sell', defaultMessage: '!!!Sell provider', }, + txDetailsTitle: { + id: 'components.txhistory.txdetails.txDetails', + defaultMessage: '!!!Tx Details', + }, }) const useStrings = () => { const intl = useIntl() return { - receiveTitle: intl.formatMessage(messages.receiveTitle), - swapTitle: intl.formatMessage(messages.swapTitle), - swapFromTitle: intl.formatMessage(messages.swapFromTitle), - swapToTitle: intl.formatMessage(messages.swapToTitle), - slippageTolerance: intl.formatMessage(messages.slippageTolerance), - selectPool: intl.formatMessage(messages.selectPool), - sendTitle: intl.formatMessage(messages.sendTitle), - qrScannerTitle: intl.formatMessage(messages.qrScannerTitle), - selectAssetTitle: intl.formatMessage(messages.selectAssetTitle), + claimShowSuccess: intl.formatMessage(messages.claimShowSuccessTitle), + confirmationTransaction: intl.formatMessage(messages.confirmationTransaction), confirmTitle: intl.formatMessage(messages.confirmTitle), - receiveInfoText: intl.formatMessage(messages.receiveInfoText), + describeSelectedAddressTitle: intl.formatMessage(messages.describeSelectedAddressTitle), editAmountTitle: intl.formatMessage(messages.editAmountTitle), - listAmountsToSendTitle: intl.formatMessage(messages.listAmountsToSendTitle), - confirmationTransaction: intl.formatMessage(messages.confirmationTransaction), - scanTitle: intl.formatMessage(messages.scanTitle), - claimShowSuccess: intl.formatMessage(messages.claimShowSuccessTitle), - specificAmount: intl.formatMessage(messages.specificAmount), exchangeCreateOrderTitle: intl.formatMessage(messages.exchangeCreateOrderTitle), exchangeSelectBuyProvider: intl.formatMessage(messages.exchangeSelectBuyProvider), exchangeSelectSellProvider: intl.formatMessage(messages.exchangeSelectSellProvider), - describeSelectedAddressTitle: intl.formatMessage(messages.describeSelectedAddressTitle), + listAmountsToSendTitle: intl.formatMessage(messages.listAmountsToSendTitle), + qrScannerTitle: intl.formatMessage(messages.qrScannerTitle), + receiveInfoText: intl.formatMessage(messages.receiveInfoText), + receiveTitle: intl.formatMessage(messages.receiveTitle), + scanTitle: intl.formatMessage(messages.scanTitle), + selectAssetTitle: intl.formatMessage(messages.selectAssetTitle), + selectPool: intl.formatMessage(messages.selectPool), + sendTitle: intl.formatMessage(messages.sendTitle), + slippageTolerance: intl.formatMessage(messages.slippageTolerance), + specificAmount: intl.formatMessage(messages.specificAmount), + swapFromTitle: intl.formatMessage(messages.swapFromTitle), + swapTitle: intl.formatMessage(messages.swapTitle), + swapToTitle: intl.formatMessage(messages.swapToTitle), + txDetailsTitle: intl.formatMessage(messages.txDetailsTitle), } } diff --git a/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/TxDetails.tsx b/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/TxDetails.tsx index 88dfc53adc..279a11f676 100644 --- a/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/TxDetails.tsx +++ b/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/TxDetails.tsx @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import {useNavigation, useRoute} from '@react-navigation/native' +import {useRoute} from '@react-navigation/native' import {isNonNullable} from '@yoroi/common' import {useExplorers} from '@yoroi/explorers' import {useTheme} from '@yoroi/theme' import {BigNumber} from 'bignumber.js' import {fromPairs} from 'lodash' -import React, {useEffect, useState} from 'react' +import React, {useState} from 'react' import {IntlShape, useIntl} from 'react-intl' import { LayoutAnimation, @@ -51,7 +51,7 @@ export const TxDetails = () => { const transaction = transactions[id] const memo = !isEmptyString(transaction.memo) ? transaction.memo : '-' - useTitle(isNonNullable(transaction.submittedAt) ? formatDateAndTime(transaction.submittedAt, intl) : '') + const submittedAt = isNonNullable(transaction.submittedAt) ? formatDateAndTime(transaction.submittedAt, intl) : '' const {fromFiltered, toFiltered, cntOmittedTo} = getShownAddresses( intl, @@ -94,6 +94,10 @@ export const TxDetails = () => { + + {submittedAt} + + @@ -367,6 +371,10 @@ const useStyles = () => { ...atoms.body_2_md_regular, color: color.gray_c900, }, + center: { + ...atoms.pt_lg, + ...atoms.self_center, + }, borderTop: { borderTopWidth: 1, borderColor: 'rgba(173, 174, 182, 0.3)', @@ -382,9 +390,3 @@ const useStyles = () => { } return {styles, colors} } - -const useTitle = (text: string) => { - const navigation = useNavigation() - - useEffect(() => navigation.setOptions({title: text})) -} diff --git a/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json b/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json index ea608d475b..d8c35c68d9 100644 --- a/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json +++ b/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json @@ -494,6 +494,7 @@ "components.txhistory.txdetails.addressPrefixNotMine": "not mine", "components.txhistory.txdetails.addressPrefixReceive": "/{idx}", "components.txhistory.txdetails.confirmations": "{cnt} {cnt, plural, one {CONFIRMATION} other {CONFIRMATIONS}}", + "components.txhistory.txdetails.txDetails": "Tx Details", "components.txhistory.txdetails.fee": "Fee:", "components.txhistory.txdetails.fromAddresses": "From Addresses", "components.txhistory.txdetails.memo": "Memo", diff --git a/apps/wallet-mobile/translations/messages/src/features/Transactions/TxHistoryNavigator.json b/apps/wallet-mobile/translations/messages/src/features/Transactions/TxHistoryNavigator.json index 1d3f44e532..aa3bcdc1cb 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Transactions/TxHistoryNavigator.json +++ b/apps/wallet-mobile/translations/messages/src/features/Transactions/TxHistoryNavigator.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Receive", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 442, + "line": 447, "column": 16, - "index": 17189 + "index": 17335 }, "end": { - "line": 445, + "line": 450, "column": 3, - "index": 17278 + "index": 17424 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Address details", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 446, + "line": 451, "column": 32, - "index": 17312 + "index": 17458 }, "end": { - "line": 449, + "line": 454, "column": 3, - "index": 17425 + "index": 17571 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Swap", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 450, + "line": 455, "column": 13, - "index": 17440 + "index": 17586 }, "end": { - "line": 453, + "line": 458, "column": 3, - "index": 17513 + "index": 17659 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Swap from", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 454, + "line": 459, "column": 17, - "index": 17532 + "index": 17678 }, "end": { - "line": 457, + "line": 462, "column": 3, - "index": 17609 + "index": 17755 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!Swap to", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 458, + "line": 463, "column": 15, - "index": 17626 + "index": 17772 }, "end": { - "line": 461, + "line": 466, "column": 3, - "index": 17699 + "index": 17845 } }, { @@ -79,14 +79,14 @@ "defaultMessage": "!!!Slippage Tolerance", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 462, + "line": 467, "column": 21, - "index": 17722 + "index": 17868 }, "end": { - "line": 465, + "line": 470, "column": 3, - "index": 17817 + "index": 17963 } }, { @@ -94,14 +94,14 @@ "defaultMessage": "!!!Select pool", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 466, + "line": 471, "column": 14, - "index": 17833 + "index": 17979 }, "end": { - "line": 469, + "line": 474, "column": 3, - "index": 17914 + "index": 18060 } }, { @@ -109,14 +109,14 @@ "defaultMessage": "!!!Send", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 470, + "line": 475, "column": 13, - "index": 17929 + "index": 18075 }, "end": { - "line": 473, + "line": 478, "column": 3, - "index": 18009 + "index": 18155 } }, { @@ -124,14 +124,14 @@ "defaultMessage": "!!!Scan QR code address", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 474, + "line": 479, "column": 18, - "index": 18029 + "index": 18175 }, "end": { - "line": 477, + "line": 482, "column": 3, - "index": 18130 + "index": 18276 } }, { @@ -139,14 +139,14 @@ "defaultMessage": "!!!Select asset", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 478, + "line": 483, "column": 20, - "index": 18152 + "index": 18298 }, "end": { - "line": 481, + "line": 486, "column": 3, - "index": 18241 + "index": 18387 } }, { @@ -154,14 +154,14 @@ "defaultMessage": "!!!Assets added", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 482, + "line": 487, "column": 26, - "index": 18269 + "index": 18415 }, "end": { - "line": 485, + "line": 490, "column": 3, - "index": 18370 + "index": 18516 } }, { @@ -169,14 +169,14 @@ "defaultMessage": "!!!Edit amount", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 486, + "line": 491, "column": 19, - "index": 18391 + "index": 18537 }, "end": { - "line": 489, + "line": 494, "column": 3, - "index": 18484 + "index": 18630 } }, { @@ -184,14 +184,14 @@ "defaultMessage": "!!!Confirm", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 490, + "line": 495, "column": 16, - "index": 18502 + "index": 18648 }, "end": { - "line": 493, + "line": 498, "column": 3, - "index": 18588 + "index": 18734 } }, { @@ -199,14 +199,14 @@ "defaultMessage": "!!!Share this address to receive payments. To protect your privacy, new addresses are generated automatically once you use them.", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 494, + "line": 499, "column": 19, - "index": 18609 + "index": 18755 }, "end": { - "line": 500, + "line": 505, "column": 3, - "index": 18847 + "index": 18993 } }, { @@ -214,14 +214,14 @@ "defaultMessage": "!!!Confirm transaction", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 501, + "line": 506, "column": 27, - "index": 18876 + "index": 19022 }, "end": { - "line": 504, + "line": 509, "column": 3, - "index": 18969 + "index": 19115 } }, { @@ -229,14 +229,14 @@ "defaultMessage": "!!!Please scan a QR code", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 505, + "line": 510, "column": 13, - "index": 18984 + "index": 19130 }, "end": { - "line": 508, + "line": 513, "column": 3, - "index": 19059 + "index": 19205 } }, { @@ -244,14 +244,14 @@ "defaultMessage": "!!!Success", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 509, + "line": 514, "column": 25, - "index": 19086 + "index": 19232 }, "end": { - "line": 512, + "line": 517, "column": 3, - "index": 19160 + "index": 19306 } }, { @@ -259,14 +259,14 @@ "defaultMessage": "!!!Request specific amount", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 513, + "line": 518, "column": 18, - "index": 19180 + "index": 19326 }, "end": { - "line": 516, + "line": 521, "column": 3, - "index": 19294 + "index": 19440 } }, { @@ -274,14 +274,14 @@ "defaultMessage": "!!!Buy/Sell ADA", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 517, + "line": 522, "column": 28, - "index": 19324 + "index": 19470 }, "end": { - "line": 520, + "line": 525, "column": 3, - "index": 19420 + "index": 19566 } }, { @@ -289,14 +289,14 @@ "defaultMessage": "!!!Buy provider", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 521, + "line": 526, "column": 29, - "index": 19451 + "index": 19597 }, "end": { - "line": 524, + "line": 529, "column": 3, - "index": 19559 + "index": 19705 } }, { @@ -304,14 +304,29 @@ "defaultMessage": "!!!Sell provider", "file": "src/features/Transactions/TxHistoryNavigator.tsx", "start": { - "line": 525, + "line": 530, "column": 30, - "index": 19591 + "index": 19737 + }, + "end": { + "line": 533, + "column": 3, + "index": 19847 + } + }, + { + "id": "components.txhistory.txdetails.txDetails", + "defaultMessage": "!!!Tx Details", + "file": "src/features/Transactions/TxHistoryNavigator.tsx", + "start": { + "line": 534, + "column": 18, + "index": 19867 }, "end": { - "line": 528, + "line": 537, "column": 3, - "index": 19701 + "index": 19961 } } ] \ No newline at end of file