@rpg-engine/long-bow 0.8.148 → 0.8.149

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.149",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -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
+ isLoading = false,
93
95
  }) => {
94
96
  const [name, setName] = useState('');
95
97
  const [showFilters, setShowFilters] = useState(false);
@@ -369,7 +371,13 @@ 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>}
374
+ {isLoading && !hasVisibleContent && (
375
+ <LoadingState>
376
+ <Spinner />
377
+ <LoadingText>Loading marketplace...</LoadingText>
378
+ </LoadingState>
379
+ )}
380
+ {!isLoading && !hasVisibleContent && <EmptyState>No offers match the current filters.</EmptyState>}
373
381
 
374
382
  {showSellSection && (
375
383
  <MarketSection>
@@ -645,3 +653,33 @@ const StyledDropdown = styled(Dropdown)`
645
653
  margin: 0px !important;
646
654
  width: 100% !important;
647
655
  `;
656
+
657
+ const spin = keyframes`
658
+ to { transform: rotate(360deg); }
659
+ `;
660
+
661
+ const LoadingState = styled.div`
662
+ display: flex;
663
+ flex-direction: column;
664
+ align-items: center;
665
+ justify-content: center;
666
+ gap: 14px;
667
+ height: 100%;
668
+ min-height: 160px;
669
+ `;
670
+
671
+ const Spinner = styled.div`
672
+ width: 28px;
673
+ height: 28px;
674
+ border: 3px solid rgba(245, 158, 11, 0.2);
675
+ border-top-color: #f59e0b;
676
+ border-radius: 50%;
677
+ animation: ${spin} 0.7s linear infinite;
678
+ `;
679
+
680
+ const LoadingText = styled.span`
681
+ font-size: 0.48rem;
682
+ color: #8a8a8a;
683
+ text-transform: uppercase;
684
+ letter-spacing: 1px;
685
+ `;
@@ -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;