From ca0476c6bbb119c2999f9ed5e476d885c2fff646 Mon Sep 17 00:00:00 2001 From: jessop Date: Wed, 25 Sep 2019 14:12:02 -0400 Subject: [PATCH] cleanup, pagesize change --- src/ui/component/transactionList/view.jsx | 17 +++++++++++------ src/ui/component/transactionListTable/view.jsx | 1 - 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ui/component/transactionList/view.jsx b/src/ui/component/transactionList/view.jsx index 80ea852c5..e9df277c7 100644 --- a/src/ui/component/transactionList/view.jsx +++ b/src/ui/component/transactionList/view.jsx @@ -4,7 +4,8 @@ import React from 'react'; import { FormField } from 'component/common/form'; import Button from 'component/button'; import FileExporter from 'component/common/file-exporter'; -import { TRANSACTIONS } from 'lbry-redux'; +import { TRANSACTIONS, TX_LIST } from 'lbry-redux'; +import * as PAGES from 'constants/pages'; import TransactionListTable from 'component/transactionListTable'; import RefreshTransactionButton from 'component/transactionRefreshButton'; import Spinner from 'component/spinner'; @@ -25,7 +26,6 @@ type Props = { function TransactionList(props: Props) { const { emptyMessage, slim, filterSetting, title, transactions, loading, history, transactionCount } = props; - const PAGE_SIZE = 20; // Flow offers little support for Object.values() typing. // https://github.com/facebook/flow/issues/2221 // $FlowFixMe @@ -37,7 +37,7 @@ function TransactionList(props: Props) { function handleFilterChanged(event: SyntheticInputEvent<*>) { props.setTransactionFilter(event.target.value); - history.replace(`#/$/transactions`); // + history.replace(`/$/${PAGES.TRANSACTIONS}`); // } return ( @@ -50,7 +50,12 @@ function TransactionList(props: Props) {
{slim && ( -
@@ -99,8 +104,8 @@ function TransactionList(props: Props) { {!!transactions && !!transactions.length && } {!slim && !!transactionCount && ( history.replace(`#/$/transactions?page=${Number(page)}`)} - totalPages={Math.ceil(transactionCount / PAGE_SIZE)} + onPageChange={page => history.replace(`/$/${PAGES.TRANSACTIONS}?page=${Number(page)}`)} + totalPages={Math.ceil(transactionCount / TX_LIST.PAGE_SIZE)} /> )} diff --git a/src/ui/component/transactionListTable/view.jsx b/src/ui/component/transactionListTable/view.jsx index 0c88fc7a9..143cfcafb 100644 --- a/src/ui/component/transactionListTable/view.jsx +++ b/src/ui/component/transactionListTable/view.jsx @@ -13,7 +13,6 @@ type Props = { transactionList: Array, }; -// class TransactionList extends React.PureComponent { function TransactionListTable(props: Props) { const { emptyMessage, rewards, loading, transactionList } = props;