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,40 +129,57 @@ function Invited(props: Props) {
} }
if (!rewardsApproved) { if (!rewardsApproved) {
const signUpButton = (
<Button
button="link"
label={hasVerifiedEmail ? __(`Finish verification `) : __(`Create an account `)}
navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`}
/>
);
return ( return (
<Card <Card
title={__(`You're invited!`)} title={__(`You're invited!`)}
subtitle={ subtitle={
<div> <p>
<p> {referrerIsChannel ? (
{referrerIsChannel <I18nMessage
? __(`Content freedom and a present from %channel_name% are waiting for you. `, { tokens={{
channel_name: referrerChannelName, channel_name: referrerChannelName,
}) signup_link: signUpButton,
: __(`Content freedom and a present are waiting for you. `)} }}
<Button >
button="link" Content freedom and a present from %channel_name% are waiting for you. %signup_link% to claim it.
label={hasVerifiedEmail ? __(`Finish verification `) : __(`Create an account `)} </I18nMessage>
navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`} ) : (
/>{' '} <I18nMessage
to claim it. tokens={{
</p> signup_link: signUpButton,
</div> }}
>
Content freedom and a present are waiting for you. %signup_link% to claim it.
</I18nMessage>
)}
</p>
} }
body={ body={
referrerIsChannel && ( referrerIsChannel && (
<div className="claim-preview--channel"> <div className="claim-preview--channel">
<ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} /> <div className="section">
<ChannelContent uri={fullUri} defaultPageSize={3} defaultInfiniteScroll={false} /> <ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} />
</div>
<div className="section">
<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')}
navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`} navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`}
/> />
<Button button="link" label={__('Skip')} onClick={handleDone} /> <Button button="link" label={__('Skip')} onClick={handleDone} />
</div> </div>
@ -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>
} }