@rpg-engine/long-bow 0.8.148 → 0.8.150
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/components/Marketplace/BuyPanel.d.ts +1 -0
- package/dist/components/Marketplace/Marketplace.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +21 -12
- 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 +21 -12
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Marketplace/BuyOrderDetailsModal.tsx +2 -2
- package/src/components/Marketplace/BuyPanel.tsx +107 -80
- package/src/components/Marketplace/Marketplace.tsx +1 -0
package/package.json
CHANGED
|
@@ -117,11 +117,11 @@ export const BuyOrderDetailsModal: React.FC<IBuyOrderDetailsModalProps> = ({
|
|
|
117
117
|
</FieldRow>
|
|
118
118
|
|
|
119
119
|
<FieldRow>
|
|
120
|
-
<Label>
|
|
120
|
+
<Label>Gold Offer</Label>
|
|
121
121
|
<StyledInput
|
|
122
122
|
value={maxPrice || ''}
|
|
123
123
|
onChange={(e) => onMaxPriceChange(Number(e.target.value))}
|
|
124
|
-
placeholder="
|
|
124
|
+
placeholder="Gold offer"
|
|
125
125
|
type="number"
|
|
126
126
|
min={1}
|
|
127
127
|
onFocus={disableHotkeys}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
import { AiFillCaretRight } from 'react-icons/ai';
|
|
10
10
|
import { SortVertical } from 'pixelarticons/react/SortVertical';
|
|
11
|
-
import styled from 'styled-components';
|
|
11
|
+
import styled, { keyframes } from 'styled-components';
|
|
12
12
|
import { ConfirmModal } from '../ConfirmModal';
|
|
13
13
|
import { Dropdown } from '../Dropdown';
|
|
14
14
|
import { Input } from '../Input';
|
|
@@ -61,6 +61,7 @@ export interface IBuyPanelProps {
|
|
|
61
61
|
openBuyOrdersTotal?: number;
|
|
62
62
|
openBuyOrdersPage?: number;
|
|
63
63
|
onOpenBuyOrdersPageChange?: (page: number) => void;
|
|
64
|
+
isLoading?: boolean;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
@@ -90,6 +91,7 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
|
90
91
|
openBuyOrdersTotal = 0,
|
|
91
92
|
openBuyOrdersPage = 1,
|
|
92
93
|
onOpenBuyOrdersPageChange,
|
|
94
|
+
|
|
93
95
|
}) => {
|
|
94
96
|
const [name, setName] = useState('');
|
|
95
97
|
const [showFilters, setShowFilters] = useState(false);
|
|
@@ -369,76 +371,83 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
|
369
371
|
)}
|
|
370
372
|
|
|
371
373
|
<ItemComponentScrollWrapper id="MarketContainer" ref={itemsContainer}>
|
|
372
|
-
{!hasVisibleContent
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
374
|
+
{!hasVisibleContent ? (
|
|
375
|
+
<LoadingState>
|
|
376
|
+
<Spinner />
|
|
377
|
+
<LoadingText>Loading marketplace...</LoadingText>
|
|
378
|
+
</LoadingState>
|
|
379
|
+
) : (
|
|
380
|
+
<>
|
|
381
|
+
{showSellSection && (
|
|
382
|
+
<MarketSection>
|
|
383
|
+
<SectionHeader>
|
|
384
|
+
<SectionTitle>Sell Offers</SectionTitle>
|
|
385
|
+
<SectionMeta>{groupedItems.length} groups</SectionMeta>
|
|
386
|
+
</SectionHeader>
|
|
387
|
+
{groupedItems.length === 0 ? (
|
|
388
|
+
<SectionEmpty>No sell offers found.</SectionEmpty>
|
|
389
|
+
) : (
|
|
390
|
+
groupedItems.map(({ bestListing, otherListings }) => (
|
|
391
|
+
<GroupedMarketplaceRow
|
|
392
|
+
key={bestListing.item.key}
|
|
393
|
+
bestListing={bestListing}
|
|
394
|
+
otherListings={otherListings}
|
|
395
|
+
atlasIMG={atlasIMG}
|
|
396
|
+
atlasJSON={atlasJSON}
|
|
397
|
+
equipmentSet={equipmentSet}
|
|
398
|
+
dcToGoldSwapRate={dcToGoldSwapRate}
|
|
399
|
+
getDCEquivalentPrice={getDCEquivalentPrice}
|
|
400
|
+
characterId={characterId}
|
|
401
|
+
onBuy={setBuyingItemId}
|
|
402
|
+
/>
|
|
403
|
+
))
|
|
404
|
+
)}
|
|
405
|
+
{totalItems > itemsPerPage && (
|
|
406
|
+
<SectionPager>
|
|
407
|
+
<Pager
|
|
408
|
+
totalItems={totalItems}
|
|
409
|
+
currentPage={currentPage}
|
|
410
|
+
itemsPerPage={itemsPerPage}
|
|
411
|
+
onPageChange={onPageChange}
|
|
412
|
+
/>
|
|
413
|
+
</SectionPager>
|
|
414
|
+
)}
|
|
415
|
+
</MarketSection>
|
|
407
416
|
)}
|
|
408
|
-
</MarketSection>
|
|
409
|
-
)}
|
|
410
417
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
418
|
+
{showBuySection && (
|
|
419
|
+
<MarketSection>
|
|
420
|
+
<SectionHeader>
|
|
421
|
+
<SectionTitle>Buy Requests</SectionTitle>
|
|
422
|
+
<SectionMeta>{visibleBuyOrders.length} visible</SectionMeta>
|
|
423
|
+
</SectionHeader>
|
|
424
|
+
{visibleBuyOrders.length === 0 ? (
|
|
425
|
+
<SectionEmpty>No public buy requests found.</SectionEmpty>
|
|
426
|
+
) : (
|
|
427
|
+
visibleBuyOrders.map(order => (
|
|
428
|
+
<BuyOrderRow
|
|
429
|
+
key={order._id}
|
|
430
|
+
buyOrder={order}
|
|
431
|
+
atlasJSON={atlasJSON}
|
|
432
|
+
atlasIMG={atlasIMG}
|
|
433
|
+
onFulfill={setFulfillingBuyOrderId}
|
|
434
|
+
showRequestTag
|
|
435
|
+
/>
|
|
436
|
+
))
|
|
437
|
+
)}
|
|
438
|
+
{openBuyOrdersTotal > BUY_REQUESTS_PER_PAGE && (
|
|
439
|
+
<SectionPager>
|
|
440
|
+
<Pager
|
|
441
|
+
totalItems={openBuyOrdersTotal}
|
|
442
|
+
currentPage={openBuyOrdersPage}
|
|
443
|
+
itemsPerPage={BUY_REQUESTS_PER_PAGE}
|
|
444
|
+
onPageChange={onOpenBuyOrdersPageChange ?? (() => {})}
|
|
445
|
+
/>
|
|
446
|
+
</SectionPager>
|
|
447
|
+
)}
|
|
448
|
+
</MarketSection>
|
|
440
449
|
)}
|
|
441
|
-
|
|
450
|
+
</>
|
|
442
451
|
)}
|
|
443
452
|
</ItemComponentScrollWrapper>
|
|
444
453
|
</>
|
|
@@ -622,18 +631,6 @@ const SectionEmpty = styled.div`
|
|
|
622
631
|
border-radius: 6px;
|
|
623
632
|
`;
|
|
624
633
|
|
|
625
|
-
const EmptyState = styled.div`
|
|
626
|
-
min-height: 96px;
|
|
627
|
-
display: flex;
|
|
628
|
-
align-items: center;
|
|
629
|
-
justify-content: center;
|
|
630
|
-
color: #71717a;
|
|
631
|
-
font-size: 0.52rem;
|
|
632
|
-
text-transform: uppercase;
|
|
633
|
-
letter-spacing: 1px;
|
|
634
|
-
padding: 0 16px;
|
|
635
|
-
text-align: center;
|
|
636
|
-
`;
|
|
637
634
|
|
|
638
635
|
const SectionPager = styled.div`
|
|
639
636
|
display: flex;
|
|
@@ -645,3 +642,33 @@ const StyledDropdown = styled(Dropdown)`
|
|
|
645
642
|
margin: 0px !important;
|
|
646
643
|
width: 100% !important;
|
|
647
644
|
`;
|
|
645
|
+
|
|
646
|
+
const spin = keyframes`
|
|
647
|
+
to { transform: rotate(360deg); }
|
|
648
|
+
`;
|
|
649
|
+
|
|
650
|
+
const LoadingState = styled.div`
|
|
651
|
+
display: flex;
|
|
652
|
+
flex-direction: column;
|
|
653
|
+
align-items: center;
|
|
654
|
+
justify-content: center;
|
|
655
|
+
gap: 14px;
|
|
656
|
+
height: 100%;
|
|
657
|
+
min-height: 160px;
|
|
658
|
+
`;
|
|
659
|
+
|
|
660
|
+
const Spinner = styled.div`
|
|
661
|
+
width: 28px;
|
|
662
|
+
height: 28px;
|
|
663
|
+
border: 3px solid rgba(245, 158, 11, 0.2);
|
|
664
|
+
border-top-color: #f59e0b;
|
|
665
|
+
border-radius: 50%;
|
|
666
|
+
animation: ${spin} 0.7s linear infinite;
|
|
667
|
+
`;
|
|
668
|
+
|
|
669
|
+
const LoadingText = styled.span`
|
|
670
|
+
font-size: 0.48rem;
|
|
671
|
+
color: #8a8a8a;
|
|
672
|
+
text-transform: uppercase;
|
|
673
|
+
letter-spacing: 1px;
|
|
674
|
+
`;
|
|
@@ -65,6 +65,7 @@ export interface IMarketPlaceProps {
|
|
|
65
65
|
acceptedCurrency?: MarketplaceAcceptedCurrency;
|
|
66
66
|
onAcceptedCurrencyChange?: (value: MarketplaceAcceptedCurrency) => void;
|
|
67
67
|
onActiveTabChange?: (tab: string) => void;
|
|
68
|
+
isLoading?: boolean;
|
|
68
69
|
|
|
69
70
|
// Buy Order props
|
|
70
71
|
buyOrderSelectedBlueprint?: IMarketplaceBlueprintSummary;
|