2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { BusyMessage } from 'component/common';
|
|
|
|
import SubHeader from 'component/subHeader';
|
|
|
|
import TransactionList from 'component/transactionList';
|
2017-08-19 05:08:01 +02:00
|
|
|
|
2017-08-20 23:42:00 +02:00
|
|
|
class TransactionHistoryPage extends React.PureComponent {
|
|
|
|
componentWillMount() {
|
|
|
|
this.props.fetchTransactions();
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { fetchingTransactions, transactions } = this.props;
|
2017-09-18 02:52:57 +02:00
|
|
|
|
2017-08-20 23:42:00 +02:00
|
|
|
return (
|
|
|
|
<main className="main--single-column">
|
|
|
|
<SubHeader />
|
|
|
|
<section className="card">
|
2017-09-18 02:52:57 +02:00
|
|
|
<div
|
2017-12-21 22:08:54 +01:00
|
|
|
className={`card__title-primary ${
|
|
|
|
fetchingTransactions && transactions.length ? 'reloading' : ''
|
|
|
|
}`}
|
2017-09-18 02:52:57 +02:00
|
|
|
>
|
2017-12-21 22:08:54 +01:00
|
|
|
<h3>{__('Transaction History')}</h3>
|
2017-08-20 23:42:00 +02:00
|
|
|
</div>
|
|
|
|
<div className="card__content">
|
2017-11-24 15:31:05 +01:00
|
|
|
{fetchingTransactions && !transactions.length ? (
|
2017-12-21 22:08:54 +01:00
|
|
|
<BusyMessage message={__('Loading transactions')} />
|
2017-11-24 15:31:05 +01:00
|
|
|
) : (
|
2017-12-21 22:08:54 +01:00
|
|
|
''
|
2017-11-24 15:31:05 +01:00
|
|
|
)}
|
|
|
|
{transactions && transactions.length ? (
|
|
|
|
<TransactionList transactions={transactions} />
|
|
|
|
) : (
|
2017-12-21 22:08:54 +01:00
|
|
|
''
|
2017-11-24 15:31:05 +01:00
|
|
|
)}
|
2017-08-20 23:42:00 +02:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-08-19 05:08:01 +02:00
|
|
|
|
|
|
|
export default TransactionHistoryPage;
|