make invite string more manageable for translations

This commit is contained in:
Sean Yesmunt 2020-04-22 15:43:43 -04:00
parent 17cf98a4bd
commit 2ed3623b59
2 changed files with 40 additions and 22 deletions

View file

@ -610,7 +610,7 @@ function ClaimListDiscover(props: Props) {
{loading && ( {loading && (
<div className="card"> <div className="card">
{new Array(CS.PAGE_SIZE).fill(1).map((x, i) => ( {new Array(pageSize || CS.PAGE_SIZE).fill(1).map((x, i) => (
<ClaimPreview key={i} placeholder="loading" /> <ClaimPreview key={i} placeholder="loading" />
))} ))}
</div> </div>

View file

@ -8,6 +8,7 @@ import { buildURI, parseURI } from 'lbry-redux';
import { rewards as REWARDS, ERRORS } from 'lbryinc'; import { rewards as REWARDS, ERRORS } from 'lbryinc';
import { formatLbryUrlForWeb } from 'util/url'; import { formatLbryUrlForWeb } from 'util/url';
import ChannelContent from 'component/channelContent'; import ChannelContent from 'component/channelContent';
import I18nMessage from 'component/i18nMessage';
type Props = { type Props = {
user: any, user: any,
@ -128,36 +129,53 @@ function Invited(props: Props) {
} }
if (!rewardsApproved) { if (!rewardsApproved) {
return ( const signUpButton = (
<Card
title={__(`You're invited!`)}
subtitle={
<div>
<p>
{referrerIsChannel
? __(`Content freedom and a present from %channel_name% are waiting for you. `, {
channel_name: referrerChannelName,
})
: __(`Content freedom and a present are waiting for you. `)}
<Button <Button
button="link" button="link"
label={hasVerifiedEmail ? __(`Finish verification `) : __(`Create an account `)} label={hasVerifiedEmail ? __(`Finish verification `) : __(`Create an account `)}
navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`} navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`}
/>{' '} />
to claim it. );
return (
<Card
title={__(`You're invited!`)}
subtitle={
<p>
{referrerIsChannel ? (
<I18nMessage
tokens={{
channel_name: referrerChannelName,
signup_link: signUpButton,
}}
>
Content freedom and a present from %channel_name% are waiting for you. %signup_link% to claim it.
</I18nMessage>
) : (
<I18nMessage
tokens={{
signup_link: signUpButton,
}}
>
Content freedom and a present are waiting for you. %signup_link% to claim it.
</I18nMessage>
)}
</p> </p>
</div>
} }
body={ body={
referrerIsChannel && ( referrerIsChannel && (
<div className="claim-preview--channel"> <div className="claim-preview--channel">
<div className="section">
<ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} /> <ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} />
</div>
<div className="section">
<ChannelContent uri={fullUri} defaultPageSize={3} defaultInfiniteScroll={false} /> <ChannelContent uri={fullUri} defaultPageSize={3} defaultInfiniteScroll={false} />
</div> </div>
</div>
) )
} }
actions={ actions={
<div className="card__actions"> <div className="section__actions">
<Button <Button
button="primary" button="primary"
label={hasVerifiedEmail ? __('Finish Account') : __('Create Account')} label={hasVerifiedEmail ? __('Finish Account') : __('Create Account')}
@ -182,7 +200,7 @@ function Invited(props: Props) {
) )
} }
actions={ actions={
<div className="card__actions"> <div className="section__actions">
<Button button="primary" label={__('Done')} onClick={handleDone} /> <Button button="primary" label={__('Done')} onClick={handleDone} />
</div> </div>
} }