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 && (
<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" />
))}
</div>

View file

@ -8,6 +8,7 @@ import { buildURI, parseURI } from 'lbry-redux';
import { rewards as REWARDS, ERRORS } from 'lbryinc';
import { formatLbryUrlForWeb } from 'util/url';
import ChannelContent from 'component/channelContent';
import I18nMessage from 'component/i18nMessage';
type Props = {
user: any,
@ -128,36 +129,53 @@ function Invited(props: Props) {
}
if (!rewardsApproved) {
return (
<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. `)}
const signUpButton = (
<Button
button="link"
label={hasVerifiedEmail ? __(`Finish verification `) : __(`Create an account `)}
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>
</div>
}
body={
referrerIsChannel && (
<div className="claim-preview--channel">
<div className="section">
<ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} />
</div>
<div className="section">
<ChannelContent uri={fullUri} defaultPageSize={3} defaultInfiniteScroll={false} />
</div>
</div>
)
}
actions={
<div className="card__actions">
<div className="section__actions">
<Button
button="primary"
label={hasVerifiedEmail ? __('Finish Account') : __('Create Account')}
@ -182,7 +200,7 @@ function Invited(props: Props) {
)
}
actions={
<div className="card__actions">
<div className="section__actions">
<Button button="primary" label={__('Done')} onClick={handleDone} />
</div>
}