Skip to content

Commit

Permalink
feat(send): show txid on successful direct-send (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni authored Sep 26, 2022
1 parent d043353 commit 13496a0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/components/Send.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,16 @@ export default function Send() {

if (res.ok) {
const {
txinfo: { outputs, inputs },
txinfo: { outputs, inputs, txid },
} = await res.json()
const output = outputs.find((o) => o.address === destination)
setPaymentSuccessfulInfoAlert({
variant: 'success',
message: t('send.alert_payment_successful', { amount: output.value_sats, address: output.address }),
message: t('send.alert_payment_successful', {
amount: output.value_sats,
address: output.address,
txid,
}),
})
setWaitForUtxosToBeSpent(inputs.map((it) => it.outpoint))
success = true
Expand Down Expand Up @@ -712,7 +716,9 @@ export default function Send() {
)}

{paymentSuccessfulInfoAlert && (
<rb.Alert variant={paymentSuccessfulInfoAlert.variant}>{paymentSuccessfulInfoAlert.message}</rb.Alert>
<rb.Alert className="small slashed-zeroes break-word" variant={paymentSuccessfulInfoAlert.variant}>
{paymentSuccessfulInfoAlert.message}
</rb.Alert>
)}

{!isLoading && !isOperationDisabled && isCoinjoin && !coinjoinPreconditionSummary.isFulfilled && (
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"direct_payment_error_message_bad_request": "Please verify your inputs carefully.",
"error_loading_wallet_failed": "Loading wallet failed.",
"error_loading_min_makers_failed": "Loading config value 'minimum_makers' failed.",
"alert_payment_successful": "Payment successful: Sent {{ amount }} sats to {{ address }}.",
"alert_payment_successful": "Payment successful: Sent {{ amount }} sats to {{ address }} in transaction {{ txid }}.",
"text_maker_running": "Earn is active. Stop the service in order to send collaborative transactions.",
"text_coinjoin_already_running": "A collaborative transaction is currently in progress.",
"label_recipient": "Recipient",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"direct_payment_error_message_bad_request": " Veuillez vérifier soigneusement vos entrées.",
"error_loading_wallet_failed": "Le chargement du portefeuille a échoué.",
"error_loading_min_makers_failed": "Le chargement de la valeur de configuration 'minimum_makers' a échoué.",
"alert_payment_successful": "Paiement réussi : Envoyé {{ amount }} sats à {{ address }}.",
"alert_payment_successful": "Paiement réussi : Envoyé {{ amount }} sats à {{ address }} en transaction {{ txid }}.",
"text_maker_running": "Générer est actif. Arrêtez le service afin d'envoyer des transactions collaboratives.",
"text_coinjoin_already_running": "Une transaction collaborative est actuellement en cours.",
"label_recipient": "Destinataire",
Expand Down
4 changes: 4 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ main {
-o-font-feature-settings: 'tnum' on, 'lnum' on, 'zero' on, 'case' on, 'calt' off;
}

.break-word {
word-break: break-word;
}

.unstyled {
text-decoration: none !important;
color: inherit !important;
Expand Down

0 comments on commit 13496a0

Please sign in to comment.