update title/subtitle on support modal if user is sending a tip

This commit is contained in:
Sean Yesmunt 2020-07-08 14:55:32 -04:00
parent 9389b61f02
commit 5c6e2e96fb

View file

@ -5,7 +5,6 @@ import React from 'react';
import Button from 'component/button'; import Button from 'component/button';
import { FormField, Form } from 'component/common/form'; import { FormField, Form } from 'component/common/form';
import { MINIMUM_PUBLISH_BID, CHANNEL_ANONYMOUS } from 'constants/claim'; import { MINIMUM_PUBLISH_BID, CHANNEL_ANONYMOUS } from 'constants/claim';
import useIsMobile from 'effects/use-is-mobile';
import CreditAmount from 'component/common/credit-amount'; import CreditAmount from 'component/common/credit-amount';
import I18nMessage from 'component/i18nMessage'; import I18nMessage from 'component/i18nMessage';
import { Lbryio } from 'lbryinc'; import { Lbryio } from 'lbryinc';
@ -56,7 +55,6 @@ function WalletSendTip(props: Props) {
const [tipError, setTipError] = React.useState(); const [tipError, setTipError] = React.useState();
const [sendAsTip, setSendAsTip] = usePersistedState('comment-support:sendAsTip', true); const [sendAsTip, setSendAsTip] = usePersistedState('comment-support:sendAsTip', true);
const [isConfirming, setIsConfirming] = React.useState(false); const [isConfirming, setIsConfirming] = React.useState(false);
const isMobile = useIsMobile();
const [selectedChannel, setSelectedChannel] = usePersistedState('comment-support:channel'); const [selectedChannel, setSelectedChannel] = usePersistedState('comment-support:channel');
const { claim_id: claimId } = claim; const { claim_id: claimId } = claim;
const { channelName } = parseURI(uri); const { channelName } = parseURI(uri);
@ -160,12 +158,14 @@ function WalletSendTip(props: Props) {
/> />
) : ( ) : (
<Card <Card
title={claimIsMine ? __('Boost Your Content') : __('Support This Content')} title={claimIsMine ? __('Boost Your Content') : isSupport ? __('Support This Content') : __('Send A Tip')}
subtitle={ subtitle={
<React.Fragment> <React.Fragment>
{__( {isSupport
? __(
'This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.' 'This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.'
)}{' '} )
: __('Send a chunk of change to this creator to let them know you appreciate their content!')}{' '}
<Button label={__('Learn more')} button="link" href="https://lbry.com/faq/tipping" />. <Button label={__('Learn more')} button="link" href="https://lbry.com/faq/tipping" />.
</React.Fragment> </React.Fragment>
} }
@ -238,7 +238,9 @@ function WalletSendTip(props: Props) {
label={ label={
<React.Fragment> <React.Fragment>
{__('Custom support amount')}{' '} {__('Custom support amount')}{' '}
<I18nMessage tokens={{ lbc_balance: <CreditAmount badge={false} precision={4} amount={balance} /> }}> <I18nMessage
tokens={{ lbc_balance: <CreditAmount badge={false} precision={4} amount={balance} /> }}
>
(%lbc_balance% available) (%lbc_balance% available)
</I18nMessage> </I18nMessage>
</React.Fragment> </React.Fragment>