@rpg-engine/long-bow 0.8.232 → 0.8.234
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/DCWallet/DCTransferPanel.d.ts +3 -0
- package/dist/components/DCWallet/DCWalletContent.d.ts +3 -0
- package/dist/components/Marketplace/CharacterListingModal.d.ts +1 -0
- package/dist/components/Marketplace/CharacterTradePanel.d.ts +1 -0
- package/dist/components/Marketplace/ManagmentPanel.d.ts +1 -0
- package/dist/components/Marketplace/Marketplace.d.ts +1 -0
- package/dist/components/Marketplace/MyCharacterListingsPanel.d.ts +1 -0
- package/dist/components/Store/CartView.d.ts +11 -1
- package/dist/components/Store/PaymentMethodModal.d.ts +1 -0
- package/dist/components/Store/Store.d.ts +2 -1
- package/dist/components/Store/hooks/useStoreCart.d.ts +2 -1
- package/dist/long-bow.cjs.development.js +146 -82
- 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 +146 -82
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DCWallet/DCTransferPanel.tsx +34 -4
- package/src/components/DCWallet/DCWalletContent.tsx +9 -1
- package/src/components/DCWallet/__test__/DCTransferPanel.spec.tsx +115 -0
- package/src/components/Marketplace/CharacterListingModal.tsx +16 -0
- package/src/components/Marketplace/CharacterTradePanel.tsx +3 -0
- package/src/components/Marketplace/ManagmentPanel.tsx +38 -1
- package/src/components/Marketplace/Marketplace.tsx +2 -1
- package/src/components/Marketplace/MyCharacterListingsPanel.tsx +3 -0
- package/src/components/Marketplace/__test__/CharacterListingModal.spec.tsx +114 -0
- package/src/components/Marketplace/__test__/ManagmentPanel.spec.tsx +125 -0
- package/src/components/Store/CartView.tsx +23 -5
- package/src/components/Store/PaymentMethodModal.tsx +19 -9
- package/src/components/Store/Store.tsx +2 -2
- package/src/components/Store/__test__/CartView.spec.tsx +190 -0
- package/src/components/Store/__test__/PaymentMethodModal.spec.tsx +108 -0
- package/src/components/Store/hooks/useStoreCart.ts +6 -4
- package/src/stories/Features/trading/Marketplace.stories.tsx +2 -1
|
@@ -5849,7 +5849,9 @@ var DCTransferPanel = function DCTransferPanel(_ref) {
|
|
|
5849
5849
|
onInputFocus = _ref.onInputFocus,
|
|
5850
5850
|
onInputBlur = _ref.onInputBlur,
|
|
5851
5851
|
onSearchCharacter = _ref.onSearchCharacter,
|
|
5852
|
-
searchResults = _ref.searchResults
|
|
5852
|
+
searchResults = _ref.searchResults,
|
|
5853
|
+
_ref$feePercent = _ref.feePercent,
|
|
5854
|
+
feePercent = _ref$feePercent === void 0 ? 0 : _ref$feePercent;
|
|
5853
5855
|
var _useState = React.useState(''),
|
|
5854
5856
|
recipientName = _useState[0],
|
|
5855
5857
|
setRecipientName = _useState[1];
|
|
@@ -5909,7 +5911,8 @@ var DCTransferPanel = function DCTransferPanel(_ref) {
|
|
|
5909
5911
|
setValidationError('Amount must be a positive integer.');
|
|
5910
5912
|
return false;
|
|
5911
5913
|
}
|
|
5912
|
-
|
|
5914
|
+
var fee = Math.floor(parsedAmount * feePercent);
|
|
5915
|
+
if (parsedAmount + fee > dcBalance) {
|
|
5913
5916
|
setValidationError('Insufficient DC balance.');
|
|
5914
5917
|
return false;
|
|
5915
5918
|
}
|
|
@@ -5919,13 +5922,16 @@ var DCTransferPanel = function DCTransferPanel(_ref) {
|
|
|
5919
5922
|
var handleSendClick = React.useCallback(function () {
|
|
5920
5923
|
if (!validate()) return;
|
|
5921
5924
|
setShowConfirm(true);
|
|
5922
|
-
}, [recipientName, amount, dcBalance, characterName]);
|
|
5925
|
+
}, [recipientName, amount, dcBalance, characterName, feePercent]);
|
|
5923
5926
|
var handleConfirmTransfer = React.useCallback(function () {
|
|
5924
5927
|
setShowConfirm(false);
|
|
5925
5928
|
onSendTransfer(recipientName.trim(), parseInt(amount, 10));
|
|
5926
5929
|
setRecipientName('');
|
|
5927
5930
|
setAmount('');
|
|
5928
5931
|
}, [recipientName, amount, onSendTransfer]);
|
|
5932
|
+
var transferAmount = parseInt(amount, 10);
|
|
5933
|
+
var transferFee = Math.floor(transferAmount * feePercent);
|
|
5934
|
+
var transferTotal = transferAmount + transferFee;
|
|
5929
5935
|
return React__default.createElement(PanelContainer$1, null, React__default.createElement(FieldLabel, null, "Recipient Character Name"), React__default.createElement(AutocompleteWrapper, {
|
|
5930
5936
|
ref: dropdownRef
|
|
5931
5937
|
}, React__default.createElement(StyledInput, {
|
|
@@ -5971,7 +5977,7 @@ var DCTransferPanel = function DCTransferPanel(_ref) {
|
|
|
5971
5977
|
onBlur: onInputBlur,
|
|
5972
5978
|
placeholder: "0",
|
|
5973
5979
|
disabled: transferLoading
|
|
5974
|
-
}), validationError && React__default.createElement(ErrorMessage, null, validationError), React__default.createElement(ButtonRow, null, React__default.createElement(CTAButton, {
|
|
5980
|
+
}), feePercent > 0 && React__default.createElement(FeeDisclosure, null, feePercent * 100, "% transfer fee is added to the sender debit."), validationError && React__default.createElement(ErrorMessage, null, validationError), React__default.createElement(ButtonRow, null, React__default.createElement(CTAButton, {
|
|
5975
5981
|
icon: React__default.createElement(fa.FaPaperPlane, null),
|
|
5976
5982
|
label: transferLoading ? 'Sending...' : 'Send',
|
|
5977
5983
|
onClick: handleSendClick,
|
|
@@ -5979,8 +5985,8 @@ var DCTransferPanel = function DCTransferPanel(_ref) {
|
|
|
5979
5985
|
fullWidth: true
|
|
5980
5986
|
})), transferLoading && React__default.createElement(Spinner$1, null), transferResult && React__default.createElement(ResultMessage, {
|
|
5981
5987
|
"$success": transferResult.success
|
|
5982
|
-
}, transferResult.message), showConfirm && React__default.createElement(ConfirmModal, {
|
|
5983
|
-
message: "Transfer " +
|
|
5988
|
+
}, transferResult.message, !!transferResult.fee && " \xB7 " + transferResult.fee.toLocaleString() + " DC fee"), showConfirm && React__default.createElement(ConfirmModal, {
|
|
5989
|
+
message: feePercent > 0 ? "Transfer " + transferAmount.toLocaleString() + " DC to \"" + recipientName.trim() + "\"? Fee: " + transferFee.toLocaleString() + " DC \xB7 Total: " + transferTotal.toLocaleString() + " DC" : "Transfer " + transferAmount.toLocaleString() + " DC to \"" + recipientName.trim() + "\"?",
|
|
5984
5990
|
onConfirm: handleConfirmTransfer,
|
|
5985
5991
|
onClose: function onClose() {
|
|
5986
5992
|
return setShowConfirm(false);
|
|
@@ -6021,17 +6027,21 @@ var ErrorMessage = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
6021
6027
|
displayName: "DCTransferPanel__ErrorMessage",
|
|
6022
6028
|
componentId: "sc-k1vvb1-6"
|
|
6023
6029
|
})(["font-size:9px !important;color:", " !important;font-family:'Press Start 2P',cursive !important;"], uiColors.red);
|
|
6030
|
+
var FeeDisclosure = /*#__PURE__*/styled__default.p.withConfig({
|
|
6031
|
+
displayName: "DCTransferPanel__FeeDisclosure",
|
|
6032
|
+
componentId: "sc-k1vvb1-7"
|
|
6033
|
+
})(["margin:0;color:rgba(254,240,138,0.65);font-size:7px !important;line-height:1.4 !important;"]);
|
|
6024
6034
|
var AutocompleteWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
6025
6035
|
displayName: "DCTransferPanel__AutocompleteWrapper",
|
|
6026
|
-
componentId: "sc-k1vvb1-
|
|
6036
|
+
componentId: "sc-k1vvb1-8"
|
|
6027
6037
|
})(["position:relative;width:100%;"]);
|
|
6028
6038
|
var DropdownList = /*#__PURE__*/styled__default.ul.withConfig({
|
|
6029
6039
|
displayName: "DCTransferPanel__DropdownList",
|
|
6030
|
-
componentId: "sc-k1vvb1-
|
|
6040
|
+
componentId: "sc-k1vvb1-9"
|
|
6031
6041
|
})(["position:absolute;top:100%;left:0;right:0;background:rgba(10,10,30,0.95);border:1px solid #f59e0b;border-top:none;list-style:none;padding:0;margin:0;max-height:120px;overflow-y:auto;z-index:10;"]);
|
|
6032
6042
|
var DropdownItem = /*#__PURE__*/styled__default.li.withConfig({
|
|
6033
6043
|
displayName: "DCTransferPanel__DropdownItem",
|
|
6034
|
-
componentId: "sc-k1vvb1-
|
|
6044
|
+
componentId: "sc-k1vvb1-10"
|
|
6035
6045
|
})(["padding:6px 8px;font-size:11px;font-family:'Press Start 2P',cursive;color:", ";cursor:pointer;&:hover{background:rgba(245,158,11,0.3);}"], uiColors.white);
|
|
6036
6046
|
|
|
6037
6047
|
var DC_TO_USD$1 = 100;
|
|
@@ -6050,7 +6060,9 @@ var DCWalletContent = function DCWalletContent(_ref) {
|
|
|
6050
6060
|
onInputBlur = _ref.onInputBlur,
|
|
6051
6061
|
onBuyDC = _ref.onBuyDC,
|
|
6052
6062
|
onSearchCharacter = _ref.onSearchCharacter,
|
|
6053
|
-
searchResults = _ref.searchResults
|
|
6063
|
+
searchResults = _ref.searchResults,
|
|
6064
|
+
_ref$feePercent = _ref.feePercent,
|
|
6065
|
+
feePercent = _ref$feePercent === void 0 ? 0 : _ref$feePercent;
|
|
6054
6066
|
var usdValue = (dcBalance / DC_TO_USD$1).toFixed(2);
|
|
6055
6067
|
var tabs = [{
|
|
6056
6068
|
id: 'transfer',
|
|
@@ -6059,6 +6071,7 @@ var DCWalletContent = function DCWalletContent(_ref) {
|
|
|
6059
6071
|
dcBalance: dcBalance,
|
|
6060
6072
|
transferLoading: transferLoading,
|
|
6061
6073
|
transferResult: transferResult,
|
|
6074
|
+
feePercent: feePercent,
|
|
6062
6075
|
onSendTransfer: onSendTransfer,
|
|
6063
6076
|
onClearTransferResult: onClearTransferResult,
|
|
6064
6077
|
characterName: characterName,
|
|
@@ -13063,7 +13076,9 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
13063
13076
|
onMoneyWithdraw = _ref.onMoneyWithdraw,
|
|
13064
13077
|
currentPage = _ref.currentPage,
|
|
13065
13078
|
_ref$dcToGoldSwapRate = _ref.dcToGoldSwapRate,
|
|
13066
|
-
dcToGoldSwapRate = _ref$dcToGoldSwapRate === void 0 ? 0 : _ref$dcToGoldSwapRate
|
|
13079
|
+
dcToGoldSwapRate = _ref$dcToGoldSwapRate === void 0 ? 0 : _ref$dcToGoldSwapRate,
|
|
13080
|
+
_ref$commissionPercen = _ref.commissionPercent,
|
|
13081
|
+
commissionPercent = _ref$commissionPercen === void 0 ? 0 : _ref$commissionPercen;
|
|
13067
13082
|
var _useState = React.useState(''),
|
|
13068
13083
|
price = _useState[0],
|
|
13069
13084
|
setPrice = _useState[1];
|
|
@@ -13081,6 +13096,10 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
13081
13096
|
var _itemsContainer$curre;
|
|
13082
13097
|
(_itemsContainer$curre = itemsContainer.current) == null ? void 0 : _itemsContainer$curre.scrollTo(0, 0);
|
|
13083
13098
|
}, [currentPage]);
|
|
13099
|
+
var parsedPrice = Number(price);
|
|
13100
|
+
var netGoldProceeds = parsedPrice - Math.floor(parsedPrice * commissionPercent);
|
|
13101
|
+
var netDCProceeds = shared.goldToDC(netGoldProceeds);
|
|
13102
|
+
var netProceedsLabel = listingCurrency === shared.MarketplaceAcceptedCurrency.Gold ? netGoldProceeds.toLocaleString() + " gold" : listingCurrency === shared.MarketplaceAcceptedCurrency.Dc ? shared.formatDCAmount(netDCProceeds) + " DC" : netGoldProceeds.toLocaleString() + " gold or " + shared.formatDCAmount(netDCProceeds) + " DC";
|
|
13084
13103
|
return React__default.createElement(React__default.Fragment, null, isCreatingOffer && React__default.createElement(ConfirmModal, {
|
|
13085
13104
|
onClose: setIsCreatingOffer.bind(null, false),
|
|
13086
13105
|
onConfirm: function onConfirm() {
|
|
@@ -13154,7 +13173,7 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
13154
13173
|
setIsCreatingOffer(true);
|
|
13155
13174
|
}
|
|
13156
13175
|
}
|
|
13157
|
-
})), React__default.createElement(CurrencyToggleRow, null, React__default.createElement(CurrencyToggleLabel, null, "Accept:"), LISTING_CURRENCY_OPTIONS.map(function (opt) {
|
|
13176
|
+
})), commissionPercent > 0 && React__default.createElement(FeeDisclosure$1, null, commissionPercent * 100, "% marketplace commission is deducted from seller proceeds."), price && Number(price) > 0 && commissionPercent > 0 && React__default.createElement(NetProceeds, null, "You'll receive: ", netProceedsLabel, ' ', "(after ", commissionPercent * 100, "% commission)"), React__default.createElement(CurrencyToggleRow, null, React__default.createElement(CurrencyToggleLabel, null, "Accept:"), LISTING_CURRENCY_OPTIONS.map(function (opt) {
|
|
13158
13177
|
return React__default.createElement(CurrencyToggleButton, {
|
|
13159
13178
|
key: opt.value,
|
|
13160
13179
|
"$active": listingCurrency === opt.value,
|
|
@@ -13239,48 +13258,56 @@ var SellDescription = /*#__PURE__*/styled__default.p.withConfig({
|
|
|
13239
13258
|
var PriceInputWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
13240
13259
|
displayName: "ManagmentPanel__PriceInputWrapper",
|
|
13241
13260
|
componentId: "sc-1yyi6jn-5"
|
|
13242
|
-
})(["display:flex;flex-direction:column;flex-grow:1
|
|
13261
|
+
})(["display:flex;flex-direction:column;flex-grow:1;> p:first-child{margin:0 0 8px 0;font-size:0.6rem;color:#888;text-transform:uppercase;letter-spacing:0.5px;}.price-input{width:60px;height:32px;flex-grow:1;font-size:0.7rem;}.offer-btn{padding:10px 14px;height:32px;}"]);
|
|
13262
|
+
var NetProceeds = /*#__PURE__*/styled__default.p.withConfig({
|
|
13263
|
+
displayName: "ManagmentPanel__NetProceeds",
|
|
13264
|
+
componentId: "sc-1yyi6jn-6"
|
|
13265
|
+
})(["margin:8px 0 0;color:#fef08a;font-size:8px !important;line-height:1.5 !important;"]);
|
|
13266
|
+
var FeeDisclosure$1 = /*#__PURE__*/styled__default.p.withConfig({
|
|
13267
|
+
displayName: "ManagmentPanel__FeeDisclosure",
|
|
13268
|
+
componentId: "sc-1yyi6jn-7"
|
|
13269
|
+
})(["margin:6px 0 0;color:rgba(254,240,138,0.65);font-size:7px !important;line-height:1.4 !important;"]);
|
|
13243
13270
|
var GoldIcon$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
13244
13271
|
displayName: "ManagmentPanel__GoldIcon",
|
|
13245
|
-
componentId: "sc-1yyi6jn-
|
|
13272
|
+
componentId: "sc-1yyi6jn-8"
|
|
13246
13273
|
})(["position:relative;display:flex;align-items:center;justify-content:center;width:20px;height:20px;margin-right:4px;flex-shrink:0;top:-0.5rem;left:-0.5rem;"]);
|
|
13247
13274
|
var WealthWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
13248
13275
|
displayName: "ManagmentPanel__WealthWrapper",
|
|
13249
|
-
componentId: "sc-1yyi6jn-
|
|
13276
|
+
componentId: "sc-1yyi6jn-9"
|
|
13250
13277
|
})(["display:flex;flex-direction:column;gap:8px;flex-grow:1;& > :last-child{margin-top:auto;}"]);
|
|
13251
13278
|
var BalanceRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
13252
13279
|
displayName: "ManagmentPanel__BalanceRow",
|
|
13253
|
-
componentId: "sc-1yyi6jn-
|
|
13280
|
+
componentId: "sc-1yyi6jn-10"
|
|
13254
13281
|
})(["display:flex;align-items:center;justify-content:flex-end;gap:10px;background:rgba(0,0,0,0.3);border-radius:4px;border:1px solid rgba(255,255,255,0.05);padding:8px 12px;"]);
|
|
13255
13282
|
var BalanceAmount$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
13256
13283
|
displayName: "ManagmentPanel__BalanceAmount",
|
|
13257
|
-
componentId: "sc-1yyi6jn-
|
|
13284
|
+
componentId: "sc-1yyi6jn-11"
|
|
13258
13285
|
})(["font-family:'Press Start 2P',cursive;font-size:0.8rem;color:", ";text-shadow:0 2px 4px rgba(0,0,0,0.5);margin-left:auto;"], function (props) {
|
|
13259
13286
|
return props.$disabled ? uiColors.lightGray : '#fef08a';
|
|
13260
13287
|
});
|
|
13261
13288
|
var BalanceCurrencyLabel = /*#__PURE__*/styled__default.span.withConfig({
|
|
13262
13289
|
displayName: "ManagmentPanel__BalanceCurrencyLabel",
|
|
13263
|
-
componentId: "sc-1yyi6jn-
|
|
13290
|
+
componentId: "sc-1yyi6jn-12"
|
|
13264
13291
|
})(["font-size:0.5rem;color:#888;text-transform:uppercase;letter-spacing:0.5px;min-width:45px;text-align:right;"]);
|
|
13265
13292
|
var ItemComponentScrollWrapper$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
13266
13293
|
displayName: "ManagmentPanel__ItemComponentScrollWrapper",
|
|
13267
|
-
componentId: "sc-1yyi6jn-
|
|
13294
|
+
componentId: "sc-1yyi6jn-13"
|
|
13268
13295
|
})(["overflow-y:scroll;overflow-x:hidden;height:335px;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:195px;}"]);
|
|
13269
13296
|
var SmallCTAButton = /*#__PURE__*/styled__default(CTAButton).withConfig({
|
|
13270
13297
|
displayName: "ManagmentPanel__SmallCTAButton",
|
|
13271
|
-
componentId: "sc-1yyi6jn-
|
|
13298
|
+
componentId: "sc-1yyi6jn-14"
|
|
13272
13299
|
})(["padding:8px 12px;height:32px;span{font-size:0.65rem;}svg{font-size:1.1rem;}"]);
|
|
13273
13300
|
var CurrencyToggleRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
13274
13301
|
displayName: "ManagmentPanel__CurrencyToggleRow",
|
|
13275
|
-
componentId: "sc-1yyi6jn-
|
|
13302
|
+
componentId: "sc-1yyi6jn-15"
|
|
13276
13303
|
})(["display:flex;align-items:center;gap:6px;margin-top:8px;"]);
|
|
13277
13304
|
var CurrencyToggleLabel = /*#__PURE__*/styled__default.span.withConfig({
|
|
13278
13305
|
displayName: "ManagmentPanel__CurrencyToggleLabel",
|
|
13279
|
-
componentId: "sc-1yyi6jn-
|
|
13306
|
+
componentId: "sc-1yyi6jn-16"
|
|
13280
13307
|
})(["font-size:0.5rem;color:#888;text-transform:uppercase;letter-spacing:0.5px;white-space:nowrap;"]);
|
|
13281
13308
|
var CurrencyToggleButton = /*#__PURE__*/styled__default.button.withConfig({
|
|
13282
13309
|
displayName: "ManagmentPanel__CurrencyToggleButton",
|
|
13283
|
-
componentId: "sc-1yyi6jn-
|
|
13310
|
+
componentId: "sc-1yyi6jn-17"
|
|
13284
13311
|
})(["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) {
|
|
13285
13312
|
var $active = _ref3.$active;
|
|
13286
13313
|
return $active ? '#f59e0b' : 'rgba(255,255,255,0.15)';
|
|
@@ -13299,7 +13326,7 @@ var CurrencyToggleButton = /*#__PURE__*/styled__default.button.withConfig({
|
|
|
13299
13326
|
});
|
|
13300
13327
|
var DCPreview = /*#__PURE__*/styled__default.span.withConfig({
|
|
13301
13328
|
displayName: "ManagmentPanel__DCPreview",
|
|
13302
|
-
componentId: "sc-1yyi6jn-
|
|
13329
|
+
componentId: "sc-1yyi6jn-18"
|
|
13303
13330
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.4rem !important;color:rgba(167,139,250,0.8) !important;white-space:nowrap;margin-left:auto;"]);
|
|
13304
13331
|
|
|
13305
13332
|
var CURRENCY_OPTIONS = [{
|
|
@@ -13942,7 +13969,9 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
|
|
|
13942
13969
|
characterAtlasIMG = _ref.characterAtlasIMG,
|
|
13943
13970
|
onCharacterList = _ref.onCharacterList,
|
|
13944
13971
|
enableHotkeys = _ref.enableHotkeys,
|
|
13945
|
-
disableHotkeys = _ref.disableHotkeys
|
|
13972
|
+
disableHotkeys = _ref.disableHotkeys,
|
|
13973
|
+
_ref$commissionPercen = _ref.commissionPercent,
|
|
13974
|
+
commissionPercent = _ref$commissionPercen === void 0 ? 0 : _ref$commissionPercen;
|
|
13946
13975
|
var _useState = React.useState(null),
|
|
13947
13976
|
selectedId = _useState[0],
|
|
13948
13977
|
setSelectedId = _useState[1];
|
|
@@ -14060,7 +14089,7 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
|
|
|
14060
14089
|
centered: true
|
|
14061
14090
|
})), React__default.createElement(PricePreviewAmount, null, React__default.createElement(MMORPGNumber, {
|
|
14062
14091
|
value: Number(price)
|
|
14063
|
-
}), " DC")), React__default.createElement(DCRateStrip, null)))));
|
|
14092
|
+
}), " DC")), price && Number(price) > 0 && commissionPercent > 0 && React__default.createElement(NetProceeds$1, null, "You'll receive:", ' ', (Number(price) - Math.floor(Number(price) * commissionPercent)).toLocaleString(), " DC", ' ', "(after ", commissionPercent * 100, "% commission)"), React__default.createElement(DCRateStrip, null)))));
|
|
14064
14093
|
};
|
|
14065
14094
|
var scaleIn$3 = /*#__PURE__*/styled.keyframes(["from{transform:scale(0.85);opacity:0;}to{transform:scale(1);opacity:1;}"]);
|
|
14066
14095
|
var Overlay$8 = /*#__PURE__*/styled__default.div.withConfig({
|
|
@@ -14075,25 +14104,29 @@ var ModalContent$6 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
14075
14104
|
displayName: "CharacterListingModal__ModalContent",
|
|
14076
14105
|
componentId: "sc-1uxkx35-2"
|
|
14077
14106
|
})(["background:#1a1a2e;border:2px solid #f59e0b;border-radius:8px;padding:20px 24px;width:440px;max-width:92%;max-height:80dvh;display:flex;flex-direction:column;gap:16px;overflow:hidden;pointer-events:auto;animation:", " 0.15s ease-out;"], scaleIn$3);
|
|
14107
|
+
var NetProceeds$1 = /*#__PURE__*/styled__default.p.withConfig({
|
|
14108
|
+
displayName: "CharacterListingModal__NetProceeds",
|
|
14109
|
+
componentId: "sc-1uxkx35-3"
|
|
14110
|
+
})(["margin:0;color:#fef08a;font-size:8px !important;line-height:1.5 !important;"]);
|
|
14078
14111
|
var Header$c = /*#__PURE__*/styled__default.div.withConfig({
|
|
14079
14112
|
displayName: "CharacterListingModal__Header",
|
|
14080
|
-
componentId: "sc-1uxkx35-
|
|
14113
|
+
componentId: "sc-1uxkx35-4"
|
|
14081
14114
|
})(["display:flex;align-items:center;justify-content:space-between;"]);
|
|
14082
14115
|
var Title$d = /*#__PURE__*/styled__default.h3.withConfig({
|
|
14083
14116
|
displayName: "CharacterListingModal__Title",
|
|
14084
|
-
componentId: "sc-1uxkx35-
|
|
14117
|
+
componentId: "sc-1uxkx35-5"
|
|
14085
14118
|
})(["margin:0;font-family:'Press Start 2P',cursive !important;font-size:0.65rem !important;color:#fef08a !important;"]);
|
|
14086
14119
|
var CloseButton$f = /*#__PURE__*/styled__default.button.withConfig({
|
|
14087
14120
|
displayName: "CharacterListingModal__CloseButton",
|
|
14088
|
-
componentId: "sc-1uxkx35-
|
|
14121
|
+
componentId: "sc-1uxkx35-6"
|
|
14089
14122
|
})(["background:none;border:none;color:rgba(255,255,255,0.6);cursor:pointer;font-size:1rem;padding:4px;display:flex;align-items:center;pointer-events:auto;&:hover{color:#ffffff;}"]);
|
|
14090
14123
|
var CharacterList$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
14091
14124
|
displayName: "CharacterListingModal__CharacterList",
|
|
14092
|
-
componentId: "sc-1uxkx35-
|
|
14125
|
+
componentId: "sc-1uxkx35-7"
|
|
14093
14126
|
})(["display:flex;flex-direction:column;gap:6px;overflow-y:auto;max-height:260px;padding:2px;&::-webkit-scrollbar{width:6px;}&::-webkit-scrollbar-track{background:rgba(0,0,0,0.2);border-radius:4px;}&::-webkit-scrollbar-thumb{background:rgba(245,158,11,0.3);border-radius:4px;}"]);
|
|
14094
14127
|
var CharacterRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
14095
14128
|
displayName: "CharacterListingModal__CharacterRow",
|
|
14096
|
-
componentId: "sc-1uxkx35-
|
|
14129
|
+
componentId: "sc-1uxkx35-8"
|
|
14097
14130
|
})(["display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid ", ";border-radius:6px;background:", ";cursor:", ";opacity:", ";transition:border-color 0.15s,background 0.15s;&:hover{border-color:", ";background:", ";}&:focus-visible{outline:2px solid rgba(245,158,11,0.6);outline-offset:2px;}"], function (_ref2) {
|
|
14098
14131
|
var $selected = _ref2.$selected,
|
|
14099
14132
|
$disabled = _ref2.$disabled;
|
|
@@ -14119,7 +14152,7 @@ var CharacterRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
14119
14152
|
});
|
|
14120
14153
|
var RadioCircle$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
14121
14154
|
displayName: "CharacterListingModal__RadioCircle",
|
|
14122
|
-
componentId: "sc-1uxkx35-
|
|
14155
|
+
componentId: "sc-1uxkx35-9"
|
|
14123
14156
|
})(["width:14px;height:14px;border-radius:50%;border:2px solid ", ";flex-shrink:0;display:flex;align-items:center;justify-content:center;&::after{content:'';width:6px;height:6px;border-radius:50%;background:", ";opacity:", ";transition:opacity 0.15s;}"], function (_ref8) {
|
|
14124
14157
|
var $selected = _ref8.$selected,
|
|
14125
14158
|
$disabled = _ref8.$disabled;
|
|
@@ -14133,55 +14166,55 @@ var RadioCircle$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
14133
14166
|
});
|
|
14134
14167
|
var ActiveTag = /*#__PURE__*/styled__default.span.withConfig({
|
|
14135
14168
|
displayName: "CharacterListingModal__ActiveTag",
|
|
14136
|
-
componentId: "sc-1uxkx35-
|
|
14169
|
+
componentId: "sc-1uxkx35-10"
|
|
14137
14170
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.35rem !important;color:#666 !important;background:rgba(255,255,255,0.06);padding:3px 6px;border-radius:3px;white-space:nowrap;margin-left:auto;"]);
|
|
14138
14171
|
var SpriteWrapper$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
14139
14172
|
displayName: "CharacterListingModal__SpriteWrapper",
|
|
14140
|
-
componentId: "sc-1uxkx35-
|
|
14173
|
+
componentId: "sc-1uxkx35-11"
|
|
14141
14174
|
})(["display:flex;align-items:center;justify-content:center;image-rendering:pixelated;flex-shrink:0;width:40px;height:40px;"]);
|
|
14142
14175
|
var CharacterInfo$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
14143
14176
|
displayName: "CharacterListingModal__CharacterInfo",
|
|
14144
|
-
componentId: "sc-1uxkx35-
|
|
14177
|
+
componentId: "sc-1uxkx35-12"
|
|
14145
14178
|
})(["display:flex;flex-direction:column;gap:4px;flex:1;"]);
|
|
14146
14179
|
var CharacterName$3 = /*#__PURE__*/styled__default.span.withConfig({
|
|
14147
14180
|
displayName: "CharacterListingModal__CharacterName",
|
|
14148
|
-
componentId: "sc-1uxkx35-
|
|
14181
|
+
componentId: "sc-1uxkx35-13"
|
|
14149
14182
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.5rem !important;color:#f3f4f6 !important;"]);
|
|
14150
14183
|
var CharacterMeta$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
14151
14184
|
displayName: "CharacterListingModal__CharacterMeta",
|
|
14152
|
-
componentId: "sc-1uxkx35-
|
|
14185
|
+
componentId: "sc-1uxkx35-14"
|
|
14153
14186
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.4rem !important;color:#888 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
14154
14187
|
var PricePreview = /*#__PURE__*/styled__default.div.withConfig({
|
|
14155
14188
|
displayName: "CharacterListingModal__PricePreview",
|
|
14156
|
-
componentId: "sc-1uxkx35-
|
|
14189
|
+
componentId: "sc-1uxkx35-15"
|
|
14157
14190
|
})(["display:flex;align-items:center;gap:6px;"]);
|
|
14158
14191
|
var DCCoinWrapper$4 = /*#__PURE__*/styled__default.span.withConfig({
|
|
14159
14192
|
displayName: "CharacterListingModal__DCCoinWrapper",
|
|
14160
|
-
componentId: "sc-1uxkx35-
|
|
14193
|
+
componentId: "sc-1uxkx35-16"
|
|
14161
14194
|
})(["display:flex;align-items:center;justify-content:center;flex-shrink:0;"]);
|
|
14162
14195
|
var PricePreviewAmount = /*#__PURE__*/styled__default.span.withConfig({
|
|
14163
14196
|
displayName: "CharacterListingModal__PricePreviewAmount",
|
|
14164
|
-
componentId: "sc-1uxkx35-
|
|
14197
|
+
componentId: "sc-1uxkx35-17"
|
|
14165
14198
|
})(["font-family:'Press Start 2P',cursive !important;font-size:0.55rem !important;color:#fef08a !important;"]);
|
|
14166
14199
|
var PriceSection$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
14167
14200
|
displayName: "CharacterListingModal__PriceSection",
|
|
14168
|
-
componentId: "sc-1uxkx35-
|
|
14201
|
+
componentId: "sc-1uxkx35-18"
|
|
14169
14202
|
})(["display:flex;flex-direction:column;gap:8px;border-top:1px solid rgba(255,255,255,0.06);padding-top:12px;"]);
|
|
14170
14203
|
var PriceLabel = /*#__PURE__*/styled__default.p.withConfig({
|
|
14171
14204
|
displayName: "CharacterListingModal__PriceLabel",
|
|
14172
|
-
componentId: "sc-1uxkx35-
|
|
14205
|
+
componentId: "sc-1uxkx35-19"
|
|
14173
14206
|
})(["margin:0;font-family:'Press Start 2P',cursive !important;font-size:0.55rem !important;color:#888 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
|
|
14174
14207
|
var PriceRow$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
14175
14208
|
displayName: "CharacterListingModal__PriceRow",
|
|
14176
|
-
componentId: "sc-1uxkx35-
|
|
14209
|
+
componentId: "sc-1uxkx35-20"
|
|
14177
14210
|
})(["display:flex;gap:8px;align-items:center;.price-input{flex:1;height:12px;}"]);
|
|
14178
14211
|
var ListBtn = /*#__PURE__*/styled__default(CTAButton).withConfig({
|
|
14179
14212
|
displayName: "CharacterListingModal__ListBtn",
|
|
14180
|
-
componentId: "sc-1uxkx35-
|
|
14213
|
+
componentId: "sc-1uxkx35-21"
|
|
14181
14214
|
})(["flex-shrink:0;padding:10px 16px;height:32px;span{font-size:0.6rem;}svg{font-size:1.1rem;}"]);
|
|
14182
14215
|
var EmptyState$6 = /*#__PURE__*/styled__default.div.withConfig({
|
|
14183
14216
|
displayName: "CharacterListingModal__EmptyState",
|
|
14184
|
-
componentId: "sc-1uxkx35-
|
|
14217
|
+
componentId: "sc-1uxkx35-22"
|
|
14185
14218
|
})(["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;"]);
|
|
14186
14219
|
|
|
14187
14220
|
var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
|
|
@@ -14199,7 +14232,9 @@ var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
|
|
|
14199
14232
|
characterAtlasJSON = _ref.characterAtlasJSON,
|
|
14200
14233
|
characterAtlasIMG = _ref.characterAtlasIMG,
|
|
14201
14234
|
enableHotkeys = _ref.enableHotkeys,
|
|
14202
|
-
disableHotkeys = _ref.disableHotkeys
|
|
14235
|
+
disableHotkeys = _ref.disableHotkeys,
|
|
14236
|
+
_ref$commissionPercen = _ref.commissionPercent,
|
|
14237
|
+
commissionPercent = _ref$commissionPercen === void 0 ? 0 : _ref$commissionPercen;
|
|
14203
14238
|
var _useState = React.useState(null),
|
|
14204
14239
|
delistingId = _useState[0],
|
|
14205
14240
|
setDelistingId = _useState[1];
|
|
@@ -14242,7 +14277,8 @@ var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
|
|
|
14242
14277
|
setIsListingModalOpen(false);
|
|
14243
14278
|
},
|
|
14244
14279
|
enableHotkeys: enableHotkeys,
|
|
14245
|
-
disableHotkeys: disableHotkeys
|
|
14280
|
+
disableHotkeys: disableHotkeys,
|
|
14281
|
+
commissionPercent: commissionPercent
|
|
14246
14282
|
}), React__default.createElement(Toolbar, null, React__default.createElement(ListCharacterBtn, {
|
|
14247
14283
|
icon: React__default.createElement(ShoppingBag.ShoppingBag, {
|
|
14248
14284
|
width: 16,
|
|
@@ -14401,7 +14437,9 @@ var CharacterTradePanel = function CharacterTradePanel(_ref) {
|
|
|
14401
14437
|
characterAtlasJSON = _ref.characterAtlasJSON,
|
|
14402
14438
|
characterAtlasIMG = _ref.characterAtlasIMG,
|
|
14403
14439
|
enableHotkeys = _ref.enableHotkeys,
|
|
14404
|
-
disableHotkeys = _ref.disableHotkeys
|
|
14440
|
+
disableHotkeys = _ref.disableHotkeys,
|
|
14441
|
+
_ref$commissionPercen = _ref.commissionPercent,
|
|
14442
|
+
commissionPercent = _ref$commissionPercen === void 0 ? 0 : _ref$commissionPercen;
|
|
14405
14443
|
var _useState = React.useState('browse'),
|
|
14406
14444
|
subTab = _useState[0],
|
|
14407
14445
|
setSubTab = _useState[1];
|
|
@@ -14448,7 +14486,8 @@ var CharacterTradePanel = function CharacterTradePanel(_ref) {
|
|
|
14448
14486
|
characterAtlasJSON: characterAtlasJSON != null ? characterAtlasJSON : atlasJSON,
|
|
14449
14487
|
characterAtlasIMG: characterAtlasIMG != null ? characterAtlasIMG : atlasIMG,
|
|
14450
14488
|
enableHotkeys: enableHotkeys,
|
|
14451
|
-
disableHotkeys: disableHotkeys
|
|
14489
|
+
disableHotkeys: disableHotkeys,
|
|
14490
|
+
commissionPercent: commissionPercent
|
|
14452
14491
|
}));
|
|
14453
14492
|
};
|
|
14454
14493
|
var CharacterSubTabs = /*#__PURE__*/styled__default.div.withConfig({
|
|
@@ -14668,7 +14707,8 @@ var Marketplace = function Marketplace(props) {
|
|
|
14668
14707
|
characterAtlasJSON: characterAtlasJSON,
|
|
14669
14708
|
characterAtlasIMG: characterAtlasIMG,
|
|
14670
14709
|
enableHotkeys: props.enableHotkeys,
|
|
14671
|
-
disableHotkeys: props.disableHotkeys
|
|
14710
|
+
disableHotkeys: props.disableHotkeys,
|
|
14711
|
+
commissionPercent: props.commissionPercent
|
|
14672
14712
|
}), activeTab === 'sell' && React__default.createElement(ManagmentPanel, Object.assign({}, props, {
|
|
14673
14713
|
acceptedCurrency: acceptedCurrency
|
|
14674
14714
|
})), activeTab === 'buy-orders' && React__default.createElement(React__default.Fragment, null, React__default.createElement(BuyOrderPanel, {
|
|
@@ -38006,6 +38046,17 @@ var CloseLink = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
38006
38046
|
componentId: "sc-18z5q21-16"
|
|
38007
38047
|
})(["font-family:'Press Start 2P',cursive;font-size:0.5rem;color:rgba(255,255,255,0.45);cursor:pointer;display:flex;align-items:center;gap:0.3rem;transition:color 0.15s;&:hover{color:rgba(255,255,255,0.7);}"]);
|
|
38008
38048
|
|
|
38049
|
+
var GENERIC_PURCHASE_FAILED_MESSAGE = 'Purchase failed. Please try again.';
|
|
38050
|
+
var normalizePurchaseResult = function normalizePurchaseResult(result) {
|
|
38051
|
+
if (typeof result === 'boolean') {
|
|
38052
|
+
return result ? {
|
|
38053
|
+
status: 'success'
|
|
38054
|
+
} : {
|
|
38055
|
+
status: 'failed'
|
|
38056
|
+
};
|
|
38057
|
+
}
|
|
38058
|
+
return result;
|
|
38059
|
+
};
|
|
38009
38060
|
var MetadataDisplay = function MetadataDisplay(_ref) {
|
|
38010
38061
|
var type = _ref.type,
|
|
38011
38062
|
metadata = _ref.metadata;
|
|
@@ -38053,7 +38104,7 @@ var CartView = function CartView(_ref2) {
|
|
|
38053
38104
|
};
|
|
38054
38105
|
var handlePurchase = /*#__PURE__*/function () {
|
|
38055
38106
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
38056
|
-
var snapshot, trackItems,
|
|
38107
|
+
var snapshot, trackItems, purchaseResult, _purchaseResult$error, errMsg, _errMsg;
|
|
38057
38108
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38058
38109
|
while (1) switch (_context.prev = _context.next) {
|
|
38059
38110
|
case 0:
|
|
@@ -38069,36 +38120,38 @@ var CartView = function CartView(_ref2) {
|
|
|
38069
38120
|
};
|
|
38070
38121
|
});
|
|
38071
38122
|
onCheckoutStart == null ? void 0 : onCheckoutStart(trackItems, total);
|
|
38072
|
-
_context.
|
|
38123
|
+
_context.t0 = normalizePurchaseResult;
|
|
38124
|
+
_context.next = 9;
|
|
38073
38125
|
return onPurchase();
|
|
38074
|
-
case
|
|
38075
|
-
|
|
38076
|
-
|
|
38126
|
+
case 9:
|
|
38127
|
+
_context.t1 = _context.sent;
|
|
38128
|
+
purchaseResult = (0, _context.t0)(_context.t1);
|
|
38129
|
+
if (purchaseResult.status === 'success') {
|
|
38077
38130
|
onPurchaseSuccess == null ? void 0 : onPurchaseSuccess(trackItems, total);
|
|
38078
38131
|
setPurchasedItems(snapshot);
|
|
38079
|
-
} else {
|
|
38080
|
-
errMsg =
|
|
38132
|
+
} else if (purchaseResult.status === 'failed') {
|
|
38133
|
+
errMsg = (_purchaseResult$error = purchaseResult.error) != null ? _purchaseResult$error : GENERIC_PURCHASE_FAILED_MESSAGE;
|
|
38081
38134
|
onPurchaseError == null ? void 0 : onPurchaseError(errMsg);
|
|
38082
38135
|
setError(errMsg);
|
|
38083
38136
|
}
|
|
38084
|
-
_context.next =
|
|
38137
|
+
_context.next = 20;
|
|
38085
38138
|
break;
|
|
38086
|
-
case
|
|
38087
|
-
_context.prev =
|
|
38088
|
-
_context.
|
|
38139
|
+
case 14:
|
|
38140
|
+
_context.prev = 14;
|
|
38141
|
+
_context.t2 = _context["catch"](0);
|
|
38089
38142
|
_errMsg = 'An error occurred during purchase. Please try again.';
|
|
38090
38143
|
onPurchaseError == null ? void 0 : onPurchaseError(_errMsg);
|
|
38091
38144
|
setError(_errMsg);
|
|
38092
|
-
console.error('Purchase error:', _context.
|
|
38093
|
-
case
|
|
38094
|
-
_context.prev =
|
|
38145
|
+
console.error('Purchase error:', _context.t2);
|
|
38146
|
+
case 20:
|
|
38147
|
+
_context.prev = 20;
|
|
38095
38148
|
setIsLoading(false);
|
|
38096
|
-
return _context.finish(
|
|
38097
|
-
case
|
|
38149
|
+
return _context.finish(20);
|
|
38150
|
+
case 23:
|
|
38098
38151
|
case "end":
|
|
38099
38152
|
return _context.stop();
|
|
38100
38153
|
}
|
|
38101
|
-
}, _callee, null, [[0,
|
|
38154
|
+
}, _callee, null, [[0, 14, 20, 23]]);
|
|
38102
38155
|
}));
|
|
38103
38156
|
return function handlePurchase() {
|
|
38104
38157
|
return _ref3.apply(this, arguments);
|
|
@@ -38617,7 +38670,7 @@ var useStoreCart = function useStoreCart() {
|
|
|
38617
38670
|
};
|
|
38618
38671
|
var handlePurchase = /*#__PURE__*/function () {
|
|
38619
38672
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(onPurchase) {
|
|
38620
|
-
var purchaseUnits, purchase, success;
|
|
38673
|
+
var purchaseUnits, purchase, result, success;
|
|
38621
38674
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
38622
38675
|
while (1) switch (_context2.prev = _context2.next) {
|
|
38623
38676
|
case 0:
|
|
@@ -38641,13 +38694,14 @@ var useStoreCart = function useStoreCart() {
|
|
|
38641
38694
|
_context2.next = 4;
|
|
38642
38695
|
return onPurchase(purchase);
|
|
38643
38696
|
case 4:
|
|
38644
|
-
|
|
38697
|
+
result = _context2.sent;
|
|
38698
|
+
success = typeof result === 'boolean' ? result : result.status === 'success';
|
|
38645
38699
|
if (success && isMounted.current) {
|
|
38646
38700
|
setCartItems([]);
|
|
38647
38701
|
setIsCartOpen(false);
|
|
38648
38702
|
}
|
|
38649
|
-
return _context2.abrupt("return",
|
|
38650
|
-
case
|
|
38703
|
+
return _context2.abrupt("return", result);
|
|
38704
|
+
case 8:
|
|
38651
38705
|
case "end":
|
|
38652
38706
|
return _context2.stop();
|
|
38653
38707
|
}
|
|
@@ -38781,7 +38835,9 @@ var PaymentMethodModal = function PaymentMethodModal(_ref) {
|
|
|
38781
38835
|
onPayWithPix = _ref.onPayWithPix,
|
|
38782
38836
|
onClose = _ref.onClose,
|
|
38783
38837
|
_ref$showPix = _ref.showPix,
|
|
38784
|
-
showPix = _ref$showPix === void 0 ? false : _ref$showPix
|
|
38838
|
+
showPix = _ref$showPix === void 0 ? false : _ref$showPix,
|
|
38839
|
+
_ref$isProcessing = _ref.isProcessing,
|
|
38840
|
+
isProcessing = _ref$isProcessing === void 0 ? false : _ref$isProcessing;
|
|
38785
38841
|
var _useState = React.useState('card'),
|
|
38786
38842
|
selected = _useState[0],
|
|
38787
38843
|
setSelected = _useState[1];
|
|
@@ -38795,6 +38851,7 @@ var PaymentMethodModal = function PaymentMethodModal(_ref) {
|
|
|
38795
38851
|
e.stopPropagation();
|
|
38796
38852
|
}, []);
|
|
38797
38853
|
var handleConfirm = React.useCallback(function () {
|
|
38854
|
+
if (isProcessing) return;
|
|
38798
38855
|
if (selected === 'dc' && !dcDisabled) {
|
|
38799
38856
|
onPayWithDC();
|
|
38800
38857
|
} else if (selected === 'pix') {
|
|
@@ -38802,7 +38859,10 @@ var PaymentMethodModal = function PaymentMethodModal(_ref) {
|
|
|
38802
38859
|
} else {
|
|
38803
38860
|
onPayWithCard();
|
|
38804
38861
|
}
|
|
38805
|
-
}, [selected, dcDisabled, onPayWithDC, onPayWithCard, onPayWithPix]);
|
|
38862
|
+
}, [selected, dcDisabled, isProcessing, onPayWithDC, onPayWithCard, onPayWithPix]);
|
|
38863
|
+
var handleClose = React.useCallback(function () {
|
|
38864
|
+
if (!isProcessing) onClose();
|
|
38865
|
+
}, [isProcessing, onClose]);
|
|
38806
38866
|
var dcSubText = dcRequired !== undefined ? React__default.createElement(React__default.Fragment, null, React__default.createElement(MMORPGNumber, {
|
|
38807
38867
|
value: dcBalance
|
|
38808
38868
|
}), " DC available \xB7", ' ', React__default.createElement(MMORPGNumber, {
|
|
@@ -38811,40 +38871,44 @@ var PaymentMethodModal = function PaymentMethodModal(_ref) {
|
|
|
38811
38871
|
value: dcBalance
|
|
38812
38872
|
}), " DC available");
|
|
38813
38873
|
return React__default.createElement(ModalPortal, null, React__default.createElement(Overlay$b, {
|
|
38814
|
-
onPointerDown:
|
|
38874
|
+
onPointerDown: handleClose
|
|
38815
38875
|
}), React__default.createElement(ModalContainer$8, null, React__default.createElement(ModalContent$8, {
|
|
38816
38876
|
onClick: stopPropagation,
|
|
38817
38877
|
onTouchStart: stopPropagation,
|
|
38818
38878
|
onPointerDown: stopPropagation
|
|
38819
38879
|
}, React__default.createElement(Header$i, null, React__default.createElement(Title$p, null, "How would you like to pay?"), React__default.createElement(CloseButton$j, {
|
|
38820
|
-
onPointerDown:
|
|
38821
|
-
"aria-label": "Close"
|
|
38880
|
+
onPointerDown: handleClose,
|
|
38881
|
+
"aria-label": "Close",
|
|
38882
|
+
disabled: isProcessing
|
|
38822
38883
|
}, React__default.createElement(Cancel.Cancel, null))), React__default.createElement(Options$1, null, React__default.createElement(RadioOption$2, {
|
|
38823
38884
|
"$selected": selected === 'card',
|
|
38824
|
-
|
|
38885
|
+
"$disabled": isProcessing,
|
|
38886
|
+
onPointerDown: isProcessing ? undefined : function () {
|
|
38825
38887
|
return setSelected('card');
|
|
38826
38888
|
}
|
|
38827
38889
|
}, React__default.createElement(RadioCircle$3, {
|
|
38828
38890
|
"$selected": selected === 'card'
|
|
38829
38891
|
}), React__default.createElement(OptionText$1, null, React__default.createElement(OptionLabel$2, null, "Credit Card"), React__default.createElement(OptionSub$1, null, "Stripe secure checkout"))), showPix && React__default.createElement(RadioOption$2, {
|
|
38830
38892
|
"$selected": selected === 'pix',
|
|
38831
|
-
|
|
38893
|
+
"$disabled": isProcessing,
|
|
38894
|
+
onPointerDown: isProcessing ? undefined : function () {
|
|
38832
38895
|
return setSelected('pix');
|
|
38833
38896
|
}
|
|
38834
38897
|
}, React__default.createElement(RadioCircle$3, {
|
|
38835
38898
|
"$selected": selected === 'pix'
|
|
38836
38899
|
}), React__default.createElement(OptionText$1, null, React__default.createElement(OptionLabel$2, null, "Pix"), React__default.createElement(OptionSub$1, null, "Instant payment via Pix"))), React__default.createElement(RadioOption$2, {
|
|
38837
38900
|
"$selected": selected === 'dc',
|
|
38838
|
-
"$disabled": dcDisabled,
|
|
38839
|
-
onPointerDown: dcDisabled ? undefined : function () {
|
|
38901
|
+
"$disabled": dcDisabled || isProcessing,
|
|
38902
|
+
onPointerDown: dcDisabled || isProcessing ? undefined : function () {
|
|
38840
38903
|
return setSelected('dc');
|
|
38841
38904
|
}
|
|
38842
38905
|
}, React__default.createElement(RadioCircle$3, {
|
|
38843
38906
|
"$selected": selected === 'dc'
|
|
38844
38907
|
}), React__default.createElement(OptionText$1, null, React__default.createElement(OptionLabel$2, null, "Definya Coin"), React__default.createElement(OptionSub$1, null, dcSubText)))), React__default.createElement(ConfirmRow$1, null, React__default.createElement(Button, {
|
|
38845
38908
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
38846
|
-
onPointerDown: handleConfirm
|
|
38847
|
-
|
|
38909
|
+
onPointerDown: handleConfirm,
|
|
38910
|
+
disabled: isProcessing
|
|
38911
|
+
}, isProcessing ? 'Processing...' : 'Confirm')))));
|
|
38848
38912
|
};
|
|
38849
38913
|
var Overlay$b = /*#__PURE__*/styled__default.div.withConfig({
|
|
38850
38914
|
displayName: "PaymentMethodModal__Overlay",
|