@rpg-engine/long-bow 0.8.188 → 0.8.189
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/MyCharacterListingsPanel.d.ts +4 -1
- package/dist/long-bow.cjs.development.js +206 -199
- 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 +206 -199
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/marketplace/CharacterMarketplace.stories.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Marketplace/Marketplace.tsx +2 -0
- package/src/components/Marketplace/MyCharacterListingsPanel.tsx +140 -112
- package/src/stories/Features/marketplace/CharacterMarketplace.stories.tsx +45 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICharacterListing } from '@rpg-engine/shared';
|
|
1
|
+
import { ICharacter, ICharacterListing } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface IMyCharacterListingsPanelProps {
|
|
4
4
|
myCharacterListings: ICharacterListing[];
|
|
@@ -7,6 +7,9 @@ export interface IMyCharacterListingsPanelProps {
|
|
|
7
7
|
itemsPerPage: number;
|
|
8
8
|
onPageChange: (page: number) => void;
|
|
9
9
|
onCharacterDelist: (listingId: string) => void;
|
|
10
|
+
/** Characters that can be listed (used for the List a Character modal) */
|
|
11
|
+
accountCharacters: ICharacter[];
|
|
12
|
+
onCharacterList: (characterId: string, price: number) => void;
|
|
10
13
|
/** Items atlas — for UI sprites like the DC coin */
|
|
11
14
|
atlasJSON: any;
|
|
12
15
|
atlasIMG: any;
|
|
@@ -47625,195 +47625,6 @@ var EmptyText = /*#__PURE__*/styled__default.span.withConfig({
|
|
|
47625
47625
|
componentId: "sc-1aiauep-17"
|
|
47626
47626
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.48rem !important;color:#71717a !important;text-transform:uppercase;letter-spacing:1px;"]);
|
|
47627
47627
|
|
|
47628
|
-
var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
|
|
47629
|
-
var myCharacterListings = _ref.myCharacterListings,
|
|
47630
|
-
totalCount = _ref.totalCount,
|
|
47631
|
-
currentPage = _ref.currentPage,
|
|
47632
|
-
itemsPerPage = _ref.itemsPerPage,
|
|
47633
|
-
onPageChange = _ref.onPageChange,
|
|
47634
|
-
onCharacterDelist = _ref.onCharacterDelist,
|
|
47635
|
-
atlasJSON = _ref.atlasJSON,
|
|
47636
|
-
atlasIMG = _ref.atlasIMG,
|
|
47637
|
-
characterAtlasJSON = _ref.characterAtlasJSON,
|
|
47638
|
-
characterAtlasIMG = _ref.characterAtlasIMG,
|
|
47639
|
-
enableHotkeys = _ref.enableHotkeys;
|
|
47640
|
-
var _useState = React.useState(null),
|
|
47641
|
-
delistingListingId = _useState[0],
|
|
47642
|
-
setDelistingListingId = _useState[1];
|
|
47643
|
-
var itemsContainer = React.useRef(null);
|
|
47644
|
-
React.useEffect(function () {
|
|
47645
|
-
var _itemsContainer$curre;
|
|
47646
|
-
(_itemsContainer$curre = itemsContainer.current) == null ? void 0 : _itemsContainer$curre.scrollTo(0, 0);
|
|
47647
|
-
}, [currentPage]);
|
|
47648
|
-
var handleDelistClick = function handleDelistClick(listingId) {
|
|
47649
|
-
setDelistingListingId(listingId);
|
|
47650
|
-
};
|
|
47651
|
-
var handleDelistConfirm = function handleDelistConfirm() {
|
|
47652
|
-
if (delistingListingId) {
|
|
47653
|
-
onCharacterDelist(delistingListingId);
|
|
47654
|
-
setDelistingListingId(null);
|
|
47655
|
-
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
47656
|
-
}
|
|
47657
|
-
};
|
|
47658
|
-
var getFormattedDate = function getFormattedDate(date) {
|
|
47659
|
-
return new Date(date).toLocaleDateString();
|
|
47660
|
-
};
|
|
47661
|
-
return React__default.createElement(React__default.Fragment, null, delistingListingId && React__default.createElement(ConfirmModal, {
|
|
47662
|
-
onClose: function onClose() {
|
|
47663
|
-
setDelistingListingId(null);
|
|
47664
|
-
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
47665
|
-
},
|
|
47666
|
-
onConfirm: handleDelistConfirm,
|
|
47667
|
-
message: "Are you sure you want to delist this character?"
|
|
47668
|
-
}), React__default.createElement(ListingsContainer$1, {
|
|
47669
|
-
id: "MarketContainer",
|
|
47670
|
-
ref: itemsContainer
|
|
47671
|
-
}, myCharacterListings.length === 0 ? React__default.createElement(EmptyState$6, null, React__default.createElement(User.User, {
|
|
47672
|
-
width: 32,
|
|
47673
|
-
height: 32
|
|
47674
|
-
}), React__default.createElement(EmptyText$1, null, "You have no listed characters."), React__default.createElement(EmptySubtext, null, "Use the \"List Character\" tab to list a character for sale.")) : React__default.createElement(ListingsGrid$1, null, myCharacterListings.map(function (listing) {
|
|
47675
|
-
return React__default.createElement(CharacterListingCard$1, {
|
|
47676
|
-
key: listing._id
|
|
47677
|
-
}, React__default.createElement(CharacterSprite$1, null, React__default.createElement(SpriteFromAtlas, {
|
|
47678
|
-
atlasIMG: characterAtlasIMG,
|
|
47679
|
-
atlasJSON: characterAtlasJSON,
|
|
47680
|
-
spriteKey: listing.characterSnapshot.textureKey + "/down/standing/0.png",
|
|
47681
|
-
imgScale: 3,
|
|
47682
|
-
height: 64,
|
|
47683
|
-
width: 64,
|
|
47684
|
-
centered: true
|
|
47685
|
-
})), React__default.createElement(CharacterInfo$1, null, React__default.createElement(CharacterName$3, null, listing.characterSnapshot.name || 'Unknown'), React__default.createElement(CharacterMeta$1, null, "Level ", listing.characterSnapshot.level), React__default.createElement(ListingPrice$1, null, React__default.createElement(DCCoinWrapper$4, null, React__default.createElement(SpriteFromAtlas, {
|
|
47686
|
-
atlasIMG: atlasIMG,
|
|
47687
|
-
atlasJSON: atlasJSON,
|
|
47688
|
-
spriteKey: "others/definya-coin.png",
|
|
47689
|
-
imgScale: 1,
|
|
47690
|
-
centered: true
|
|
47691
|
-
})), shared.formatDCAmount(listing.price), " DC"), React__default.createElement(ListingMeta, null, "Listed ", getFormattedDate(listing.createdAt)), listing.isBeingBought && React__default.createElement(ListingStatus, {
|
|
47692
|
-
"$status": "pending"
|
|
47693
|
-
}, "Sale Pending")), React__default.createElement(ActionButton, {
|
|
47694
|
-
icon: React__default.createElement(Delete.Delete, {
|
|
47695
|
-
width: 16,
|
|
47696
|
-
height: 16
|
|
47697
|
-
}),
|
|
47698
|
-
label: "Delist",
|
|
47699
|
-
onClick: function onClick() {
|
|
47700
|
-
return handleDelistClick(listing._id);
|
|
47701
|
-
},
|
|
47702
|
-
iconColor: "#ef4444",
|
|
47703
|
-
disabled: listing.isBeingBought
|
|
47704
|
-
}));
|
|
47705
|
-
}))), totalCount > itemsPerPage && React__default.createElement(PagerFooter$2, null, React__default.createElement(Pagination$1, null, Array.from({
|
|
47706
|
-
length: Math.ceil(totalCount / itemsPerPage)
|
|
47707
|
-
}, function (_, i) {
|
|
47708
|
-
return i + 1;
|
|
47709
|
-
}).map(function (page) {
|
|
47710
|
-
return React__default.createElement(PageButton, {
|
|
47711
|
-
key: page,
|
|
47712
|
-
"$active": currentPage === page,
|
|
47713
|
-
type: "button",
|
|
47714
|
-
onClick: function onClick() {
|
|
47715
|
-
return onPageChange(page);
|
|
47716
|
-
}
|
|
47717
|
-
}, page);
|
|
47718
|
-
}))));
|
|
47719
|
-
};
|
|
47720
|
-
var ListingsContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47721
|
-
displayName: "MyCharacterListingsPanel__ListingsContainer",
|
|
47722
|
-
componentId: "sc-su21a6-0"
|
|
47723
|
-
})(["overflow-y:scroll;overflow-x:hidden;height:390px;width:95%;margin:1rem auto 0 auto;background:rgba(0,0,0,0.2);border:1px solid rgba(255,255,255,0.05);border-radius:4px;@media (max-width:950px){height:250px;}"]);
|
|
47724
|
-
var ListingsGrid$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47725
|
-
displayName: "MyCharacterListingsPanel__ListingsGrid",
|
|
47726
|
-
componentId: "sc-su21a6-1"
|
|
47727
|
-
})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;padding:12px;"]);
|
|
47728
|
-
var CharacterListingCard$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47729
|
-
displayName: "MyCharacterListingsPanel__CharacterListingCard",
|
|
47730
|
-
componentId: "sc-su21a6-2"
|
|
47731
|
-
})(["display:flex;flex-direction:column;align-items:center;gap:8px;background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.08);border-radius:8px;padding:12px;"]);
|
|
47732
|
-
var CharacterSprite$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47733
|
-
displayName: "MyCharacterListingsPanel__CharacterSprite",
|
|
47734
|
-
componentId: "sc-su21a6-3"
|
|
47735
|
-
})(["display:flex;align-items:center;justify-content:center;image-rendering:pixelated;"]);
|
|
47736
|
-
var CharacterInfo$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47737
|
-
displayName: "MyCharacterListingsPanel__CharacterInfo",
|
|
47738
|
-
componentId: "sc-su21a6-4"
|
|
47739
|
-
})(["display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;"]);
|
|
47740
|
-
var CharacterName$3 = /*#__PURE__*/styled__default.span.withConfig({
|
|
47741
|
-
displayName: "MyCharacterListingsPanel__CharacterName",
|
|
47742
|
-
componentId: "sc-su21a6-5"
|
|
47743
|
-
})(["font-family:'Press Start 2P',cursive;font-size:0.55rem;color:#f3f4f6;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
47744
|
-
var CharacterMeta$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
47745
|
-
displayName: "MyCharacterListingsPanel__CharacterMeta",
|
|
47746
|
-
componentId: "sc-su21a6-6"
|
|
47747
|
-
})(["font-size:0.45rem;color:#888;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
47748
|
-
var ListingPrice$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47749
|
-
displayName: "MyCharacterListingsPanel__ListingPrice",
|
|
47750
|
-
componentId: "sc-su21a6-7"
|
|
47751
|
-
})(["display:flex;align-items:center;gap:6px;font-family:'Press Start 2P',cursive;font-size:0.5rem;color:#fef08a;"]);
|
|
47752
|
-
var DCCoinWrapper$4 = /*#__PURE__*/styled__default.span.withConfig({
|
|
47753
|
-
displayName: "MyCharacterListingsPanel__DCCoinWrapper",
|
|
47754
|
-
componentId: "sc-su21a6-8"
|
|
47755
|
-
})(["display:flex;align-items:center;justify-content:center;flex-shrink:0;"]);
|
|
47756
|
-
var ListingMeta = /*#__PURE__*/styled__default.span.withConfig({
|
|
47757
|
-
displayName: "MyCharacterListingsPanel__ListingMeta",
|
|
47758
|
-
componentId: "sc-su21a6-9"
|
|
47759
|
-
})(["font-size:0.38rem;color:#52525b;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
47760
|
-
var ListingStatus = /*#__PURE__*/styled__default.span.withConfig({
|
|
47761
|
-
displayName: "MyCharacterListingsPanel__ListingStatus",
|
|
47762
|
-
componentId: "sc-su21a6-10"
|
|
47763
|
-
})(["font-size:0.38rem;padding:2px 6px;border-radius:4px;text-transform:uppercase;letter-spacing:0.5px;", ""], function (_ref2) {
|
|
47764
|
-
var $status = _ref2.$status;
|
|
47765
|
-
return $status === 'pending' ? "\n background: rgba(239, 68, 68, 0.2);\n border: 1px solid rgba(239, 68, 68, 0.4);\n color: #ef4444;\n " : "\n background: rgba(34, 197, 94, 0.2);\n border: 1px solid rgba(34, 197, 94, 0.4);\n color: #22c55e;\n ";
|
|
47766
|
-
});
|
|
47767
|
-
var ActionButton = /*#__PURE__*/styled__default(CTAButton).withConfig({
|
|
47768
|
-
displayName: "MyCharacterListingsPanel__ActionButton",
|
|
47769
|
-
componentId: "sc-su21a6-11"
|
|
47770
|
-
})(["padding:6px 12px;height:28px;opacity:", ";pointer-events:", ";span{font-size:0.5rem;}svg{font-size:1rem;}"], function (_ref3) {
|
|
47771
|
-
var disabled = _ref3.disabled;
|
|
47772
|
-
return disabled ? 0.5 : 1;
|
|
47773
|
-
}, function (_ref4) {
|
|
47774
|
-
var disabled = _ref4.disabled;
|
|
47775
|
-
return disabled ? 'none' : 'auto';
|
|
47776
|
-
});
|
|
47777
|
-
var PagerFooter$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47778
|
-
displayName: "MyCharacterListingsPanel__PagerFooter",
|
|
47779
|
-
componentId: "sc-su21a6-12"
|
|
47780
|
-
})(["display:flex;justify-content:center;align-items:center;padding:8px 0 4px;min-height:36px;width:95%;margin:0 auto;"]);
|
|
47781
|
-
var Pagination$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47782
|
-
displayName: "MyCharacterListingsPanel__Pagination",
|
|
47783
|
-
componentId: "sc-su21a6-13"
|
|
47784
|
-
})(["display:flex;gap:6px;"]);
|
|
47785
|
-
var PageButton = /*#__PURE__*/styled__default.button.withConfig({
|
|
47786
|
-
displayName: "MyCharacterListingsPanel__PageButton",
|
|
47787
|
-
componentId: "sc-su21a6-14"
|
|
47788
|
-
})(["padding:6px 10px;font-family:'Press Start 2P',cursive;font-size:0.5rem;border-radius:4px;border:1px solid ", ";background:", ";color:", ";cursor:pointer;transition:border-color 0.15s,background 0.15s,color 0.15s;&:hover{border-color:", ";color:", ";}"], function (_ref5) {
|
|
47789
|
-
var $active = _ref5.$active;
|
|
47790
|
-
return $active ? '#f59e0b' : 'rgba(255,255,255,0.12)';
|
|
47791
|
-
}, function (_ref6) {
|
|
47792
|
-
var $active = _ref6.$active;
|
|
47793
|
-
return $active ? 'rgba(245,158,11,0.15)' : 'rgba(0,0,0,0.3)';
|
|
47794
|
-
}, function (_ref7) {
|
|
47795
|
-
var $active = _ref7.$active;
|
|
47796
|
-
return $active ? '#f59e0b' : '#777';
|
|
47797
|
-
}, function (_ref8) {
|
|
47798
|
-
var $active = _ref8.$active;
|
|
47799
|
-
return $active ? '#f59e0b' : 'rgba(255,255,255,0.3)';
|
|
47800
|
-
}, function (_ref9) {
|
|
47801
|
-
var $active = _ref9.$active;
|
|
47802
|
-
return $active ? '#f59e0b' : '#bbb';
|
|
47803
|
-
});
|
|
47804
|
-
var EmptyState$6 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47805
|
-
displayName: "MyCharacterListingsPanel__EmptyState",
|
|
47806
|
-
componentId: "sc-su21a6-15"
|
|
47807
|
-
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:100%;min-height:200px;"]);
|
|
47808
|
-
var EmptyText$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
47809
|
-
displayName: "MyCharacterListingsPanel__EmptyText",
|
|
47810
|
-
componentId: "sc-su21a6-16"
|
|
47811
|
-
})(["font-size:0.55rem;color:#71717a;text-transform:uppercase;letter-spacing:1px;"]);
|
|
47812
|
-
var EmptySubtext = /*#__PURE__*/styled__default.span.withConfig({
|
|
47813
|
-
displayName: "MyCharacterListingsPanel__EmptySubtext",
|
|
47814
|
-
componentId: "sc-su21a6-17"
|
|
47815
|
-
})(["font-size:0.45rem;color:#52525b;text-transform:none;letter-spacing:0.5px;text-align:center;max-width:280px;"]);
|
|
47816
|
-
|
|
47817
47628
|
var CharacterListingModal = function CharacterListingModal(_ref) {
|
|
47818
47629
|
var isOpen = _ref.isOpen,
|
|
47819
47630
|
onClose = _ref.onClose,
|
|
@@ -47881,7 +47692,7 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
|
|
|
47881
47692
|
onPointerDown: handleClose,
|
|
47882
47693
|
"aria-label": "Close",
|
|
47883
47694
|
type: "button"
|
|
47884
|
-
}, React__default.createElement(fa.FaTimes, null))), React__default.createElement(CharacterList$1, null, eligibleCharacters.length === 0 ? React__default.createElement(EmptyState$
|
|
47695
|
+
}, React__default.createElement(fa.FaTimes, null))), React__default.createElement(CharacterList$1, null, eligibleCharacters.length === 0 ? React__default.createElement(EmptyState$6, null, "No eligible characters to list.") : eligibleCharacters.map(function (character) {
|
|
47885
47696
|
var isSelected = selectedId === character._id;
|
|
47886
47697
|
return React__default.createElement(CharacterRow, {
|
|
47887
47698
|
key: character._id,
|
|
@@ -47907,7 +47718,7 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
|
|
|
47907
47718
|
imgScale: 2,
|
|
47908
47719
|
height: 40,
|
|
47909
47720
|
width: 40
|
|
47910
|
-
})), React__default.createElement(CharacterInfo$
|
|
47721
|
+
})), React__default.createElement(CharacterInfo$1, null, React__default.createElement(CharacterName$3, null, character.name || 'Unknown'), React__default.createElement(CharacterMeta$1, null, "Level ", getLevel(character))));
|
|
47911
47722
|
})), React__default.createElement(PriceSection$1, null, React__default.createElement(PriceLabel, null, "Set Price (DC)"), React__default.createElement(PriceRow$1, null, React__default.createElement(Input, {
|
|
47912
47723
|
onChange: function onChange(e) {
|
|
47913
47724
|
return setPrice(e.target.value);
|
|
@@ -47927,7 +47738,7 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
|
|
|
47927
47738
|
label: "List",
|
|
47928
47739
|
disabled: !canList,
|
|
47929
47740
|
onClick: handleListClick
|
|
47930
|
-
})), price && Number(price) > 0 && React__default.createElement(PricePreview, null, React__default.createElement(DCCoinWrapper$
|
|
47741
|
+
})), price && Number(price) > 0 && React__default.createElement(PricePreview, null, React__default.createElement(DCCoinWrapper$4, null, React__default.createElement(SpriteFromAtlas, {
|
|
47931
47742
|
atlasIMG: atlasIMG,
|
|
47932
47743
|
atlasJSON: atlasJSON,
|
|
47933
47744
|
spriteKey: "others/definya-coin.png",
|
|
@@ -47994,15 +47805,15 @@ var SpriteWrapper$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
47994
47805
|
displayName: "CharacterListingModal__SpriteWrapper",
|
|
47995
47806
|
componentId: "sc-1uxkx35-9"
|
|
47996
47807
|
})(["display:flex;align-items:center;justify-content:center;image-rendering:pixelated;flex-shrink:0;width:40px;height:40px;"]);
|
|
47997
|
-
var CharacterInfo$
|
|
47808
|
+
var CharacterInfo$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47998
47809
|
displayName: "CharacterListingModal__CharacterInfo",
|
|
47999
47810
|
componentId: "sc-1uxkx35-10"
|
|
48000
47811
|
})(["display:flex;flex-direction:column;gap:4px;flex:1;"]);
|
|
48001
|
-
var CharacterName$
|
|
47812
|
+
var CharacterName$3 = /*#__PURE__*/styled__default.span.withConfig({
|
|
48002
47813
|
displayName: "CharacterListingModal__CharacterName",
|
|
48003
47814
|
componentId: "sc-1uxkx35-11"
|
|
48004
47815
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.5rem !important;color:#f3f4f6 !important;"]);
|
|
48005
|
-
var CharacterMeta$
|
|
47816
|
+
var CharacterMeta$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
48006
47817
|
displayName: "CharacterListingModal__CharacterMeta",
|
|
48007
47818
|
componentId: "sc-1uxkx35-12"
|
|
48008
47819
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.4rem !important;color:#888 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
@@ -48010,7 +47821,7 @@ var PricePreview = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
48010
47821
|
displayName: "CharacterListingModal__PricePreview",
|
|
48011
47822
|
componentId: "sc-1uxkx35-13"
|
|
48012
47823
|
})(["display:flex;align-items:center;gap:6px;"]);
|
|
48013
|
-
var DCCoinWrapper$
|
|
47824
|
+
var DCCoinWrapper$4 = /*#__PURE__*/styled__default.span.withConfig({
|
|
48014
47825
|
displayName: "CharacterListingModal__DCCoinWrapper",
|
|
48015
47826
|
componentId: "sc-1uxkx35-14"
|
|
48016
47827
|
})(["display:flex;align-items:center;justify-content:center;flex-shrink:0;"]);
|
|
@@ -48034,11 +47845,205 @@ var ListBtn = /*#__PURE__*/styled__default(CTAButton).withConfig({
|
|
|
48034
47845
|
displayName: "CharacterListingModal__ListBtn",
|
|
48035
47846
|
componentId: "sc-1uxkx35-19"
|
|
48036
47847
|
})(["flex-shrink:0;padding:10px 16px;height:32px;span{font-size:0.6rem;}svg{font-size:1.1rem;}"]);
|
|
48037
|
-
var EmptyState$
|
|
47848
|
+
var EmptyState$6 = /*#__PURE__*/styled__default.div.withConfig({
|
|
48038
47849
|
displayName: "CharacterListingModal__EmptyState",
|
|
48039
47850
|
componentId: "sc-1uxkx35-20"
|
|
48040
47851
|
})(["display:flex;align-items:center;justify-content:center;padding:32px 16px;font-family:'Press Start 2P',cursive !important;font-size:0.5rem !important;color:#666 !important;text-transform:uppercase;letter-spacing:1px;"]);
|
|
48041
47852
|
|
|
47853
|
+
var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
|
|
47854
|
+
var myCharacterListings = _ref.myCharacterListings,
|
|
47855
|
+
totalCount = _ref.totalCount,
|
|
47856
|
+
currentPage = _ref.currentPage,
|
|
47857
|
+
itemsPerPage = _ref.itemsPerPage,
|
|
47858
|
+
onPageChange = _ref.onPageChange,
|
|
47859
|
+
onCharacterDelist = _ref.onCharacterDelist,
|
|
47860
|
+
accountCharacters = _ref.accountCharacters,
|
|
47861
|
+
_onCharacterList = _ref.onCharacterList,
|
|
47862
|
+
atlasJSON = _ref.atlasJSON,
|
|
47863
|
+
atlasIMG = _ref.atlasIMG,
|
|
47864
|
+
characterAtlasJSON = _ref.characterAtlasJSON,
|
|
47865
|
+
characterAtlasIMG = _ref.characterAtlasIMG,
|
|
47866
|
+
enableHotkeys = _ref.enableHotkeys,
|
|
47867
|
+
disableHotkeys = _ref.disableHotkeys;
|
|
47868
|
+
var _useState = React.useState(null),
|
|
47869
|
+
delistingId = _useState[0],
|
|
47870
|
+
setDelistingId = _useState[1];
|
|
47871
|
+
var _useState2 = React.useState(false),
|
|
47872
|
+
isListingModalOpen = _useState2[0],
|
|
47873
|
+
setIsListingModalOpen = _useState2[1];
|
|
47874
|
+
var itemsContainer = React.useRef(null);
|
|
47875
|
+
React.useEffect(function () {
|
|
47876
|
+
var _itemsContainer$curre;
|
|
47877
|
+
(_itemsContainer$curre = itemsContainer.current) == null ? void 0 : _itemsContainer$curre.scrollTo(0, 0);
|
|
47878
|
+
}, [currentPage]);
|
|
47879
|
+
var handleDelistConfirm = function handleDelistConfirm() {
|
|
47880
|
+
if (delistingId) {
|
|
47881
|
+
onCharacterDelist(delistingId);
|
|
47882
|
+
setDelistingId(null);
|
|
47883
|
+
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
47884
|
+
}
|
|
47885
|
+
};
|
|
47886
|
+
var eligibleCount = accountCharacters.filter(function (c) {
|
|
47887
|
+
return !c.isListedForSale && !c.tradedAt;
|
|
47888
|
+
}).length;
|
|
47889
|
+
return React__default.createElement(React__default.Fragment, null, delistingId && React__default.createElement(ConfirmModal, {
|
|
47890
|
+
onClose: function onClose() {
|
|
47891
|
+
setDelistingId(null);
|
|
47892
|
+
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
47893
|
+
},
|
|
47894
|
+
onConfirm: handleDelistConfirm,
|
|
47895
|
+
message: "Are you sure you want to delist this character?"
|
|
47896
|
+
}), React__default.createElement(CharacterListingModal, {
|
|
47897
|
+
isOpen: isListingModalOpen,
|
|
47898
|
+
onClose: function onClose() {
|
|
47899
|
+
return setIsListingModalOpen(false);
|
|
47900
|
+
},
|
|
47901
|
+
accountCharacters: accountCharacters,
|
|
47902
|
+
atlasJSON: atlasJSON,
|
|
47903
|
+
atlasIMG: atlasIMG,
|
|
47904
|
+
characterAtlasJSON: characterAtlasJSON,
|
|
47905
|
+
characterAtlasIMG: characterAtlasIMG,
|
|
47906
|
+
onCharacterList: function onCharacterList(id, price) {
|
|
47907
|
+
_onCharacterList(id, price);
|
|
47908
|
+
setIsListingModalOpen(false);
|
|
47909
|
+
},
|
|
47910
|
+
enableHotkeys: enableHotkeys,
|
|
47911
|
+
disableHotkeys: disableHotkeys
|
|
47912
|
+
}), React__default.createElement(Toolbar, null, React__default.createElement(ListCharacterBtn, {
|
|
47913
|
+
icon: React__default.createElement(ShoppingBag.ShoppingBag, {
|
|
47914
|
+
width: 16,
|
|
47915
|
+
height: 16
|
|
47916
|
+
}),
|
|
47917
|
+
label: "List a Character" + (eligibleCount > 0 ? " (" + eligibleCount + " eligible)" : ''),
|
|
47918
|
+
onClick: function onClick() {
|
|
47919
|
+
return setIsListingModalOpen(true);
|
|
47920
|
+
},
|
|
47921
|
+
disabled: eligibleCount === 0
|
|
47922
|
+
})), React__default.createElement(ListingsContainer$1, {
|
|
47923
|
+
ref: itemsContainer
|
|
47924
|
+
}, myCharacterListings.length === 0 ? React__default.createElement(EmptyState$7, null, React__default.createElement(User.User, {
|
|
47925
|
+
width: 32,
|
|
47926
|
+
height: 32
|
|
47927
|
+
}), React__default.createElement(EmptyText$1, null, "No listed characters."), React__default.createElement(EmptySubtext, null, "Use the \"List Character\" tab to put a character up for sale.")) : React__default.createElement(ListingsGrid$1, null, myCharacterListings.map(function (listing) {
|
|
47928
|
+
return React__default.createElement(CharacterListingCard$1, {
|
|
47929
|
+
key: listing._id,
|
|
47930
|
+
"$isBeingBought": listing.isBeingBought
|
|
47931
|
+
}, React__default.createElement(CharacterSprite$1, null, React__default.createElement(SpriteFromAtlas, {
|
|
47932
|
+
atlasIMG: characterAtlasIMG,
|
|
47933
|
+
atlasJSON: characterAtlasJSON,
|
|
47934
|
+
spriteKey: listing.characterSnapshot.textureKey + "/down/standing/0.png",
|
|
47935
|
+
imgScale: 3,
|
|
47936
|
+
height: 64,
|
|
47937
|
+
width: 64,
|
|
47938
|
+
centered: true
|
|
47939
|
+
})), React__default.createElement(CharacterInfo$2, null, React__default.createElement(CharacterName$4, null, listing.characterSnapshot.name || 'Unknown'), React__default.createElement(CharacterMeta$2, null, "Lv.", listing.characterSnapshot.level, " \xB7 ", listing.characterSnapshot["class"]), React__default.createElement(ListingPrice$1, null, React__default.createElement(DCCoinWrapper$5, null, React__default.createElement(SpriteFromAtlas, {
|
|
47940
|
+
atlasIMG: atlasIMG,
|
|
47941
|
+
atlasJSON: atlasJSON,
|
|
47942
|
+
spriteKey: "others/definya-coin.png",
|
|
47943
|
+
imgScale: 1,
|
|
47944
|
+
centered: true
|
|
47945
|
+
})), shared.formatDCAmount(listing.price), " DC"), React__default.createElement(ListingDate, null, "Listed ", new Date(listing.createdAt).toLocaleDateString())), React__default.createElement(DelistBtn, {
|
|
47946
|
+
icon: React__default.createElement(Delete.Delete, {
|
|
47947
|
+
width: 14,
|
|
47948
|
+
height: 14
|
|
47949
|
+
}),
|
|
47950
|
+
label: "Delist",
|
|
47951
|
+
onClick: function onClick() {
|
|
47952
|
+
return setDelistingId(listing._id);
|
|
47953
|
+
},
|
|
47954
|
+
disabled: listing.isBeingBought
|
|
47955
|
+
}), listing.isBeingBought && React__default.createElement(PendingBadge, null, "Pending"));
|
|
47956
|
+
}))), totalCount > itemsPerPage && React__default.createElement(PagerFooter$2, null, React__default.createElement(Pagination, {
|
|
47957
|
+
currentPage: currentPage,
|
|
47958
|
+
totalPages: Math.ceil(totalCount / itemsPerPage),
|
|
47959
|
+
onPageChange: onPageChange
|
|
47960
|
+
})));
|
|
47961
|
+
};
|
|
47962
|
+
var ListingsContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47963
|
+
displayName: "MyCharacterListingsPanel__ListingsContainer",
|
|
47964
|
+
componentId: "sc-su21a6-0"
|
|
47965
|
+
})(["overflow-y:scroll;overflow-x:hidden;height:390px;width:95%;margin:1rem auto 0 auto;background:rgba(0,0,0,0.2);border:1px solid rgba(255,255,255,0.05);border-radius:4px;@media (max-width:950px){height:250px;}"]);
|
|
47966
|
+
var ListingsGrid$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47967
|
+
displayName: "MyCharacterListingsPanel__ListingsGrid",
|
|
47968
|
+
componentId: "sc-su21a6-1"
|
|
47969
|
+
})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;padding:12px;"]);
|
|
47970
|
+
var CharacterListingCard$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47971
|
+
displayName: "MyCharacterListingsPanel__CharacterListingCard",
|
|
47972
|
+
componentId: "sc-su21a6-2"
|
|
47973
|
+
})(["display:flex;flex-direction:column;align-items:center;gap:8px;background:rgba(255,255,255,0.03);border:1px solid ", ";border-radius:8px;padding:12px;position:relative;opacity:", ";transition:border-color 0.15s,background 0.15s;&:hover{border-color:", ";background:", ";}"], function (_ref2) {
|
|
47974
|
+
var $isBeingBought = _ref2.$isBeingBought;
|
|
47975
|
+
return $isBeingBought ? 'rgba(239,68,68,0.3)' : 'rgba(255,255,255,0.08)';
|
|
47976
|
+
}, function (_ref3) {
|
|
47977
|
+
var $isBeingBought = _ref3.$isBeingBought;
|
|
47978
|
+
return $isBeingBought ? 0.7 : 1;
|
|
47979
|
+
}, function (_ref4) {
|
|
47980
|
+
var $isBeingBought = _ref4.$isBeingBought;
|
|
47981
|
+
return $isBeingBought ? 'rgba(239,68,68,0.5)' : 'rgba(245,158,11,0.3)';
|
|
47982
|
+
}, function (_ref5) {
|
|
47983
|
+
var $isBeingBought = _ref5.$isBeingBought;
|
|
47984
|
+
return $isBeingBought ? 'rgba(239,68,68,0.04)' : 'rgba(245,158,11,0.04)';
|
|
47985
|
+
});
|
|
47986
|
+
var CharacterSprite$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47987
|
+
displayName: "MyCharacterListingsPanel__CharacterSprite",
|
|
47988
|
+
componentId: "sc-su21a6-3"
|
|
47989
|
+
})(["display:flex;align-items:center;justify-content:center;image-rendering:pixelated;width:64px;height:64px;flex-shrink:0;"]);
|
|
47990
|
+
var CharacterInfo$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
47991
|
+
displayName: "MyCharacterListingsPanel__CharacterInfo",
|
|
47992
|
+
componentId: "sc-su21a6-4"
|
|
47993
|
+
})(["display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;width:100%;"]);
|
|
47994
|
+
var CharacterName$4 = /*#__PURE__*/styled__default.span.withConfig({
|
|
47995
|
+
displayName: "MyCharacterListingsPanel__CharacterName",
|
|
47996
|
+
componentId: "sc-su21a6-5"
|
|
47997
|
+
})(["font-family:'Press Start 2P',cursive !important;font-size:0.55rem !important;color:#f3f4f6 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
47998
|
+
var CharacterMeta$2 = /*#__PURE__*/styled__default.span.withConfig({
|
|
47999
|
+
displayName: "MyCharacterListingsPanel__CharacterMeta",
|
|
48000
|
+
componentId: "sc-su21a6-6"
|
|
48001
|
+
})(["font-family:'Press Start 2P',cursive !important;font-size:0.45rem !important;color:#888 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
48002
|
+
var ListingPrice$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
48003
|
+
displayName: "MyCharacterListingsPanel__ListingPrice",
|
|
48004
|
+
componentId: "sc-su21a6-7"
|
|
48005
|
+
})(["display:flex;align-items:center;justify-content:center;gap:4px;font-family:'Press Start 2P',cursive !important;font-size:0.5rem !important;color:#fef08a !important;line-height:1;"]);
|
|
48006
|
+
var DCCoinWrapper$5 = /*#__PURE__*/styled__default.span.withConfig({
|
|
48007
|
+
displayName: "MyCharacterListingsPanel__DCCoinWrapper",
|
|
48008
|
+
componentId: "sc-su21a6-8"
|
|
48009
|
+
})(["display:flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0;"]);
|
|
48010
|
+
var ListingDate = /*#__PURE__*/styled__default.span.withConfig({
|
|
48011
|
+
displayName: "MyCharacterListingsPanel__ListingDate",
|
|
48012
|
+
componentId: "sc-su21a6-9"
|
|
48013
|
+
})(["font-family:'Press Start 2P',cursive !important;font-size:0.35rem !important;color:#52525b !important;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
48014
|
+
var DelistBtn = /*#__PURE__*/styled__default(CTAButton).withConfig({
|
|
48015
|
+
displayName: "MyCharacterListingsPanel__DelistBtn",
|
|
48016
|
+
componentId: "sc-su21a6-10"
|
|
48017
|
+
})(["width:100%;padding:6px 10px;height:28px;margin-top:2px;span{font-size:0.48rem;}svg{font-size:0.9rem;}"]);
|
|
48018
|
+
var PendingBadge = /*#__PURE__*/styled__default.span.withConfig({
|
|
48019
|
+
displayName: "MyCharacterListingsPanel__PendingBadge",
|
|
48020
|
+
componentId: "sc-su21a6-11"
|
|
48021
|
+
})(["position:absolute;top:6px;right:6px;background:rgba(239,68,68,0.2);border:1px solid rgba(239,68,68,0.4);border-radius:4px;padding:2px 6px;font-family:'Press Start 2P',cursive !important;font-size:0.35rem !important;color:#ef4444 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
48022
|
+
var Toolbar = /*#__PURE__*/styled__default.div.withConfig({
|
|
48023
|
+
displayName: "MyCharacterListingsPanel__Toolbar",
|
|
48024
|
+
componentId: "sc-su21a6-12"
|
|
48025
|
+
})(["width:95%;margin:10px auto 0 auto;display:flex;justify-content:flex-end;"]);
|
|
48026
|
+
var ListCharacterBtn = /*#__PURE__*/styled__default(CTAButton).withConfig({
|
|
48027
|
+
displayName: "MyCharacterListingsPanel__ListCharacterBtn",
|
|
48028
|
+
componentId: "sc-su21a6-13"
|
|
48029
|
+
})(["padding:8px 16px;height:32px;span{font-size:0.5rem;}svg{font-size:1rem;}"]);
|
|
48030
|
+
var PagerFooter$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
48031
|
+
displayName: "MyCharacterListingsPanel__PagerFooter",
|
|
48032
|
+
componentId: "sc-su21a6-14"
|
|
48033
|
+
})(["display:flex;justify-content:center;align-items:center;padding:8px 0 4px;min-height:36px;width:95%;margin:0 auto;"]);
|
|
48034
|
+
var EmptyState$7 = /*#__PURE__*/styled__default.div.withConfig({
|
|
48035
|
+
displayName: "MyCharacterListingsPanel__EmptyState",
|
|
48036
|
+
componentId: "sc-su21a6-15"
|
|
48037
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:100%;min-height:200px;"]);
|
|
48038
|
+
var EmptyText$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
48039
|
+
displayName: "MyCharacterListingsPanel__EmptyText",
|
|
48040
|
+
componentId: "sc-su21a6-16"
|
|
48041
|
+
})(["font-family:'Press Start 2P',cursive !important;font-size:0.48rem !important;color:#71717a !important;text-transform:uppercase;letter-spacing:1px;"]);
|
|
48042
|
+
var EmptySubtext = /*#__PURE__*/styled__default.span.withConfig({
|
|
48043
|
+
displayName: "MyCharacterListingsPanel__EmptySubtext",
|
|
48044
|
+
componentId: "sc-su21a6-17"
|
|
48045
|
+
})(["font-family:'Press Start 2P',cursive !important;font-size:0.38rem !important;color:#52525b !important;text-align:center;max-width:260px;line-height:1.6;"]);
|
|
48046
|
+
|
|
48042
48047
|
var CharacterListingForm = function CharacterListingForm(_ref) {
|
|
48043
48048
|
var accountCharacters = _ref.accountCharacters,
|
|
48044
48049
|
onCharacterList = _ref.onCharacterList,
|
|
@@ -48306,6 +48311,8 @@ var Marketplace = function Marketplace(props) {
|
|
|
48306
48311
|
itemsPerPage: 10,
|
|
48307
48312
|
onPageChange: onMyCharacterListingsPageChange != null ? onMyCharacterListingsPageChange : function () {},
|
|
48308
48313
|
onCharacterDelist: onCharacterDelist != null ? onCharacterDelist : function () {},
|
|
48314
|
+
accountCharacters: accountCharacters != null ? accountCharacters : [],
|
|
48315
|
+
onCharacterList: onCharacterList != null ? onCharacterList : function () {},
|
|
48309
48316
|
atlasJSON: props.atlasJSON,
|
|
48310
48317
|
atlasIMG: props.atlasIMG,
|
|
48311
48318
|
characterAtlasJSON: characterAtlasJSON != null ? characterAtlasJSON : props.atlasJSON,
|
|
@@ -48435,7 +48442,7 @@ var CharacterMarketplaceRows = function CharacterMarketplaceRows(_ref) {
|
|
|
48435
48442
|
atlasJSON: atlasJSON,
|
|
48436
48443
|
spriteKey: "others/definya-coin.png",
|
|
48437
48444
|
imgScale: 1
|
|
48438
|
-
})), React__default.createElement(DCPrice$2, null, shared.formatDCAmount(price))), isBeingBought && React__default.createElement(PendingBadge, null, "Sale Pending"))), React__default.createElement(ActionSection$2, null, React__default.createElement(CTAButton, {
|
|
48445
|
+
})), React__default.createElement(DCPrice$2, null, shared.formatDCAmount(price))), isBeingBought && React__default.createElement(PendingBadge$1, null, "Sale Pending"))), React__default.createElement(ActionSection$2, null, React__default.createElement(CTAButton, {
|
|
48439
48446
|
icon: onCharacterBuy ? React__default.createElement(Coins.Coins, {
|
|
48440
48447
|
width: 18,
|
|
48441
48448
|
height: 18
|
|
@@ -48494,7 +48501,7 @@ var ActionSection$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
48494
48501
|
displayName: "CharacterMarketplaceRows__ActionSection",
|
|
48495
48502
|
componentId: "sc-1pxkdig-10"
|
|
48496
48503
|
})(["flex-shrink:0;margin-left:0.75rem;"]);
|
|
48497
|
-
var PendingBadge = /*#__PURE__*/styled__default.span.withConfig({
|
|
48504
|
+
var PendingBadge$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
48498
48505
|
displayName: "CharacterMarketplaceRows__PendingBadge",
|
|
48499
48506
|
componentId: "sc-1pxkdig-11"
|
|
48500
48507
|
})(["font-size:0.38rem;padding:2px 6px;border-radius:4px;text-transform:uppercase;letter-spacing:0.5px;background:rgba(239,68,68,0.2);border:1px solid rgba(239,68,68,0.4);color:#ef4444;margin-top:4px;"]);
|