lbry-desktop/src/renderer/page/transactionHistory/view.jsx

43 lines
1.2 KiB
React
Raw Normal View History

import React from 'react';
2018-03-26 23:32:43 +02:00
import BusyIndicator from 'component/common/busy-indicator';
import TransactionList from 'component/transactionList';
2018-03-26 23:32:43 +02:00
import Page from 'component/page';
2017-08-20 23:42:00 +02:00
class TransactionHistoryPage extends React.PureComponent {
componentWillMount() {
this.props.fetchTransactions();
}
render() {
const { fetchingTransactions, transactions } = this.props;
2017-08-20 23:42:00 +02:00
return (
2018-03-26 23:32:43 +02:00
<Page>
<section className="card card--section">
<div
2018-03-26 23:32:43 +02:00
className={`card__title ${
fetchingTransactions && transactions.length ? 'reloading' : ''
}`}
>
<h3>{__('Transaction History')}</h3>
2017-08-20 23:42:00 +02:00
</div>
2018-03-26 23:32:43 +02:00
{fetchingTransactions && !transactions.length ? (
<div className="card__content">
<BusyIndicator message={__('Loading transactions')} />
</div>
) : (
''
)}
{transactions && transactions.length ? (
<TransactionList transactions={transactions} />
) : (
<div className="card__content">{__("Looks like you don't have any transactions")}</div>
2018-03-26 23:32:43 +02:00
)}
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
);
}
}
export default TransactionHistoryPage;