Skip to content

Commit

Permalink
feature(wallet-mobile): new tx review multireceiver text translations
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Nov 12, 2024
1 parent 51a1d20 commit cbe4084
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 225 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export const useStrings = () => {
failedTxTitle: intl.formatMessage(messages.failedTxTitle),
failedTxText: intl.formatMessage(messages.failedTxText),
failedTxButton: intl.formatMessage(messages.failedTxButton),
multiExternalPartiesSectionLabel: intl.formatMessage(messages.multiExternalPartiesSectionLabel),
multiExternalPartiesSectionNotice: intl.formatMessage(messages.multiExternalPartiesSectionNotice),
receiveLabel: intl.formatMessage(messages.receiveLabel),
operationsLabel: intl.formatMessage(messages.operationsLabel),
}
}

Expand Down Expand Up @@ -286,4 +290,21 @@ const messages = defineMessages({
id: 'txReview.failedTxButton',
defaultMessage: '!!!Go to transactions',
},
multiExternalPartiesSectionLabel: {
id: 'txReview.overview.multiExternalPartiesSectionLabel',
defaultMessage: '!!!Other parties',
},
multiExternalPartiesSectionNotice: {
id: 'txReview.overview.multiExternalPartiesSectionNotice',
defaultMessage:
"!!!Here are displayed other parties that are involved into this transaction. They don't affect your wallet balance",
},
receiveLabel: {
id: 'txReview.receiveLabel',
defaultMessage: '!!!Receive',
},
operationsLabel: {
id: 'txReview.operationsLabel',
defaultMessage: '!!!Operations',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ const OneExternalPartySection = ({
const MultiExternalPartiesSection = ({outputs}: {outputs: FormattedOutputs}) => {
const {styles} = useStyles()
const {wallet} = useSelectedWallet()
const strings = useStrings()

const receivers = outputs.map((output, index) => {
const totalPrimaryToken = output.assets.filter((asset) => asset.isPrimary)[0]?.quantity ?? Quantities.zero
Expand Down Expand Up @@ -307,10 +308,10 @@ const MultiExternalPartiesSection = ({outputs}: {outputs: FormattedOutputs}) =>
<View>
<Divider verticalSpace="lg" />

<Accordion label="Other parties">
<Accordion label={strings.multiExternalPartiesSectionLabel}>
<Space height="lg" />

<Info content="Here are displayed other parties that are involved into this transaction. They don't affect your wallet balance" />
<Info content={strings.multiExternalPartiesSectionNotice} />

{receivers}
</Accordion>
Expand All @@ -320,14 +321,15 @@ const MultiExternalPartiesSection = ({outputs}: {outputs: FormattedOutputs}) =>

const ExternalPartiesSectionLabel = () => {
const {styles, colors} = useStyles()
const strings = useStrings()

return (
<View style={styles.tokensSectionLabel}>
<Icon.Received size={30} color={colors.received} />

<Space width="_2xs" />

<Text style={styles.tokenSectionLabel}>Receive</Text>
<Text style={styles.tokenSectionLabel}>{strings.receiveLabel}</Text>
</View>
)
}
Expand All @@ -339,13 +341,14 @@ const OperationsSection = ({
operations: Array<React.ReactNode>
extraOperations?: Array<React.ReactNode>
}) => {
const strings = useStrings()
if (extraOperations == null && operations?.length === 0) return null

return (
<View>
<Divider verticalSpace="lg" />

<Accordion label="Operations">
<Accordion label={strings.operationsLabel}>
<Space height="lg" />

{[...operations, ...(extraOperations ?? [])].map((operation, index) => {
Expand Down
6 changes: 5 additions & 1 deletion apps/wallet-mobile/src/kernel/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1273,5 +1273,9 @@
"txReview.failedTxText": "Your transaction has not been processed properly due to technical issues",
"txReview.failedTxButton": "Go to transactions",
"txReview.walletBalanceTokens.title": "Tokens",
"txReview.walletBalanceNFTs.title": "NFTs"
"txReview.walletBalanceNFTs.title": "NFTs",
"txReview.overview.multiExternalPartiesSectionLabel": "Other parties",
"txReview.overview.multiExternalPartiesSectionNotice": "Here are displayed other parties that are involved into this transaction. They don't affect your wallet balance",
"txReview.receiveLabel": "Receive",
"txReview.operationsLabel": "Operations"
}
Loading

0 comments on commit cbe4084

Please sign in to comment.