From 47c19e54eff41ba94bf0af8d363a6380e56b8550 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 21 May 2020 13:18:55 -0400 Subject: [PATCH] drop down purchases page to 10 --- ui/page/fileListDownloaded/view.jsx | 6 +++++- ui/page/library/view.jsx | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/page/fileListDownloaded/view.jsx b/ui/page/fileListDownloaded/view.jsx index cba61b07e..5016e00aa 100644 --- a/ui/page/fileListDownloaded/view.jsx +++ b/ui/page/fileListDownloaded/view.jsx @@ -12,6 +12,8 @@ import { withRouter } from 'react-router'; import Card from 'component/common/card'; import classnames from 'classnames'; import Yrbl from 'component/yrbl'; +import { PURCHASES_PAGE_SIZE } from 'page/library/view'; +import Spinner from 'component/spinner'; type Props = { fetchingFileList: boolean, @@ -74,6 +76,7 @@ function FileListDownloaded(props: Props) { })} onClick={() => setViewMode(VIEW_PURCHASES)} /> + {loading && } } titleActions={ @@ -127,7 +130,8 @@ function FileListDownloaded(props: Props) { {!query && ( )} diff --git a/ui/page/library/view.jsx b/ui/page/library/view.jsx index 4514cdf10..ec9cd56b8 100644 --- a/ui/page/library/view.jsx +++ b/ui/page/library/view.jsx @@ -7,12 +7,14 @@ import DownloadList from 'page/fileListDownloaded'; import Yrbl from 'component/yrbl'; import { useHistory } from 'react-router'; +export const PURCHASES_PAGE_SIZE = 10; + type Props = { allDownloadedUrlsCount: number, myPurchases: Array, fetchingMyPurchases: boolean, fetchingFileList: boolean, - doPurchaseList: number => void, + doPurchaseList: (number, number) => void, }; function LibraryPage(props: Props) { @@ -24,7 +26,7 @@ function LibraryPage(props: Props) { const loading = fetchingFileList || fetchingMyPurchases; React.useEffect(() => { - doPurchaseList(page); + doPurchaseList(page, PURCHASES_PAGE_SIZE); }, [doPurchaseList, page]); return (