@rpg-engine/long-bow 0.8.167 → 0.8.169
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/ManagmentPanel.d.ts +1 -0
- package/dist/components/Marketplace/MarketplaceRows.d.ts +2 -1
- package/dist/long-bow.cjs.development.js +186 -54
- 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 +187 -55
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/trading/MarketplaceRows.stories.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/Marketplace/BuyPanel.tsx +98 -27
- package/src/components/Marketplace/ManagmentPanel.tsx +79 -15
- package/src/components/Marketplace/MarketplaceRows.tsx +60 -27
- package/src/components/Marketplace/MarketplaceSettingsPanel.tsx +26 -31
- package/src/stories/Features/trading/Marketplace.stories.tsx +33 -6
- package/src/stories/Features/trading/MarketplaceRows.stories.tsx +15 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, Component, useRef, useCallback, useMemo, me
|
|
|
2
2
|
import styled, { css, keyframes, createGlobalStyle } from 'styled-components';
|
|
3
3
|
import { BeatLoader } from 'react-spinners';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
|
-
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemQualityLevel, ItemRarities, ItemSubType, isMobile, TaskType, TaskStatus, isMobileOrTablet, RewardType, ItemSlotType, NPCSubtype, EntityAttackType, NPCAlignment, VideoGuideCategory, VideoGuideLanguage, MarketplaceBuyOrderStatus, formatDCAmount, goldToDC, MarketplaceTransactionType,
|
|
5
|
+
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemQualityLevel, ItemRarities, ItemSubType, isMobile, TaskType, TaskStatus, isMobileOrTablet, RewardType, ItemSlotType, NPCSubtype, EntityAttackType, NPCAlignment, VideoGuideCategory, VideoGuideLanguage, MarketplaceBuyOrderStatus, formatDCAmount, MarketplaceAcceptedCurrency, goldToDC, MarketplaceTransactionType, CharacterClass, QuestStatus, getLevelFromXP, getSkillConstants, getLevelFromSPTiered, getXPForLevel, getSPForLevelTiered, MetadataType, PurchaseType, UserAccountTypes, PaymentCurrency, PeriodOfDay } from '@rpg-engine/shared';
|
|
6
6
|
export { MarketplaceAcceptedCurrency } from '@rpg-engine/shared';
|
|
7
7
|
import dayjs from 'dayjs';
|
|
8
8
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
@@ -45880,6 +45880,7 @@ var MarketplaceRows = function MarketplaceRows(_ref) {
|
|
|
45880
45880
|
item = _ref.item,
|
|
45881
45881
|
itemPrice = _ref.itemPrice,
|
|
45882
45882
|
dcEquivalentPrice = _ref.dcEquivalentPrice,
|
|
45883
|
+
acceptedCurrency = _ref.acceptedCurrency,
|
|
45883
45884
|
equipmentSet = _ref.equipmentSet,
|
|
45884
45885
|
scale = _ref.scale,
|
|
45885
45886
|
onMarketPlaceItemBuy = _ref.onMarketPlaceItemBuy,
|
|
@@ -45912,7 +45913,11 @@ var MarketplaceRows = function MarketplaceRows(_ref) {
|
|
|
45912
45913
|
maxLines: 1,
|
|
45913
45914
|
maxWidth: "200px",
|
|
45914
45915
|
fontSize: "10px"
|
|
45915
|
-
}, item.name)
|
|
45916
|
+
}, item.name), acceptedCurrency === MarketplaceAcceptedCurrency.Dc && React.createElement(CurrencyBadge, {
|
|
45917
|
+
"$color": "#a78bfa"
|
|
45918
|
+
}, "DC only"), acceptedCurrency === MarketplaceAcceptedCurrency.Gold && React.createElement(CurrencyBadge, {
|
|
45919
|
+
"$color": "#fef08a"
|
|
45920
|
+
}, "Gold only")), React.createElement(PriceRow, null, acceptedCurrency !== MarketplaceAcceptedCurrency.Dc && React.createElement(GoldPriceRow$1, null, React.createElement(GoldIcon$1, null, React.createElement(SimpleTooltip, {
|
|
45916
45921
|
content: "Gold Coin",
|
|
45917
45922
|
direction: "top"
|
|
45918
45923
|
}, React.createElement(SpriteFromAtlas, {
|
|
@@ -45962,18 +45967,22 @@ var GroupedMarketplaceRow = function GroupedMarketplaceRow(_ref2) {
|
|
|
45962
45967
|
onBuy = _ref2.onBuy,
|
|
45963
45968
|
onDCCoinClick = _ref2.onDCCoinClick;
|
|
45964
45969
|
var makeRow = function makeRow(listing) {
|
|
45970
|
+
var listingCurrency = listing.acceptedCurrency || MarketplaceAcceptedCurrency.GoldOrDc;
|
|
45971
|
+
var isDcOnly = listingCurrency === MarketplaceAcceptedCurrency.Dc;
|
|
45972
|
+
var showDcPrice = isDcOnly || dcToGoldSwapRate > 0 && listingCurrency !== MarketplaceAcceptedCurrency.Gold;
|
|
45965
45973
|
return React.createElement(MarketplaceRows, {
|
|
45966
45974
|
key: listing._id,
|
|
45967
45975
|
atlasIMG: atlasIMG,
|
|
45968
45976
|
atlasJSON: atlasJSON,
|
|
45969
45977
|
item: listing.item,
|
|
45970
45978
|
itemPrice: listing.price,
|
|
45971
|
-
dcEquivalentPrice:
|
|
45979
|
+
dcEquivalentPrice: showDcPrice ? getDCEquivalentPrice(listing.price) : undefined,
|
|
45980
|
+
acceptedCurrency: listingCurrency,
|
|
45972
45981
|
equipmentSet: equipmentSet,
|
|
45973
45982
|
onMarketPlaceItemBuy: function onMarketPlaceItemBuy() {
|
|
45974
45983
|
return onBuy(listing._id);
|
|
45975
45984
|
},
|
|
45976
|
-
onDCCoinClick: onDCCoinClick,
|
|
45985
|
+
onDCCoinClick: isDcOnly ? undefined : onDCCoinClick,
|
|
45977
45986
|
disabled: listing.owner === characterId
|
|
45978
45987
|
});
|
|
45979
45988
|
};
|
|
@@ -46045,17 +46054,27 @@ var GemContainer = /*#__PURE__*/styled.p.withConfig({
|
|
|
46045
46054
|
displayName: "MarketplaceRows__GemContainer",
|
|
46046
46055
|
componentId: "sc-wmpr1o-13"
|
|
46047
46056
|
})(["position:absolute;display:block;top:-5px;left:-10px;font-size:", " !important;"], uiFonts.size.xsmall);
|
|
46057
|
+
var CurrencyBadge = /*#__PURE__*/styled.span.withConfig({
|
|
46058
|
+
displayName: "MarketplaceRows__CurrencyBadge",
|
|
46059
|
+
componentId: "sc-wmpr1o-14"
|
|
46060
|
+
})(["display:inline-block;margin-left:6px;padding:1px 4px;font-family:'Press Start 2P',cursive;font-size:0.38rem;color:", ";border:1px solid ", ";border-radius:3px;opacity:0.85;vertical-align:middle;text-transform:uppercase;letter-spacing:0.5px;"], function (_ref5) {
|
|
46061
|
+
var $color = _ref5.$color;
|
|
46062
|
+
return $color;
|
|
46063
|
+
}, function (_ref6) {
|
|
46064
|
+
var $color = _ref6.$color;
|
|
46065
|
+
return $color;
|
|
46066
|
+
});
|
|
46048
46067
|
var RarityContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
46049
46068
|
displayName: "MarketplaceRows__RarityContainer",
|
|
46050
|
-
componentId: "sc-wmpr1o-
|
|
46051
|
-
})(["border-color:", ";box-shadow:", " inset,", ";width:32px;height:32px;"], function (
|
|
46052
|
-
var item =
|
|
46069
|
+
componentId: "sc-wmpr1o-15"
|
|
46070
|
+
})(["border-color:", ";box-shadow:", " inset,", ";width:32px;height:32px;"], function (_ref7) {
|
|
46071
|
+
var item = _ref7.item;
|
|
46053
46072
|
return rarityColor(item);
|
|
46054
|
-
}, function (
|
|
46055
|
-
var item =
|
|
46073
|
+
}, function (_ref8) {
|
|
46074
|
+
var item = _ref8.item;
|
|
46056
46075
|
return "0 0 5px 8px " + rarityColor(item);
|
|
46057
|
-
}, function (
|
|
46058
|
-
var item =
|
|
46076
|
+
}, function (_ref9) {
|
|
46077
|
+
var item = _ref9.item;
|
|
46059
46078
|
return "0 0 8px 6px " + rarityColor(item);
|
|
46060
46079
|
});
|
|
46061
46080
|
|
|
@@ -46171,6 +46190,9 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46171
46190
|
var _useState9 = useState(null),
|
|
46172
46191
|
fulfillingBuyOrderId = _useState9[0],
|
|
46173
46192
|
setFulfillingBuyOrderId = _useState9[1];
|
|
46193
|
+
var _useState10 = useState(null),
|
|
46194
|
+
currencyFilter = _useState10[0],
|
|
46195
|
+
setCurrencyFilter = _useState10[1];
|
|
46174
46196
|
var itemsContainer = useRef(null);
|
|
46175
46197
|
useEffect(function () {
|
|
46176
46198
|
var _itemsContainer$curre;
|
|
@@ -46183,9 +46205,19 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46183
46205
|
var getDCEquivalentPrice = function getDCEquivalentPrice(goldPrice) {
|
|
46184
46206
|
return dcToGoldSwapRate > 0 ? goldToDC(goldPrice) : 0;
|
|
46185
46207
|
};
|
|
46208
|
+
var handleBuyClick = function handleBuyClick(listingId) {
|
|
46209
|
+
// All currencies go through the confirmation modal
|
|
46210
|
+
setBuyingItemId(listingId);
|
|
46211
|
+
};
|
|
46186
46212
|
var groupedItems = useMemo(function () {
|
|
46213
|
+
var filtered = currencyFilter === null ? items : items.filter(function (i) {
|
|
46214
|
+
var c = i.acceptedCurrency || MarketplaceAcceptedCurrency.GoldOrDc;
|
|
46215
|
+
if (currencyFilter === 'gold') return c === MarketplaceAcceptedCurrency.Gold || c === MarketplaceAcceptedCurrency.GoldOrDc;
|
|
46216
|
+
if (currencyFilter === 'dc') return c === MarketplaceAcceptedCurrency.Dc || c === MarketplaceAcceptedCurrency.GoldOrDc;
|
|
46217
|
+
return true;
|
|
46218
|
+
});
|
|
46187
46219
|
var groups = new Map();
|
|
46188
|
-
for (var _iterator = _createForOfIteratorHelperLoose(
|
|
46220
|
+
for (var _iterator = _createForOfIteratorHelperLoose(filtered), _step; !(_step = _iterator()).done;) {
|
|
46189
46221
|
var entry = _step.value;
|
|
46190
46222
|
var key = entry.item.key;
|
|
46191
46223
|
if (!groups.has(key)) {
|
|
@@ -46202,7 +46234,7 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46202
46234
|
otherListings: sorted.slice(1)
|
|
46203
46235
|
};
|
|
46204
46236
|
});
|
|
46205
|
-
}, [items]);
|
|
46237
|
+
}, [items, currencyFilter]);
|
|
46206
46238
|
var visibleBuyOrders = useMemo(function () {
|
|
46207
46239
|
var normalizedName = name.trim().toLowerCase();
|
|
46208
46240
|
return openBuyOrders.filter(function (order) {
|
|
@@ -46252,27 +46284,32 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46252
46284
|
var showSellSection = browseMode === 'sell';
|
|
46253
46285
|
var showBuySection = browseMode === 'buy';
|
|
46254
46286
|
var hasVisibleContent = showSellSection && groupedItems.length > 0 || showBuySection && groupedBuyOrders.length > 0;
|
|
46255
|
-
return React.createElement(React.Fragment, null, buyingItemId && buyingItem &&
|
|
46256
|
-
|
|
46257
|
-
|
|
46258
|
-
|
|
46259
|
-
|
|
46260
|
-
|
|
46261
|
-
|
|
46262
|
-
|
|
46263
|
-
|
|
46264
|
-
|
|
46265
|
-
|
|
46266
|
-
|
|
46267
|
-
|
|
46268
|
-
|
|
46269
|
-
|
|
46270
|
-
|
|
46271
|
-
|
|
46272
|
-
|
|
46273
|
-
|
|
46274
|
-
|
|
46275
|
-
|
|
46287
|
+
return React.createElement(React.Fragment, null, buyingItemId && buyingItem && function () {
|
|
46288
|
+
var listingCurrency = buyingItem.acceptedCurrency || MarketplaceAcceptedCurrency.GoldOrDc;
|
|
46289
|
+
var isDcOnly = listingCurrency === MarketplaceAcceptedCurrency.Dc;
|
|
46290
|
+
var showPaymentChoiceModal = listingCurrency === MarketplaceAcceptedCurrency.GoldOrDc && hasDCBalance;
|
|
46291
|
+
return showPaymentChoiceModal ? React.createElement(MarketplaceBuyModal, {
|
|
46292
|
+
goldPrice: buyingItem.price,
|
|
46293
|
+
dcEquivalentPrice: getDCEquivalentPrice(buyingItem.price),
|
|
46294
|
+
dcBalance: dcBalance,
|
|
46295
|
+
onClose: function onClose() {
|
|
46296
|
+
return setBuyingItemId(null);
|
|
46297
|
+
},
|
|
46298
|
+
onConfirm: function onConfirm(paymentMethod) {
|
|
46299
|
+
onMarketPlaceItemBuy == null ? void 0 : onMarketPlaceItemBuy(buyingItemId, paymentMethod);
|
|
46300
|
+
setBuyingItemId(null);
|
|
46301
|
+
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
46302
|
+
}
|
|
46303
|
+
}) : React.createElement(ConfirmModal, {
|
|
46304
|
+
onClose: setBuyingItemId.bind(null, null),
|
|
46305
|
+
onConfirm: function onConfirm() {
|
|
46306
|
+
onMarketPlaceItemBuy == null ? void 0 : onMarketPlaceItemBuy(buyingItemId, isDcOnly ? 'dc' : undefined);
|
|
46307
|
+
setBuyingItemId(null);
|
|
46308
|
+
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
46309
|
+
},
|
|
46310
|
+
message: isDcOnly ? "Are you sure you want to buy this item with DC?" : "Are you sure you want to buy this item?"
|
|
46311
|
+
});
|
|
46312
|
+
}(), fulfillingBuyOrderId && React.createElement(ConfirmModal, {
|
|
46276
46313
|
onClose: setFulfillingBuyOrderId.bind(null, null),
|
|
46277
46314
|
onConfirm: function onConfirm() {
|
|
46278
46315
|
onFulfillBuyOrder == null ? void 0 : onFulfillBuyOrder(fulfillingBuyOrderId);
|
|
@@ -46312,7 +46349,18 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46312
46349
|
}, React.createElement(SortVertical, {
|
|
46313
46350
|
width: 18,
|
|
46314
46351
|
height: 18
|
|
46315
|
-
}))),
|
|
46352
|
+
}))), showSellSection && React.createElement(CurrencyFilterRow, null, React.createElement(CurrencyFilterLabel, null, "Currency:"), ['gold', 'dc'].map(function (c) {
|
|
46353
|
+
return React.createElement(CurrencyFilterButton, {
|
|
46354
|
+
key: c,
|
|
46355
|
+
"$active": currencyFilter === c,
|
|
46356
|
+
onPointerDown: function onPointerDown() {
|
|
46357
|
+
return setCurrencyFilter(function (prev) {
|
|
46358
|
+
return prev === c ? null : c;
|
|
46359
|
+
});
|
|
46360
|
+
},
|
|
46361
|
+
type: "button"
|
|
46362
|
+
}, c === 'gold' ? 'Gold' : 'DC');
|
|
46363
|
+
})), showFilters && React.createElement(OptionsWrapper, {
|
|
46316
46364
|
showFilters: showFilters
|
|
46317
46365
|
}, React.createElement(WrapperContainer$1, {
|
|
46318
46366
|
"$sell": showSellSection
|
|
@@ -46419,7 +46467,7 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46419
46467
|
dcToGoldSwapRate: dcToGoldSwapRate,
|
|
46420
46468
|
getDCEquivalentPrice: getDCEquivalentPrice,
|
|
46421
46469
|
characterId: characterId,
|
|
46422
|
-
onBuy:
|
|
46470
|
+
onBuy: handleBuyClick,
|
|
46423
46471
|
onDCCoinClick: onDCCoinClick
|
|
46424
46472
|
});
|
|
46425
46473
|
})), showBuySection && React.createElement(MarketSection, null, React.createElement(SectionHeader, null, React.createElement(SectionTitle$2, null, "Buy Requests"), React.createElement(SectionMeta, null, groupedBuyOrders.length, " groups")), groupedBuyOrders.length === 0 ? React.createElement(SectionEmpty, null, "No public buy requests found.") : groupedBuyOrders.map(function (_ref3) {
|
|
@@ -46533,6 +46581,33 @@ var LoadingText$1 = /*#__PURE__*/styled.span.withConfig({
|
|
|
46533
46581
|
displayName: "BuyPanel__LoadingText",
|
|
46534
46582
|
componentId: "sc-1si8t7i-17"
|
|
46535
46583
|
})(["font-size:0.48rem;color:#8a8a8a;text-transform:uppercase;letter-spacing:1px;"]);
|
|
46584
|
+
var CurrencyFilterRow = /*#__PURE__*/styled.div.withConfig({
|
|
46585
|
+
displayName: "BuyPanel__CurrencyFilterRow",
|
|
46586
|
+
componentId: "sc-1si8t7i-18"
|
|
46587
|
+
})(["display:flex;align-items:center;gap:6px;width:95%;margin:0 auto 8px auto;"]);
|
|
46588
|
+
var CurrencyFilterLabel = /*#__PURE__*/styled.span.withConfig({
|
|
46589
|
+
displayName: "BuyPanel__CurrencyFilterLabel",
|
|
46590
|
+
componentId: "sc-1si8t7i-19"
|
|
46591
|
+
})(["font-size:0.45rem !important;color:#666 !important;text-transform:uppercase;letter-spacing:0.5px;white-space:nowrap;"]);
|
|
46592
|
+
var CurrencyFilterButton = /*#__PURE__*/styled.button.withConfig({
|
|
46593
|
+
displayName: "BuyPanel__CurrencyFilterButton",
|
|
46594
|
+
componentId: "sc-1si8t7i-20"
|
|
46595
|
+
})(["padding:3px 8px;font-family:'Press Start 2P',cursive !important;font-size:0.4rem !important;border-radius:4px;border:1px solid ", " !important;background:", " !important;color:", " !important;cursor:pointer;transition:border-color 0.15s,background 0.15s,color 0.15s;&:hover{border-color:", " !important;color:", " !important;}"], function (_ref9) {
|
|
46596
|
+
var $active = _ref9.$active;
|
|
46597
|
+
return $active ? '#f59e0b' : 'rgba(255,255,255,0.12)';
|
|
46598
|
+
}, function (_ref10) {
|
|
46599
|
+
var $active = _ref10.$active;
|
|
46600
|
+
return $active ? 'rgba(245,158,11,0.15)' : 'rgba(0,0,0,0.3)';
|
|
46601
|
+
}, function (_ref11) {
|
|
46602
|
+
var $active = _ref11.$active;
|
|
46603
|
+
return $active ? '#f59e0b' : '#777';
|
|
46604
|
+
}, function (_ref12) {
|
|
46605
|
+
var $active = _ref12.$active;
|
|
46606
|
+
return $active ? '#f59e0b' : 'rgba(255,255,255,0.3)';
|
|
46607
|
+
}, function (_ref13) {
|
|
46608
|
+
var $active = _ref13.$active;
|
|
46609
|
+
return $active ? '#f59e0b' : '#bbb';
|
|
46610
|
+
});
|
|
46536
46611
|
|
|
46537
46612
|
var _TRANSACTION_TYPE_COL;
|
|
46538
46613
|
var HISTORY_ITEMS_PER_PAGE = 10;
|
|
@@ -46742,6 +46817,16 @@ var PagerContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
46742
46817
|
componentId: "sc-74mioa-21"
|
|
46743
46818
|
})(["display:flex;justify-content:center;margin-top:4px;"]);
|
|
46744
46819
|
|
|
46820
|
+
var LISTING_CURRENCY_OPTIONS = [{
|
|
46821
|
+
value: MarketplaceAcceptedCurrency.GoldOrDc,
|
|
46822
|
+
label: 'Both'
|
|
46823
|
+
}, {
|
|
46824
|
+
value: MarketplaceAcceptedCurrency.Gold,
|
|
46825
|
+
label: 'Gold'
|
|
46826
|
+
}, {
|
|
46827
|
+
value: MarketplaceAcceptedCurrency.Dc,
|
|
46828
|
+
label: 'DC'
|
|
46829
|
+
}];
|
|
46745
46830
|
var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
46746
46831
|
var items = _ref.items,
|
|
46747
46832
|
atlasIMG = _ref.atlasIMG,
|
|
@@ -46757,7 +46842,9 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
46757
46842
|
enableHotkeys = _ref.enableHotkeys,
|
|
46758
46843
|
disableHotkeys = _ref.disableHotkeys,
|
|
46759
46844
|
onMoneyWithdraw = _ref.onMoneyWithdraw,
|
|
46760
|
-
currentPage = _ref.currentPage
|
|
46845
|
+
currentPage = _ref.currentPage,
|
|
46846
|
+
_ref$dcToGoldSwapRate = _ref.dcToGoldSwapRate,
|
|
46847
|
+
dcToGoldSwapRate = _ref$dcToGoldSwapRate === void 0 ? 0 : _ref$dcToGoldSwapRate;
|
|
46761
46848
|
var _useState = useState(''),
|
|
46762
46849
|
price = _useState[0],
|
|
46763
46850
|
setPrice = _useState[1];
|
|
@@ -46767,6 +46854,9 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
46767
46854
|
var _useState3 = useState(null),
|
|
46768
46855
|
removingItemId = _useState3[0],
|
|
46769
46856
|
setRemovingItemId = _useState3[1];
|
|
46857
|
+
var _useState4 = useState(acceptedCurrency || MarketplaceAcceptedCurrency.GoldOrDc),
|
|
46858
|
+
listingCurrency = _useState4[0],
|
|
46859
|
+
setListingCurrency = _useState4[1];
|
|
46770
46860
|
var itemsContainer = useRef(null);
|
|
46771
46861
|
useEffect(function () {
|
|
46772
46862
|
var _itemsContainer$curre;
|
|
@@ -46776,7 +46866,7 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
46776
46866
|
onClose: setIsCreatingOffer.bind(null, false),
|
|
46777
46867
|
onConfirm: function onConfirm() {
|
|
46778
46868
|
if (selectedItemToSell && price && Number(price)) {
|
|
46779
|
-
onAddItemToMarketplace(selectedItemToSell, Number(price),
|
|
46869
|
+
onAddItemToMarketplace(selectedItemToSell, Number(price), listingCurrency);
|
|
46780
46870
|
setPrice('');
|
|
46781
46871
|
onSelectedItemToSellRemove(selectedItemToSell);
|
|
46782
46872
|
setIsCreatingOffer(false);
|
|
@@ -46845,6 +46935,15 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
46845
46935
|
setIsCreatingOffer(true);
|
|
46846
46936
|
}
|
|
46847
46937
|
}
|
|
46938
|
+
})), React.createElement(CurrencyToggleRow, null, React.createElement(CurrencyToggleLabel, null, "Accept:"), LISTING_CURRENCY_OPTIONS.map(function (opt) {
|
|
46939
|
+
return React.createElement(CurrencyToggleButton, {
|
|
46940
|
+
key: opt.value,
|
|
46941
|
+
"$active": listingCurrency === opt.value,
|
|
46942
|
+
onPointerDown: function onPointerDown() {
|
|
46943
|
+
return setListingCurrency(opt.value);
|
|
46944
|
+
},
|
|
46945
|
+
type: "button"
|
|
46946
|
+
}, opt.label);
|
|
46848
46947
|
}))))), React.createElement(InnerOptionsWrapper, null, React.createElement(SectionLabel$1, {
|
|
46849
46948
|
style: {
|
|
46850
46949
|
marginBottom: '8px'
|
|
@@ -46880,13 +46979,19 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
46880
46979
|
}, items == null ? void 0 : items.map(function (_ref2, index) {
|
|
46881
46980
|
var item = _ref2.item,
|
|
46882
46981
|
price = _ref2.price,
|
|
46883
|
-
_id = _ref2._id
|
|
46982
|
+
_id = _ref2._id,
|
|
46983
|
+
itemCurrency = _ref2.acceptedCurrency;
|
|
46984
|
+
var currency = itemCurrency || MarketplaceAcceptedCurrency.GoldOrDc;
|
|
46985
|
+
var isDcOnly = currency === MarketplaceAcceptedCurrency.Dc;
|
|
46986
|
+
var showDcPrice = isDcOnly || dcToGoldSwapRate > 0 && currency !== MarketplaceAcceptedCurrency.Gold;
|
|
46884
46987
|
return React.createElement(MarketplaceRows, {
|
|
46885
46988
|
key: item.key + "_" + index,
|
|
46886
46989
|
atlasIMG: atlasIMG,
|
|
46887
46990
|
atlasJSON: atlasJSON,
|
|
46888
46991
|
item: item,
|
|
46889
46992
|
itemPrice: price,
|
|
46993
|
+
dcEquivalentPrice: showDcPrice ? goldToDC(price) : undefined,
|
|
46994
|
+
acceptedCurrency: currency,
|
|
46890
46995
|
equipmentSet: equipmentSet,
|
|
46891
46996
|
onMarketPlaceItemRemove: setRemovingItemId.bind(null, _id)
|
|
46892
46997
|
});
|
|
@@ -46946,15 +47051,46 @@ var SmallCTAButton = /*#__PURE__*/styled(CTAButton).withConfig({
|
|
|
46946
47051
|
displayName: "ManagmentPanel__SmallCTAButton",
|
|
46947
47052
|
componentId: "sc-1yyi6jn-12"
|
|
46948
47053
|
})(["padding:8px 12px;height:32px;span{font-size:0.65rem;}svg{font-size:1.1rem;}"]);
|
|
47054
|
+
var CurrencyToggleRow = /*#__PURE__*/styled.div.withConfig({
|
|
47055
|
+
displayName: "ManagmentPanel__CurrencyToggleRow",
|
|
47056
|
+
componentId: "sc-1yyi6jn-13"
|
|
47057
|
+
})(["display:flex;align-items:center;gap:6px;margin-top:8px;"]);
|
|
47058
|
+
var CurrencyToggleLabel = /*#__PURE__*/styled.span.withConfig({
|
|
47059
|
+
displayName: "ManagmentPanel__CurrencyToggleLabel",
|
|
47060
|
+
componentId: "sc-1yyi6jn-14"
|
|
47061
|
+
})(["font-size:0.5rem;color:#888;text-transform:uppercase;letter-spacing:0.5px;white-space:nowrap;"]);
|
|
47062
|
+
var CurrencyToggleButton = /*#__PURE__*/styled.button.withConfig({
|
|
47063
|
+
displayName: "ManagmentPanel__CurrencyToggleButton",
|
|
47064
|
+
componentId: "sc-1yyi6jn-15"
|
|
47065
|
+
})(["padding:3px 8px;font-family:'Press Start 2P',cursive !important;font-size:0.45rem !important;border-radius:4px;border:1px solid ", " !important;background:", " !important;color:", " !important;cursor:pointer;transition:border-color 0.15s,background 0.15s,color 0.15s;&:hover{border-color:", " !important;color:", " !important;}"], function (_ref3) {
|
|
47066
|
+
var $active = _ref3.$active;
|
|
47067
|
+
return $active ? '#f59e0b' : 'rgba(255,255,255,0.15)';
|
|
47068
|
+
}, function (_ref4) {
|
|
47069
|
+
var $active = _ref4.$active;
|
|
47070
|
+
return $active ? 'rgba(245,158,11,0.15)' : 'rgba(0,0,0,0.3)';
|
|
47071
|
+
}, function (_ref5) {
|
|
47072
|
+
var $active = _ref5.$active;
|
|
47073
|
+
return $active ? '#f59e0b' : '#aaa';
|
|
47074
|
+
}, function (_ref6) {
|
|
47075
|
+
var $active = _ref6.$active;
|
|
47076
|
+
return $active ? '#f59e0b' : 'rgba(255,255,255,0.35)';
|
|
47077
|
+
}, function (_ref7) {
|
|
47078
|
+
var $active = _ref7.$active;
|
|
47079
|
+
return $active ? '#f59e0b' : '#ddd';
|
|
47080
|
+
});
|
|
46949
47081
|
|
|
46950
47082
|
var CURRENCY_OPTIONS = [{
|
|
46951
47083
|
value: MarketplaceAcceptedCurrency.GoldOrDc,
|
|
46952
|
-
label: '
|
|
46953
|
-
description: '
|
|
47084
|
+
label: 'Both',
|
|
47085
|
+
description: 'Gold & DC'
|
|
46954
47086
|
}, {
|
|
46955
47087
|
value: MarketplaceAcceptedCurrency.Gold,
|
|
46956
|
-
label: 'Gold
|
|
46957
|
-
description: '
|
|
47088
|
+
label: 'Gold',
|
|
47089
|
+
description: 'Gold only'
|
|
47090
|
+
}, {
|
|
47091
|
+
value: MarketplaceAcceptedCurrency.Dc,
|
|
47092
|
+
label: 'DC',
|
|
47093
|
+
description: 'DC only'
|
|
46958
47094
|
}];
|
|
46959
47095
|
var MarketplaceSettingsPanel = function MarketplaceSettingsPanel(_ref) {
|
|
46960
47096
|
var acceptedCurrency = _ref.acceptedCurrency,
|
|
@@ -46968,8 +47104,8 @@ var MarketplaceSettingsPanel = function MarketplaceSettingsPanel(_ref) {
|
|
|
46968
47104
|
}
|
|
46969
47105
|
}, React.createElement(OptionLabel$1, {
|
|
46970
47106
|
"$active": acceptedCurrency === option.value
|
|
46971
|
-
}, option.label), React.createElement(OptionDescription, null, option.description)
|
|
46972
|
-
})), React.createElement(Hint, null, "
|
|
47107
|
+
}, option.label), React.createElement(OptionDescription, null, option.description));
|
|
47108
|
+
})), React.createElement(Hint, null, "Default currency for new listings.")));
|
|
46973
47109
|
};
|
|
46974
47110
|
var Wrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
46975
47111
|
displayName: "MarketplaceSettingsPanel__Wrapper",
|
|
@@ -46986,11 +47122,11 @@ var SectionLabel$2 = /*#__PURE__*/styled.p.withConfig({
|
|
|
46986
47122
|
var OptionsGrid = /*#__PURE__*/styled.div.withConfig({
|
|
46987
47123
|
displayName: "MarketplaceSettingsPanel__OptionsGrid",
|
|
46988
47124
|
componentId: "sc-1lvibyi-3"
|
|
46989
|
-
})(["display:grid;grid-template-columns:1fr
|
|
47125
|
+
})(["display:grid;grid-template-columns:repeat(3,1fr);gap:12px;"]);
|
|
46990
47126
|
var OptionCard = /*#__PURE__*/styled.button.withConfig({
|
|
46991
47127
|
displayName: "MarketplaceSettingsPanel__OptionCard",
|
|
46992
47128
|
componentId: "sc-1lvibyi-4"
|
|
46993
|
-
})(["position:relative;display:flex;flex-direction:column;align-items:
|
|
47129
|
+
})(["position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:10px 8px;background:", " !important;border:2px solid ", " !important;border-radius:6px;cursor:pointer;text-align:center;transition:border-color 0.15s,background 0.15s;&:hover{border-color:", " !important;background:", " !important;}"], function (_ref2) {
|
|
46994
47130
|
var $active = _ref2.$active;
|
|
46995
47131
|
return $active ? 'rgba(245, 158, 11, 0.12)' : 'rgba(0, 0, 0, 0.25)';
|
|
46996
47132
|
}, function (_ref3) {
|
|
@@ -47006,21 +47142,17 @@ var OptionCard = /*#__PURE__*/styled.button.withConfig({
|
|
|
47006
47142
|
var OptionLabel$1 = /*#__PURE__*/styled.span.withConfig({
|
|
47007
47143
|
displayName: "MarketplaceSettingsPanel__OptionLabel",
|
|
47008
47144
|
componentId: "sc-1lvibyi-5"
|
|
47009
|
-
})(["font-family:'Press Start 2P',cursive;font-size:0.
|
|
47145
|
+
})(["font-family:'Press Start 2P',cursive !important;font-size:0.55rem !important;color:", " !important;letter-spacing:0.5px;"], function (_ref6) {
|
|
47010
47146
|
var $active = _ref6.$active;
|
|
47011
|
-
return $active ? '#f59e0b' : '#
|
|
47147
|
+
return $active ? '#f59e0b' : '#999';
|
|
47012
47148
|
});
|
|
47013
47149
|
var OptionDescription = /*#__PURE__*/styled.span.withConfig({
|
|
47014
47150
|
displayName: "MarketplaceSettingsPanel__OptionDescription",
|
|
47015
47151
|
componentId: "sc-1lvibyi-6"
|
|
47016
|
-
})(["font-size:0.
|
|
47017
|
-
var ActiveBadge = /*#__PURE__*/styled.span.withConfig({
|
|
47018
|
-
displayName: "MarketplaceSettingsPanel__ActiveBadge",
|
|
47019
|
-
componentId: "sc-1lvibyi-7"
|
|
47020
|
-
})(["position:absolute;top:8px;right:10px;font-size:0.45rem;color:#f59e0b;text-transform:uppercase;letter-spacing:0.5px;opacity:0.8;"]);
|
|
47152
|
+
})(["font-size:0.45rem !important;color:#555 !important;line-height:1.4;"]);
|
|
47021
47153
|
var Hint = /*#__PURE__*/styled.p.withConfig({
|
|
47022
47154
|
displayName: "MarketplaceSettingsPanel__Hint",
|
|
47023
|
-
componentId: "sc-1lvibyi-
|
|
47155
|
+
componentId: "sc-1lvibyi-7"
|
|
47024
47156
|
})(["margin:14px 0 0 0;font-size:0.48rem;color:#666;line-height:1.6;"]);
|
|
47025
47157
|
|
|
47026
47158
|
var Marketplace = function Marketplace(props) {
|