From 299682a6dc1d9f0f6e3dc5306a34437bff8e025e Mon Sep 17 00:00:00 2001 From: keikari <34790748+keikari@users.noreply.github.com> Date: Thu, 15 Jul 2021 15:55:09 +0300 Subject: [PATCH] Make "support-pop-up" text match claim type. Confirm button label will also show "your" instead of "this" for your own claims. --- ui/component/walletSendTip/view.jsx | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/ui/component/walletSendTip/view.jsx b/ui/component/walletSendTip/view.jsx index ff9adc7fa..e9f3776bf 100644 --- a/ui/component/walletSendTip/view.jsx +++ b/ui/component/walletSendTip/view.jsx @@ -149,10 +149,25 @@ function WalletSendTip(props: Props) { const [activeTab, setActiveTab] = React.useState(claimIsMine ? TAB_BOOST : TAB_LBC); + function setClaimTypeText() { + if (claim.value_type === 'stream') { + return __('Content'); + } else if (claim.value_type === 'channel') { + return __('Channel'); + } else if (claim.value_type === 'repost') { + return __('Repost'); + } else if (claim.value_type === 'collection') { + return __('List'); + } else { + return __('Claim'); + } + } + const claimTypeText = setClaimTypeText(); + let iconToUse, explainerText; if (activeTab === TAB_BOOST) { iconToUse = ICONS.LBC; - explainerText = __('This refundable boost will improve the discoverability of this content while active.'); + explainerText = __('This refundable boost will improve the discoverability of this %claimTypeText% while active.', {claimTypeText}); } else if (activeTab === TAB_FIAT) { iconToUse = ICONS.FINANCE; explainerText = __('Show this channel your appreciation by sending a donation of cash in USD.'); @@ -289,7 +304,7 @@ function WalletSendTip(props: Props) { const displayAmount = !isNan(tipAmount) ? tipAmount : ''; if (activeTab === TAB_BOOST) { - return __('Boost This Content'); + return (claimIsMine ? __('Boost Your %claimTypeText%', {claimTypeText}) : __('Boost This %claimTypeText%', {claimTypeText})); } else if (activeTab === TAB_FIAT) { return __('Send a $%displayAmount% Tip', { displayAmount }); } else if (activeTab === TAB_LBC) { @@ -341,7 +356,7 @@ function WalletSendTip(props: Props) { ) : ( // if there is lbc, the main tip/boost gui with the 3 tabs at the top } + title={} subtitle={ {!claimIsMine && (