2019-11-13 19:14:19 +01:00
|
|
|
// @flow
|
2020-08-24 19:59:37 +02:00
|
|
|
import { SITE_NAME } from 'config';
|
2019-11-21 00:01:14 +01:00
|
|
|
import * as PAGES from 'constants/pages';
|
2019-11-13 19:14:19 +01:00
|
|
|
import React from 'react';
|
|
|
|
import CreditAmount from 'component/common/credit-amount';
|
|
|
|
import Button from 'component/button';
|
|
|
|
import Card from 'component/common/card';
|
|
|
|
import I18nMessage from 'component/i18nMessage';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
balance: number,
|
|
|
|
totalRewardValue: number,
|
2020-01-22 18:46:18 +01:00
|
|
|
title?: string,
|
2019-11-13 19:14:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
function RewardAuthIntro(props: Props) {
|
2020-01-22 18:46:18 +01:00
|
|
|
const { totalRewardValue, title } = props;
|
2019-11-13 19:14:19 +01:00
|
|
|
const totalRewardRounded = Math.floor(totalRewardValue / 10) * 10;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Card
|
2020-09-03 22:05:38 +02:00
|
|
|
title={title || __('Log in to %SITE_NAME% to earn rewards', { SITE_NAME })}
|
2019-11-13 19:14:19 +01:00
|
|
|
subtitle={
|
|
|
|
<I18nMessage
|
|
|
|
tokens={{
|
|
|
|
credit_amount: <CreditAmount inheritStyle amount={totalRewardRounded} />,
|
2020-08-24 19:59:37 +02:00
|
|
|
site_name: SITE_NAME,
|
2019-11-13 19:14:19 +01:00
|
|
|
}}
|
|
|
|
>
|
2020-08-24 19:59:37 +02:00
|
|
|
A %site_name% account allows you to earn more than %credit_amount% in rewards, backup your data, and get
|
|
|
|
content and security updates.
|
2019-11-13 19:14:19 +01:00
|
|
|
</I18nMessage>
|
|
|
|
}
|
2019-11-23 19:14:14 +01:00
|
|
|
actions={
|
|
|
|
<Button
|
2020-05-05 20:02:12 +02:00
|
|
|
requiresAuth
|
2019-11-23 19:14:14 +01:00
|
|
|
button="primary"
|
2020-04-13 22:03:44 +02:00
|
|
|
navigate={`/$/${PAGES.REWARDS_VERIFY}?redirect=/$/${PAGES.REWARDS}`}
|
2019-11-23 19:14:14 +01:00
|
|
|
label={__('Unlock Rewards')}
|
|
|
|
/>
|
|
|
|
}
|
2019-11-13 19:14:19 +01:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default RewardAuthIntro;
|