2018-11-07 20:35:47 +01:00
|
|
|
// @flow
|
2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
2019-04-11 18:12:00 +02:00
|
|
|
import classnames from 'classnames';
|
2017-12-21 22:08:54 +01:00
|
|
|
import TransactionList from 'component/transactionList';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Page from 'component/page';
|
2019-04-11 18:12:00 +02:00
|
|
|
import UnsupportedOnWeb from 'component/common/unsupported-on-web';
|
2017-08-19 05:08:01 +02:00
|
|
|
|
2018-11-07 20:35:47 +01:00
|
|
|
type Props = {
|
|
|
|
fetchMyClaims: () => void,
|
|
|
|
fetchTransactions: () => void,
|
|
|
|
fetchingTransactions: boolean,
|
2019-09-23 04:47:07 +02:00
|
|
|
filteredTransactionPage: Array<{}>,
|
|
|
|
filteredTransactionsCount: number,
|
2018-11-07 20:35:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class TransactionHistoryPage extends React.PureComponent<Props> {
|
|
|
|
componentDidMount() {
|
|
|
|
const { fetchMyClaims, fetchTransactions } = this.props;
|
|
|
|
|
|
|
|
fetchMyClaims();
|
|
|
|
fetchTransactions();
|
2017-08-20 23:42:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2019-09-23 04:47:07 +02:00
|
|
|
const { filteredTransactionPage, filteredTransactionsCount } = this.props;
|
2017-09-18 02:52:57 +02:00
|
|
|
|
2017-08-20 23:42:00 +02:00
|
|
|
return (
|
2018-03-26 23:32:43 +02:00
|
|
|
<Page>
|
2019-04-11 18:12:00 +02:00
|
|
|
{IS_WEB && <UnsupportedOnWeb />}
|
|
|
|
<section
|
2019-06-17 22:32:38 +02:00
|
|
|
className={classnames('card', {
|
2019-04-11 18:12:00 +02:00
|
|
|
'card--disabled': IS_WEB,
|
|
|
|
})}
|
|
|
|
>
|
2019-09-23 04:47:07 +02:00
|
|
|
<TransactionList
|
|
|
|
transactions={filteredTransactionPage}
|
|
|
|
transactionCount={filteredTransactionsCount}
|
|
|
|
title={__('Transaction History')}
|
|
|
|
/>
|
2017-08-20 23:42:00 +02:00
|
|
|
</section>
|
2018-03-26 23:32:43 +02:00
|
|
|
</Page>
|
2017-08-20 23:42:00 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-08-19 05:08:01 +02:00
|
|
|
|
|
|
|
export default TransactionHistoryPage;
|