@rpg-engine/long-bow 0.8.188 → 0.8.190
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 +238 -246
- 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 +238 -246
- 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 -20
- 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,67 +47845,204 @@ 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
|
|
|
48042
|
-
var
|
|
48043
|
-
var
|
|
48044
|
-
|
|
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,
|
|
48045
47862
|
atlasJSON = _ref.atlasJSON,
|
|
48046
47863
|
atlasIMG = _ref.atlasIMG,
|
|
48047
47864
|
characterAtlasJSON = _ref.characterAtlasJSON,
|
|
48048
47865
|
characterAtlasIMG = _ref.characterAtlasIMG,
|
|
48049
47866
|
enableHotkeys = _ref.enableHotkeys,
|
|
48050
47867
|
disableHotkeys = _ref.disableHotkeys;
|
|
48051
|
-
var _useState = React.useState(
|
|
48052
|
-
|
|
48053
|
-
|
|
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
|
+
};
|
|
48054
47886
|
var eligibleCount = accountCharacters.filter(function (c) {
|
|
48055
47887
|
return !c.isListedForSale && !c.tradedAt;
|
|
48056
47888
|
}).length;
|
|
48057
|
-
return React__default.createElement(
|
|
48058
|
-
isOpen: isModalOpen,
|
|
47889
|
+
return React__default.createElement(React__default.Fragment, null, delistingId && React__default.createElement(ConfirmModal, {
|
|
48059
47890
|
onClose: function onClose() {
|
|
48060
|
-
|
|
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);
|
|
48061
47900
|
},
|
|
48062
47901
|
accountCharacters: accountCharacters,
|
|
48063
47902
|
atlasJSON: atlasJSON,
|
|
48064
47903
|
atlasIMG: atlasIMG,
|
|
48065
47904
|
characterAtlasJSON: characterAtlasJSON,
|
|
48066
47905
|
characterAtlasIMG: characterAtlasIMG,
|
|
48067
|
-
onCharacterList: onCharacterList,
|
|
47906
|
+
onCharacterList: function onCharacterList(id, price) {
|
|
47907
|
+
_onCharacterList(id, price);
|
|
47908
|
+
setIsListingModalOpen(false);
|
|
47909
|
+
},
|
|
48068
47910
|
enableHotkeys: enableHotkeys,
|
|
48069
47911
|
disableHotkeys: disableHotkeys
|
|
48070
|
-
}), React__default.createElement(
|
|
47912
|
+
}), React__default.createElement(Toolbar, null, React__default.createElement(ListCharacterBtn, {
|
|
48071
47913
|
icon: React__default.createElement(ShoppingBag.ShoppingBag, {
|
|
48072
|
-
width:
|
|
48073
|
-
height:
|
|
47914
|
+
width: 16,
|
|
47915
|
+
height: 16
|
|
48074
47916
|
}),
|
|
48075
47917
|
label: "List a Character" + (eligibleCount > 0 ? " (" + eligibleCount + " eligible)" : ''),
|
|
48076
|
-
disabled: eligibleCount === 0,
|
|
48077
47918
|
onClick: function onClick() {
|
|
48078
|
-
return
|
|
48079
|
-
}
|
|
48080
|
-
|
|
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
|
+
})));
|
|
48081
47961
|
};
|
|
48082
|
-
var
|
|
48083
|
-
displayName: "
|
|
48084
|
-
componentId: "sc-
|
|
48085
|
-
})(["
|
|
48086
|
-
var
|
|
48087
|
-
displayName: "
|
|
48088
|
-
componentId: "sc-
|
|
48089
|
-
})(["
|
|
48090
|
-
var
|
|
48091
|
-
displayName: "
|
|
48092
|
-
componentId: "sc-
|
|
48093
|
-
})(["padding:
|
|
48094
|
-
var
|
|
48095
|
-
|
|
48096
|
-
|
|
48097
|
-
|
|
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;"]);
|
|
48098
48046
|
|
|
48099
48047
|
var Marketplace = function Marketplace(props) {
|
|
48100
48048
|
var onClose = props.onClose,
|
|
@@ -48277,13 +48225,7 @@ var Marketplace = function Marketplace(props) {
|
|
|
48277
48225
|
return setCharacterSubTab('my-listings');
|
|
48278
48226
|
},
|
|
48279
48227
|
type: "button"
|
|
48280
|
-
}, "My Listings"), React__default.createElement(
|
|
48281
|
-
"$active": characterSubTab === 'list',
|
|
48282
|
-
onClick: function onClick() {
|
|
48283
|
-
return setCharacterSubTab('list');
|
|
48284
|
-
},
|
|
48285
|
-
type: "button"
|
|
48286
|
-
}, "List Character")), characterSubTab === 'browse' && React__default.createElement(CharacterMarketplacePanel, {
|
|
48228
|
+
}, "My Listings")), characterSubTab === 'browse' && React__default.createElement(CharacterMarketplacePanel, {
|
|
48287
48229
|
characterListings: characterListings != null ? characterListings : [],
|
|
48288
48230
|
totalCount: characterListingsTotal != null ? characterListingsTotal : 0,
|
|
48289
48231
|
currentPage: characterListingsPage != null ? characterListingsPage : 1,
|
|
@@ -48306,13 +48248,6 @@ var Marketplace = function Marketplace(props) {
|
|
|
48306
48248
|
itemsPerPage: 10,
|
|
48307
48249
|
onPageChange: onMyCharacterListingsPageChange != null ? onMyCharacterListingsPageChange : function () {},
|
|
48308
48250
|
onCharacterDelist: onCharacterDelist != null ? onCharacterDelist : function () {},
|
|
48309
|
-
atlasJSON: props.atlasJSON,
|
|
48310
|
-
atlasIMG: props.atlasIMG,
|
|
48311
|
-
characterAtlasJSON: characterAtlasJSON != null ? characterAtlasJSON : props.atlasJSON,
|
|
48312
|
-
characterAtlasIMG: characterAtlasIMG != null ? characterAtlasIMG : props.atlasIMG,
|
|
48313
|
-
enableHotkeys: props.enableHotkeys,
|
|
48314
|
-
disableHotkeys: props.disableHotkeys
|
|
48315
|
-
}), characterSubTab === 'list' && React__default.createElement(CharacterListingForm, {
|
|
48316
48251
|
accountCharacters: accountCharacters != null ? accountCharacters : [],
|
|
48317
48252
|
onCharacterList: onCharacterList != null ? onCharacterList : function () {},
|
|
48318
48253
|
atlasJSON: props.atlasJSON,
|
|
@@ -48435,7 +48370,7 @@ var CharacterMarketplaceRows = function CharacterMarketplaceRows(_ref) {
|
|
|
48435
48370
|
atlasJSON: atlasJSON,
|
|
48436
48371
|
spriteKey: "others/definya-coin.png",
|
|
48437
48372
|
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, {
|
|
48373
|
+
})), 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
48374
|
icon: onCharacterBuy ? React__default.createElement(Coins.Coins, {
|
|
48440
48375
|
width: 18,
|
|
48441
48376
|
height: 18
|
|
@@ -48494,7 +48429,7 @@ var ActionSection$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
48494
48429
|
displayName: "CharacterMarketplaceRows__ActionSection",
|
|
48495
48430
|
componentId: "sc-1pxkdig-10"
|
|
48496
48431
|
})(["flex-shrink:0;margin-left:0.75rem;"]);
|
|
48497
|
-
var PendingBadge = /*#__PURE__*/styled__default.span.withConfig({
|
|
48432
|
+
var PendingBadge$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
48498
48433
|
displayName: "CharacterMarketplaceRows__PendingBadge",
|
|
48499
48434
|
componentId: "sc-1pxkdig-11"
|
|
48500
48435
|
})(["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;"]);
|
|
@@ -48548,6 +48483,63 @@ var OtherListingRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
48548
48483
|
componentId: "sc-1pxkdig-15"
|
|
48549
48484
|
})(["opacity:0.85;&:hover{opacity:1;}"]);
|
|
48550
48485
|
|
|
48486
|
+
var CharacterListingForm = function CharacterListingForm(_ref) {
|
|
48487
|
+
var accountCharacters = _ref.accountCharacters,
|
|
48488
|
+
onCharacterList = _ref.onCharacterList,
|
|
48489
|
+
atlasJSON = _ref.atlasJSON,
|
|
48490
|
+
atlasIMG = _ref.atlasIMG,
|
|
48491
|
+
characterAtlasJSON = _ref.characterAtlasJSON,
|
|
48492
|
+
characterAtlasIMG = _ref.characterAtlasIMG,
|
|
48493
|
+
enableHotkeys = _ref.enableHotkeys,
|
|
48494
|
+
disableHotkeys = _ref.disableHotkeys;
|
|
48495
|
+
var _useState = React.useState(false),
|
|
48496
|
+
isModalOpen = _useState[0],
|
|
48497
|
+
setIsModalOpen = _useState[1];
|
|
48498
|
+
var eligibleCount = accountCharacters.filter(function (c) {
|
|
48499
|
+
return !c.isListedForSale && !c.tradedAt;
|
|
48500
|
+
}).length;
|
|
48501
|
+
return React__default.createElement(Wrapper$2, null, React__default.createElement(CharacterListingModal, {
|
|
48502
|
+
isOpen: isModalOpen,
|
|
48503
|
+
onClose: function onClose() {
|
|
48504
|
+
return setIsModalOpen(false);
|
|
48505
|
+
},
|
|
48506
|
+
accountCharacters: accountCharacters,
|
|
48507
|
+
atlasJSON: atlasJSON,
|
|
48508
|
+
atlasIMG: atlasIMG,
|
|
48509
|
+
characterAtlasJSON: characterAtlasJSON,
|
|
48510
|
+
characterAtlasIMG: characterAtlasIMG,
|
|
48511
|
+
onCharacterList: onCharacterList,
|
|
48512
|
+
enableHotkeys: enableHotkeys,
|
|
48513
|
+
disableHotkeys: disableHotkeys
|
|
48514
|
+
}), React__default.createElement(Description$4, null, "List one of your offline characters on the marketplace. Prices are set in DC."), React__default.createElement(OpenButton, {
|
|
48515
|
+
icon: React__default.createElement(ShoppingBag.ShoppingBag, {
|
|
48516
|
+
width: 20,
|
|
48517
|
+
height: 20
|
|
48518
|
+
}),
|
|
48519
|
+
label: "List a Character" + (eligibleCount > 0 ? " (" + eligibleCount + " eligible)" : ''),
|
|
48520
|
+
disabled: eligibleCount === 0,
|
|
48521
|
+
onClick: function onClick() {
|
|
48522
|
+
return setIsModalOpen(true);
|
|
48523
|
+
}
|
|
48524
|
+
}), eligibleCount === 0 && React__default.createElement(NoEligible, null, "No eligible characters to list."));
|
|
48525
|
+
};
|
|
48526
|
+
var Wrapper$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
48527
|
+
displayName: "CharacterListingForm__Wrapper",
|
|
48528
|
+
componentId: "sc-fxv1tt-0"
|
|
48529
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:40px 24px;width:95%;margin:0 auto;"]);
|
|
48530
|
+
var Description$4 = /*#__PURE__*/styled__default.p.withConfig({
|
|
48531
|
+
displayName: "CharacterListingForm__Description",
|
|
48532
|
+
componentId: "sc-fxv1tt-1"
|
|
48533
|
+
})(["margin:0;font-size:0.5rem;color:#666;text-align:center;line-height:1.6;max-width:320px;"]);
|
|
48534
|
+
var OpenButton = /*#__PURE__*/styled__default(CTAButton).withConfig({
|
|
48535
|
+
displayName: "CharacterListingForm__OpenButton",
|
|
48536
|
+
componentId: "sc-fxv1tt-2"
|
|
48537
|
+
})(["padding:14px 24px;span{font-size:0.65rem;}svg{font-size:1.2rem;}"]);
|
|
48538
|
+
var NoEligible = /*#__PURE__*/styled__default.span.withConfig({
|
|
48539
|
+
displayName: "CharacterListingForm__NoEligible",
|
|
48540
|
+
componentId: "sc-fxv1tt-3"
|
|
48541
|
+
})(["font-size:0.45rem;color:#52525b;text-transform:uppercase;letter-spacing:1px;"]);
|
|
48542
|
+
|
|
48551
48543
|
var TabBody = function TabBody(_ref) {
|
|
48552
48544
|
var id = _ref.id,
|
|
48553
48545
|
children = _ref.children,
|