2017-08-19 05:08:01 +02:00
|
|
|
import React from "react";
|
|
|
|
import { CreditAmount, Icon } from "component/common";
|
|
|
|
import RewardLink from "component/rewardLink";
|
2017-08-26 05:21:26 +02:00
|
|
|
import Link from "component/link";
|
|
|
|
import rewards from "rewards";
|
2017-08-19 05:08:01 +02:00
|
|
|
|
|
|
|
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-08-26 05:21:26 +02:00
|
|
|
{reward.reward_type == rewards.TYPE_REFERRAL &&
|
|
|
|
<Link
|
|
|
|
button="alt"
|
|
|
|
navigate="/invite"
|
|
|
|
label={__("Go To Invites")}
|
|
|
|
/>}
|
|
|
|
{reward.reward_type !== rewards.TYPE_REFERRAL &&
|
|
|
|
(claimed
|
|
|
|
? <span><Icon icon="icon-check" /> {__("Reward claimed.")}</span>
|
|
|
|
: <RewardLink button="alt" reward_type={reward.reward_type} />)}
|
|
|
|
</div>
|
2017-08-19 05:08:01 +02:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RewardTile;
|