Fix non interactive book controls

This commit is contained in:
Reckless_Satoshi 2022-11-17 12:24:55 -08:00
parent 74364fd522
commit 19796c7c50
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 14 additions and 19 deletions

View File

@ -148,7 +148,7 @@ const BookControl = ({
</Grid>
) : null}
{width > mediumToolbarWidth && window.NativeRobosats === undefined ? (
{width > mediumToolbarWidth ? (
<Grid item>
<AutocompletePayments
sx={{
@ -176,9 +176,7 @@ const BookControl = ({
</Grid>
) : null}
{/* Native Android app must always show the Select, as the on display keyboard does not play well with the book table component */}
{(width > smallestToolbarWidth && width < mediumToolbarWidth) ||
window.NativeRobosats != undefined ? (
{width > smallestToolbarWidth && width < mediumToolbarWidth ? (
<Grid item>
<Select
sx={{

View File

@ -694,20 +694,6 @@ const BookTable = ({
);
};
const Controls = function () {
return (
<BookControl
width={width}
type={fav.type}
currency={fav.currency}
onCurrencyChange={onCurrencyChange}
onTypeChange={onTypeChange}
paymentMethod={paymentMethods}
setPaymentMethods={setPaymentMethods}
/>
);
};
const gridComponents = function () {
const components: GridComponentProps = {
LoadingOverlay: LinearProgress,
@ -721,7 +707,7 @@ const BookTable = ({
components.Footer = Footer;
}
if (showControls) {
components.Toolbar = Controls;
components.Toolbar = BookControl;
}
return components;
};
@ -753,6 +739,17 @@ const BookTable = ({
columns={columns}
hideFooter={!showFooter}
components={gridComponents()}
componentsProps={{
toolbar: {
width,
type: fav.type,
currency: fav.currency,
onCurrencyChange,
onTypeChange,
paymentMethod: paymentMethods,
setPaymentMethods,
},
}}
pageSize={book.loading && book.orders.length == 0 ? 0 : pageSize}
rowsPerPageOptions={width < 22 ? [] : [0, pageSize, defaultPageSize * 2, 50, 100]}
onPageSizeChange={(newPageSize) => {