Fix crash on fullpage order book

This commit is contained in:
Reckless_Satoshi 2023-02-13 11:17:06 -08:00
parent 6ef62a1fa4
commit db83f2b972
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -1,6 +1,5 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import {
Box,
Grid,
@ -68,7 +67,6 @@ const BookTable = ({
}: BookTableProps): JSX.Element => {
const { t } = useTranslation();
const theme = useTheme();
const history = useHistory();
const [pageSize, setPageSize] = useState(0);
const [fullscreen, setFullscreen] = useState(defaultFullscreen);
const [paymentMethods, setPaymentMethods] = useState<string[]>([]);
@ -781,6 +779,15 @@ const BookTable = ({
columns={columns}
hideFooter={!showFooter}
components={gridComponents()}
componentsProps={{
toolbar: {
width,
fav,
setFav,
paymentMethod: paymentMethods,
setPaymentMethods,
},
}}
pageSize={book.loading && book.orders.length == 0 ? 0 : pageSize}
rowsPerPageOptions={[0, pageSize, defaultPageSize * 2, 50, 100]}
onPageSizeChange={(newPageSize) => {