From d89e04942be857bee1bbf82715807196c766326c Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Thu, 2 Jun 2022 15:29:37 +0800 Subject: [PATCH] Tweak tip/boost toast message - Split the friendly text (non-essential) to `subMessage`. - Put a link to the wallet history for all these tipping toasts. - Don't say "tip" for the Wallet Send action (Issue_1605) - Make the link font-size smaller than the main text. --- static/app-strings.json | 4 +++- ui/component/commentCreate/view.jsx | 6 ++++-- ui/redux/actions/wallet.js | 19 +++++++++---------- ui/scss/component/_snack-bar.scss | 1 + 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index e2d7d132a..a5817b743 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1072,7 +1072,9 @@ "Boost": "Boost", "Boost transaction successful.": "Boost transaction successful.", "Boost transaction failed.": "Boost transaction failed.", - "Tip successfully sent. I'm sure they appreciate it!": "Tip successfully sent. I'm sure they appreciate it!", + "Credits successfully sent.": "Credits successfully sent.", + "Tip successfully sent.": "Tip successfully sent.", + "I'm sure they appreciate it!": "I'm sure they appreciate it!", "Tip transaction failed.": "Tip transaction failed.", "Add a Card": "Add a Card", "To Tip Creators": "To Tip Creators", diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index 84aacf8df..b342bdfeb 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -311,8 +311,10 @@ export function CommentCreate(props: Props) { }, 1500); doToast({ - message: __("Tip successfully sent. I'm sure they appreciate it!"), - subMessage: `${tipAmount} LBC ⇒ ${tipChannelName}`, // force show decimal places + message: __('Tip successfully sent.'), + subMessage: __("I'm sure they appreciate it!"), + linkText: `${tipAmount} LBC ⇒ ${tipChannelName}`, // force show decimal places + linkTarget: '/wallet', }); setSuccessTip({ txid, tipAmount }); diff --git a/ui/redux/actions/wallet.js b/ui/redux/actions/wallet.js index a4689ac49..8168adf39 100644 --- a/ui/redux/actions/wallet.js +++ b/ui/redux/actions/wallet.js @@ -293,9 +293,8 @@ export function doSendDraftTransaction(address, amount) { }); dispatch( doToast({ - message: __("Tip successfully sent. I'm sure they appreciate it!"), - subMessage: `${amount} LBC`, - linkText: __('History'), + message: __('Credits successfully sent.'), + linkText: `${amount} LBC`, linkTarget: '/wallet', }) ); @@ -371,11 +370,9 @@ export function doSendTip(params, isSupport, successCallback, errorCallback, sho if (shouldNotify) { dispatch( doToast({ - message: shouldSupport - ? __('Boost transaction successful.') - : __("Tip successfully sent. I'm sure they appreciate it!"), - subMessage: `${params.amount} LBC`, - linkText: __('History'), + message: shouldSupport ? __('Boost transaction successful.') : __('Tip successfully sent.'), + subMessage: __("I'm sure they appreciate it!"), + linkText: `${params.amount} LBC`, linkTarget: '/wallet', }) ); @@ -767,8 +764,10 @@ export const doSendCashTip = ( dispatch( doToast({ - message: __("Tip successfully sent. I'm sure they appreciate it!"), - subMessage: `${fiatSymbol}${tipParams.tipAmount} ⇒ ${tipParams.tipChannelName}`, + message: __('Tip successfully sent.'), + subMessage: __("I'm sure they appreciate it!"), + linkText: `${fiatSymbol}${tipParams.tipAmount} ⇒ ${tipParams.tipChannelName}`, + linkTarget: '/wallet', }) ); diff --git a/ui/scss/component/_snack-bar.scss b/ui/scss/component/_snack-bar.scss index 4cce8f693..6f4d0f7e2 100644 --- a/ui/scss/component/_snack-bar.scss +++ b/ui/scss/component/_snack-bar.scss @@ -75,6 +75,7 @@ margin-left: auto; min-width: min-content; color: var(--color-white); + font-size: var(--font-small); span:hover { text-decoration: underline;