2017-08-18 05:31:44 +02:00
|
|
|
import React from "react";
|
|
|
|
import { Icon } from "component/common";
|
2017-08-25 21:51:54 +02:00
|
|
|
import RewardLink from "component/rewardLink";
|
|
|
|
import rewards from "rewards.js";
|
2017-08-18 05:31:44 +02:00
|
|
|
|
|
|
|
class InviteList extends React.PureComponent {
|
|
|
|
render() {
|
|
|
|
const { invitees } = this.props;
|
|
|
|
|
|
|
|
if (!invitees) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<section className="card">
|
|
|
|
<div className="card__title-primary">
|
|
|
|
<h3>{__("Invite History")}</h3>
|
|
|
|
</div>
|
|
|
|
<div className="card__content">
|
|
|
|
{invitees.length === 0 &&
|
|
|
|
<span className="empty">{__("You haven't invited anyone.")} </span>}
|
|
|
|
{invitees.length > 0 &&
|
|
|
|
<table className="table-standard table-stretch">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
{__("Invitee Email")}
|
|
|
|
</th>
|
|
|
|
<th className="text-center">
|
|
|
|
{__("Invite Status")}
|
|
|
|
</th>
|
|
|
|
<th className="text-center">
|
|
|
|
{__("Reward")}
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{invitees.map((invitee, index) => {
|
|
|
|
return (
|
|
|
|
<tr key={index}>
|
|
|
|
<td>{invitee.email}</td>
|
|
|
|
<td className="text-center">
|
2017-08-25 21:51:54 +02:00
|
|
|
{invitee.invite_accepted
|
|
|
|
? <Icon icon="icon-check" />
|
|
|
|
: <span className="empty">{__("unused")}</span>}
|
2017-08-18 05:31:44 +02:00
|
|
|
</td>
|
|
|
|
<td className="text-center">
|
2017-08-25 21:51:54 +02:00
|
|
|
{invitee.invite_reward_claimed
|
|
|
|
? <Icon icon="icon-check" />
|
2017-08-26 05:21:26 +02:00
|
|
|
: invitee.invite_accepted
|
|
|
|
? <RewardLink
|
|
|
|
label={__("Claim")}
|
2017-08-31 20:23:57 +02:00
|
|
|
reward_type={rewards.TYPE_REFERRAL}
|
2017-08-26 05:21:26 +02:00
|
|
|
/>
|
|
|
|
: <span className="empty">
|
|
|
|
{__("unclaimable")}
|
|
|
|
</span>}
|
2017-08-18 05:31:44 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</tbody>
|
|
|
|
</table>}
|
|
|
|
</div>
|
2017-08-31 20:39:30 +02:00
|
|
|
<div className="card__content">
|
|
|
|
<div className="help">
|
|
|
|
{__(
|
|
|
|
"The maximum number of invite rewards is currently limited. Invite reward can only be claimed if the invitee passes the humanness test."
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-18 05:31:44 +02:00
|
|
|
</section>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default InviteList;
|