@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.8.148",
3
+ "version": "0.8.150",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -117,11 +117,11 @@ export const BuyOrderDetailsModal: React.FC<IBuyOrderDetailsModalProps> = ({
117
117
  </FieldRow>
118
118
 
119
119
  <FieldRow>
120
- <Label>Max Gold</Label>
120
+ <Label>Gold Offer</Label>
121
121
  <StyledInput
122
122
  value={maxPrice || ''}
123
123
  onChange={(e) => onMaxPriceChange(Number(e.target.value))}
124
- placeholder="Max gold"
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 && <EmptyState>No offers match the current filters.</EmptyState>}
373
-
374
- {showSellSection && (
375
- <MarketSection>
376
- <SectionHeader>
377
- <SectionTitle>Sell Offers</SectionTitle>
378
- <SectionMeta>{groupedItems.length} groups</SectionMeta>
379
- </SectionHeader>
380
- {groupedItems.length === 0 ? (
381
- <SectionEmpty>No sell offers found.</SectionEmpty>
382
- ) : (
383
- groupedItems.map(({ bestListing, otherListings }) => (
384
- <GroupedMarketplaceRow
385
- key={bestListing.item.key}
386
- bestListing={bestListing}
387
- otherListings={otherListings}
388
- atlasIMG={atlasIMG}
389
- atlasJSON={atlasJSON}
390
- equipmentSet={equipmentSet}
391
- dcToGoldSwapRate={dcToGoldSwapRate}
392
- getDCEquivalentPrice={getDCEquivalentPrice}
393
- characterId={characterId}
394
- onBuy={setBuyingItemId}
395
- />
396
- ))
397
- )}
398
- {totalItems > itemsPerPage && (
399
- <SectionPager>
400
- <Pager
401
- totalItems={totalItems}
402
- currentPage={currentPage}
403
- itemsPerPage={itemsPerPage}
404
- onPageChange={onPageChange}
405
- />
406
- </SectionPager>
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
- {showBuySection && (
412
- <MarketSection>
413
- <SectionHeader>
414
- <SectionTitle>Buy Requests</SectionTitle>
415
- <SectionMeta>{visibleBuyOrders.length} visible</SectionMeta>
416
- </SectionHeader>
417
- {visibleBuyOrders.length === 0 ? (
418
- <SectionEmpty>No public buy requests found.</SectionEmpty>
419
- ) : (
420
- visibleBuyOrders.map(order => (
421
- <BuyOrderRow
422
- key={order._id}
423
- buyOrder={order}
424
- atlasJSON={atlasJSON}
425
- atlasIMG={atlasIMG}
426
- onFulfill={setFulfillingBuyOrderId}
427
- showRequestTag
428
- />
429
- ))
430
- )}
431
- {openBuyOrdersTotal > BUY_REQUESTS_PER_PAGE && (
432
- <SectionPager>
433
- <Pager
434
- totalItems={openBuyOrdersTotal}
435
- currentPage={openBuyOrdersPage}
436
- itemsPerPage={BUY_REQUESTS_PER_PAGE}
437
- onPageChange={onOpenBuyOrdersPageChange ?? (() => {})}
438
- />
439
- </SectionPager>
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
- </MarketSection>
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;