Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into fix/swap-tx
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Aug 1, 2024
2 parents 1b4d95e + a1008ac commit 3064bb5
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 110 deletions.
44 changes: 27 additions & 17 deletions apps/wallet-mobile/src/features/Transactions/TxHistoryNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ export const TxHistoryNavigator = () => {
}}
/>

<Stack.Screen name="tx-details">
<Stack.Screen
name="tx-details"
options={{
title: strings.txDetailsTitle,
}}
>
{() => (
<Boundary loading={{size: 'full'}}>
<TxDetails />
Expand Down Expand Up @@ -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),
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -94,6 +94,10 @@ export const TxDetails = () => {
</Text>

<View style={styles.borderTop}>
<Text secondary monospace style={styles.center}>
{submittedAt}
</Text>

<Label>{strings.fromAddresses}</Label>
</View>

Expand Down Expand Up @@ -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)',
Expand All @@ -382,9 +390,3 @@ const useStyles = () => {
}
return {styles, colors}
}

const useTitle = (text: string) => {
const navigation = useNavigation()

useEffect(() => navigation.setOptions({title: text}))
}
1 change: 1 addition & 0 deletions apps/wallet-mobile/src/kernel/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 3064bb5

Please sign in to comment.