lbry-desktop/src/renderer/component/rewardTile/view.jsx

39 lines
1.2 KiB
React
Raw Normal View History

import React from 'react';
import { CreditAmount, Icon } from 'component/common';
import RewardLink from 'component/rewardLink';
import Link from 'component/link';
import rewards from 'rewards';
const RewardTile = props => {
const { reward } = props;
const claimed = !!reward.transaction_id;
return (
<section className="card">
<div className="card__inner">
<div className="card__title-primary">
<CreditAmount amount={reward.reward_amount} />
<h3>{reward.reward_title}</h3>
</div>
<div className="card__content">{reward.reward_description}</div>
2017-10-03 19:27:52 +02:00
<div className="card__actions ">
2017-11-24 15:31:05 +01:00
{reward.reward_type == rewards.TYPE_REFERRAL && (
<Link button="alt" navigate="/invite" label={__('Go To Invites')} />
2017-11-24 15:31:05 +01:00
)}
2017-08-26 05:21:26 +02:00
{reward.reward_type !== rewards.TYPE_REFERRAL &&
2017-11-24 15:31:05 +01:00
(claimed ? (
<span>
<Icon icon="icon-check" /> {__('Reward claimed.')}
2017-11-24 15:31:05 +01:00
</span>
) : (
<RewardLink button="alt" reward_type={reward.reward_type} />
))}
2017-08-26 05:21:26 +02:00
</div>
</div>
</section>
);
};
export default RewardTile;