2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
2018-03-26 23:32:43 +02:00
|
|
|
import ButtonTransaction from 'component/common/transaction-link';
|
2018-10-14 18:32:01 +02:00
|
|
|
import moment from 'moment';
|
2017-08-19 05:08:01 +02:00
|
|
|
|
2018-03-26 23:32:43 +02:00
|
|
|
type Reward = {
|
|
|
|
id: string,
|
|
|
|
reward_title: string,
|
|
|
|
reward_amount: number,
|
|
|
|
transaction_id: string,
|
|
|
|
created_at: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
rewards: Array<Reward>,
|
|
|
|
};
|
|
|
|
|
|
|
|
const RewardListClaimed = (props: Props) => {
|
2017-08-19 05:08:01 +02:00
|
|
|
const { rewards } = props;
|
|
|
|
|
|
|
|
if (!rewards || !rewards.length) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2019-06-17 22:32:38 +02:00
|
|
|
<section className="card">
|
|
|
|
<header className="table__header">
|
2018-12-19 06:44:53 +01:00
|
|
|
<h2 className="card__title">Claimed Rewards</h2>
|
2019-02-01 07:43:00 +01:00
|
|
|
|
|
|
|
<p className="card__subtitle">
|
|
|
|
{__(
|
2019-02-01 16:56:54 +01:00
|
|
|
'Reward history is tied to your email. In case of lost or multiple wallets, your balance may differ from the amounts claimed'
|
2019-03-05 05:46:57 +01:00
|
|
|
)}
|
|
|
|
.
|
2019-02-01 07:43:00 +01:00
|
|
|
</p>
|
2018-12-19 06:44:53 +01:00
|
|
|
</header>
|
2018-03-26 23:32:43 +02:00
|
|
|
|
2019-02-13 17:27:20 +01:00
|
|
|
<table className="card__content table table--rewards">
|
2018-03-26 23:32:43 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{__('Title')}</th>
|
|
|
|
<th>{__('Amount')}</th>
|
|
|
|
<th>{__('Transaction')}</th>
|
|
|
|
<th>{__('Date')}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-10-14 18:32:01 +02:00
|
|
|
{rewards.reverse().map(reward => (
|
2018-03-26 23:32:43 +02:00
|
|
|
<tr key={reward.id}>
|
|
|
|
<td>{reward.reward_title}</td>
|
|
|
|
<td>{reward.reward_amount}</td>
|
|
|
|
<td>
|
|
|
|
<ButtonTransaction id={reward.transaction_id} />
|
|
|
|
</td>
|
2018-10-14 18:32:01 +02:00
|
|
|
<td>{moment(reward.created_at).format('LLL')}</td>
|
2017-08-19 05:08:01 +02:00
|
|
|
</tr>
|
2018-03-26 23:32:43 +02:00
|
|
|
))}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-08-19 05:08:01 +02:00
|
|
|
</section>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RewardListClaimed;
|