@rpg-engine/long-bow 0.8.163 → 0.8.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/long-bow.cjs.development.js +7 -5
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +7 -5
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Marketplace/BuyPanel.tsx +8 -4
package/package.json
CHANGED
|
@@ -90,7 +90,6 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
|
90
90
|
dcBalance = 0,
|
|
91
91
|
dcToGoldSwapRate = 0,
|
|
92
92
|
openBuyOrders = [],
|
|
93
|
-
openBuyOrdersTotal = 0,
|
|
94
93
|
openBuyOrdersPage = 1,
|
|
95
94
|
onOpenBuyOrdersPageChange,
|
|
96
95
|
isLoading = false,
|
|
@@ -191,6 +190,11 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
|
191
190
|
});
|
|
192
191
|
}, [visibleBuyOrders]);
|
|
193
192
|
|
|
193
|
+
const paginatedGroupedBuyOrders = useMemo(() => {
|
|
194
|
+
const start = (openBuyOrdersPage - 1) * BUY_REQUESTS_PER_PAGE;
|
|
195
|
+
return groupedBuyOrders.slice(start, start + BUY_REQUESTS_PER_PAGE);
|
|
196
|
+
}, [groupedBuyOrders, openBuyOrdersPage]);
|
|
197
|
+
|
|
194
198
|
const showSellSection = browseMode === 'sell';
|
|
195
199
|
const showBuySection = browseMode === 'buy';
|
|
196
200
|
const hasVisibleContent =
|
|
@@ -447,7 +451,7 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
|
447
451
|
{groupedBuyOrders.length === 0 ? (
|
|
448
452
|
<SectionEmpty>No public buy requests found.</SectionEmpty>
|
|
449
453
|
) : (
|
|
450
|
-
|
|
454
|
+
paginatedGroupedBuyOrders.map(({ bestOrder, otherOrders }) => (
|
|
451
455
|
<GroupedBuyOrderRow
|
|
452
456
|
key={bestOrder._id}
|
|
453
457
|
bestOrder={bestOrder}
|
|
@@ -473,9 +477,9 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
|
473
477
|
onPageChange={onPageChange}
|
|
474
478
|
/>
|
|
475
479
|
)}
|
|
476
|
-
{showBuySection &&
|
|
480
|
+
{showBuySection && groupedBuyOrders.length > BUY_REQUESTS_PER_PAGE && (
|
|
477
481
|
<Pager
|
|
478
|
-
totalItems={
|
|
482
|
+
totalItems={groupedBuyOrders.length}
|
|
479
483
|
currentPage={openBuyOrdersPage}
|
|
480
484
|
itemsPerPage={BUY_REQUESTS_PER_PAGE}
|
|
481
485
|
onPageChange={onOpenBuyOrdersPageChange ?? (() => {})}
|