2018-09-24 05:44:42 +02:00
|
|
|
// @flow
|
2018-11-26 02:21:25 +01:00
|
|
|
import * as ICONS from 'constants/icons';
|
2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Icon from 'component/common/icon';
|
2017-12-21 22:08:54 +01:00
|
|
|
import RewardLink from 'component/rewardLink';
|
2019-01-27 01:23:47 +01:00
|
|
|
import Yrbl from 'component/common/yrbl';
|
2018-09-24 05:44:42 +02:00
|
|
|
import { rewards } from 'lbryinc';
|
2017-08-18 05:31:44 +02:00
|
|
|
|
2018-09-24 05:44:42 +02:00
|
|
|
type Props = {
|
|
|
|
invitees: ?Array<{
|
|
|
|
email: string,
|
|
|
|
invite_accepted: boolean,
|
|
|
|
invite_reward_claimed: boolean,
|
|
|
|
invite_reward_claimable: boolean,
|
|
|
|
}>,
|
|
|
|
};
|
|
|
|
|
|
|
|
class InviteList extends React.PureComponent<Props> {
|
2017-08-18 05:31:44 +02:00
|
|
|
render() {
|
|
|
|
const { invitees } = this.props;
|
|
|
|
|
|
|
|
if (!invitees) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-01-27 01:23:47 +01:00
|
|
|
if (!invitees.length) {
|
|
|
|
return (
|
|
|
|
<Yrbl
|
|
|
|
type="happy"
|
|
|
|
title={__('Power To The People')}
|
|
|
|
subtitle={__(
|
|
|
|
'LBRY is powered by the users. More users, more power… and with great power comes great responsibility.'
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-08-18 05:31:44 +02:00
|
|
|
return (
|
2018-03-26 23:32:43 +02:00
|
|
|
<section className="card card--section">
|
2018-12-19 06:44:53 +01:00
|
|
|
<header className="card__header">
|
|
|
|
<h2 className="card__title">{__('Invite History')}</h2>
|
|
|
|
</header>
|
|
|
|
|
2017-08-18 05:31:44 +02:00
|
|
|
<div className="card__content">
|
2019-01-27 01:23:47 +01:00
|
|
|
<table className="table 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 => (
|
|
|
|
<tr key={invitee.email}>
|
|
|
|
<td>{invitee.email}</td>
|
|
|
|
<td className="text-center">
|
|
|
|
{invitee.invite_accepted ? (
|
|
|
|
<Icon icon={ICONS.COMPLETED} />
|
|
|
|
) : (
|
|
|
|
<span className="empty">{__('unused')}</span>
|
|
|
|
)}
|
|
|
|
</td>
|
|
|
|
<td className="text-center">
|
|
|
|
{invitee.invite_reward_claimed && <Icon icon={ICONS.COMPLETED} />}
|
|
|
|
{!invitee.invite_reward_claimed && invitee.invite_reward_claimable ? (
|
|
|
|
<RewardLink label={__('claim')} reward_type={rewards.TYPE_REFERRAL} />
|
|
|
|
) : (
|
|
|
|
<span className="empty">{__('unclaimable')}</span>
|
|
|
|
)}
|
|
|
|
</td>
|
2017-08-18 05:31:44 +02:00
|
|
|
</tr>
|
2019-01-27 01:23:47 +01:00
|
|
|
))}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-12-19 06:44:53 +01:00
|
|
|
|
2017-08-31 20:39:30 +02:00
|
|
|
<div className="help">
|
|
|
|
{__(
|
2017-12-21 22:08:54 +01:00
|
|
|
'The maximum number of invite rewards is currently limited. Invite reward can only be claimed if the invitee passes the humanness test.'
|
2017-08-31 20:39:30 +02:00
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-18 05:31:44 +02:00
|
|
|
</section>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default InviteList;
|