mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-14 11:26:24 +00:00
Fix non interactive book controls
This commit is contained in:
parent
74364fd522
commit
19796c7c50
@ -148,7 +148,7 @@ const BookControl = ({
|
|||||||
</Grid>
|
</Grid>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{width > mediumToolbarWidth && window.NativeRobosats === undefined ? (
|
{width > mediumToolbarWidth ? (
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<AutocompletePayments
|
<AutocompletePayments
|
||||||
sx={{
|
sx={{
|
||||||
@ -176,9 +176,7 @@ const BookControl = ({
|
|||||||
</Grid>
|
</Grid>
|
||||||
) : null}
|
) : 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 ? (
|
||||||
{(width > smallestToolbarWidth && width < mediumToolbarWidth) ||
|
|
||||||
window.NativeRobosats != undefined ? (
|
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Select
|
<Select
|
||||||
sx={{
|
sx={{
|
||||||
|
@ -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 gridComponents = function () {
|
||||||
const components: GridComponentProps = {
|
const components: GridComponentProps = {
|
||||||
LoadingOverlay: LinearProgress,
|
LoadingOverlay: LinearProgress,
|
||||||
@ -721,7 +707,7 @@ const BookTable = ({
|
|||||||
components.Footer = Footer;
|
components.Footer = Footer;
|
||||||
}
|
}
|
||||||
if (showControls) {
|
if (showControls) {
|
||||||
components.Toolbar = Controls;
|
components.Toolbar = BookControl;
|
||||||
}
|
}
|
||||||
return components;
|
return components;
|
||||||
};
|
};
|
||||||
@ -753,6 +739,17 @@ const BookTable = ({
|
|||||||
columns={columns}
|
columns={columns}
|
||||||
hideFooter={!showFooter}
|
hideFooter={!showFooter}
|
||||||
components={gridComponents()}
|
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}
|
pageSize={book.loading && book.orders.length == 0 ? 0 : pageSize}
|
||||||
rowsPerPageOptions={width < 22 ? [] : [0, pageSize, defaultPageSize * 2, 50, 100]}
|
rowsPerPageOptions={width < 22 ? [] : [0, pageSize, defaultPageSize * 2, 50, 100]}
|
||||||
onPageSizeChange={(newPageSize) => {
|
onPageSizeChange={(newPageSize) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user