lbry-desktop/src/ui/component/rewardSummary/view.jsx

53 lines
1.5 KiB
React
Raw Normal View History

2017-12-12 00:50:22 +01:00
// @flow
2018-03-26 23:32:43 +02:00
import * as React from 'react';
import Button from 'component/button';
import CreditAmount from 'component/common/credit-amount';
2017-08-20 23:42:00 +02:00
2017-12-12 00:50:22 +01:00
type Props = {
unclaimedRewardAmount: number,
fetching: boolean,
2017-12-12 21:49:50 +01:00
};
2017-12-12 00:50:22 +01:00
class RewardSummary extends React.Component<Props> {
render() {
const { unclaimedRewardAmount, fetching } = this.props;
const hasRewards = unclaimedRewardAmount > 0;
return (
<section className="card card--section">
<header className="card__header">
2019-06-17 22:32:38 +02:00
<h2 className="card__title">{__('Rewards')}</h2>
</header>
2019-06-17 22:32:38 +02:00
<p className="card__subtitle">
{fetching && __('You have...')}
{!fetching && hasRewards ? (
<React.Fragment>
2019-06-19 07:05:43 +02:00
{/* @i18nfixme */}
2019-06-17 22:32:38 +02:00
{__('You have')}
&nbsp;
<CreditAmount inheritStyle amount={unclaimedRewardAmount} precision={8} />
&nbsp;
{__('in unclaimed rewards')}.
</React.Fragment>
) : (
__('You have no rewards available, please check')
)}
</p>
<div className="card__content">
<div className="card__actions">
<Button
button="primary"
2019-03-28 17:53:13 +01:00
navigate="/$/rewards"
label={hasRewards ? __('Claim Rewards') : __('View Rewards')}
/>
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/rewards" />.
</div>
</div>
</section>
);
}
}
2017-08-20 23:42:00 +02:00
export default RewardSummary;