@rpg-engine/long-bow 0.8.198 → 0.8.200
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/Store/Store.d.ts +11 -1
- package/dist/components/Store/sections/StoreRedeemSection.d.ts +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +207 -20
- 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 +208 -22
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Marketplace/BuyPanel.tsx +4 -3
- package/src/components/Marketplace/__test__/BuyPanel.spec.tsx +45 -3
- package/src/components/Store/Store.tsx +29 -5
- package/src/components/Store/__test__/Store.spec.tsx +191 -0
- package/src/components/Store/__test__/StoreRedeemSection.spec.tsx +232 -0
- package/src/components/Store/sections/StoreRedeemSection.tsx +258 -0
- package/src/index.tsx +1 -0
- package/src/stories/Features/store/Store.stories.tsx +62 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IItemPack, IPurchase, IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { IFeaturedItem } from './FeaturedBanner';
|
|
4
|
-
declare type TabId = 'premium' | 'packs' | 'items' | 'wallet' | 'history';
|
|
4
|
+
declare type TabId = 'premium' | 'packs' | 'items' | 'wallet' | 'history' | 'redeem';
|
|
5
5
|
export interface IStoreProps {
|
|
6
6
|
items: IProductBlueprint[];
|
|
7
7
|
packs?: IItemPack[];
|
|
@@ -72,6 +72,16 @@ export interface IStoreProps {
|
|
|
72
72
|
onBuyDC?: () => void;
|
|
73
73
|
/** Currency symbol to display (e.g. "$" for USD, "R$" for BRL). Defaults to "$". */
|
|
74
74
|
currencySymbol?: string;
|
|
75
|
+
/** Callback to redeem a voucher code. When provided, the Redeem tab is shown. */
|
|
76
|
+
onRedeem?: (code: string) => Promise<{
|
|
77
|
+
success: boolean;
|
|
78
|
+
dcAmount?: number;
|
|
79
|
+
error?: string;
|
|
80
|
+
}>;
|
|
81
|
+
/** Called when the voucher code input gains focus. */
|
|
82
|
+
onRedeemInputFocus?: () => void;
|
|
83
|
+
/** Called when the voucher code input loses focus. */
|
|
84
|
+
onRedeemInputBlur?: () => void;
|
|
75
85
|
}
|
|
76
86
|
export type { IFeaturedItem };
|
|
77
87
|
export declare const Store: React.FC<IStoreProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IStoreRedeemSectionProps {
|
|
3
|
+
onRedeem: (code: string) => Promise<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
dcAmount?: number;
|
|
6
|
+
error?: string;
|
|
7
|
+
}>;
|
|
8
|
+
onInputFocus?: () => void;
|
|
9
|
+
onInputBlur?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const StoreRedeemSection: React.FC<IStoreRedeemSectionProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export * from './components/Store/PaymentMethodModal';
|
|
|
85
85
|
export * from './components/Store/PurchaseSuccess';
|
|
86
86
|
export * from './components/Store/Store';
|
|
87
87
|
export * from './components/Store/StoreBadges';
|
|
88
|
+
export * from './components/Store/sections/StoreRedeemSection';
|
|
88
89
|
export * from './components/Store/TrustBar';
|
|
89
90
|
export * from './components/Table/Table';
|
|
90
91
|
export * from './components/TextArea';
|
|
@@ -46184,6 +46184,8 @@ var orderByOptions = /*#__PURE__*/Object.values(OrderByType).flatMap(function (o
|
|
|
46184
46184
|
});
|
|
46185
46185
|
|
|
46186
46186
|
var BUY_REQUESTS_PER_PAGE = 5;
|
|
46187
|
+
var MARKETPLACE_PANEL_HEIGHT = '390px';
|
|
46188
|
+
var MARKETPLACE_PANEL_MOBILE_HEIGHT = '250px';
|
|
46187
46189
|
var formatBlueprintKey$1 = function formatBlueprintKey(key) {
|
|
46188
46190
|
var name = key.includes('/') ? key.split('/').pop() : key;
|
|
46189
46191
|
return name.replace(/[-_]/g, ' ').replace(/\b\w/g, function (c) {
|
|
@@ -46602,7 +46604,7 @@ var WrapperContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
46602
46604
|
var ItemComponentScrollWrapper$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
46603
46605
|
displayName: "BuyPanel__ItemComponentScrollWrapper",
|
|
46604
46606
|
componentId: "sc-1si8t7i-7"
|
|
46605
|
-
})(["display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;
|
|
46607
|
+
})(["display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;height:", ";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:", ";}"], MARKETPLACE_PANEL_HEIGHT, MARKETPLACE_PANEL_MOBILE_HEIGHT);
|
|
46606
46608
|
var MarketSection = /*#__PURE__*/styled__default.div.withConfig({
|
|
46607
46609
|
displayName: "BuyPanel__MarketSection",
|
|
46608
46610
|
componentId: "sc-1si8t7i-8"
|
|
@@ -73180,6 +73182,173 @@ var QuantityInput$1 = /*#__PURE__*/styled__default.input.withConfig({
|
|
|
73180
73182
|
componentId: "sc-ulazq3-11"
|
|
73181
73183
|
})(["width:40px;text-align:center;margin:0 auto;font-size:0.875rem;background:rgba(0,0,0,0.2);color:#ffffff;border:none;padding:0.25rem;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}"]);
|
|
73182
73184
|
|
|
73185
|
+
var StoreRedeemSection = function StoreRedeemSection(_ref) {
|
|
73186
|
+
var onRedeem = _ref.onRedeem,
|
|
73187
|
+
onInputFocus = _ref.onInputFocus,
|
|
73188
|
+
onInputBlur = _ref.onInputBlur;
|
|
73189
|
+
var _useState = React.useState(''),
|
|
73190
|
+
code = _useState[0],
|
|
73191
|
+
setCode = _useState[1];
|
|
73192
|
+
var _useState2 = React.useState('idle'),
|
|
73193
|
+
status = _useState2[0],
|
|
73194
|
+
setStatus = _useState2[1];
|
|
73195
|
+
var _useState3 = React.useState(),
|
|
73196
|
+
dcAmount = _useState3[0],
|
|
73197
|
+
setDcAmount = _useState3[1];
|
|
73198
|
+
var _useState4 = React.useState(''),
|
|
73199
|
+
errorMessage = _useState4[0],
|
|
73200
|
+
setErrorMessage = _useState4[1];
|
|
73201
|
+
var canSubmit = code.trim().length > 0 && status !== 'loading';
|
|
73202
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
73203
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
73204
|
+
var normalizedCode, result, _result$error;
|
|
73205
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
73206
|
+
while (1) switch (_context.prev = _context.next) {
|
|
73207
|
+
case 0:
|
|
73208
|
+
if (canSubmit) {
|
|
73209
|
+
_context.next = 2;
|
|
73210
|
+
break;
|
|
73211
|
+
}
|
|
73212
|
+
return _context.abrupt("return");
|
|
73213
|
+
case 2:
|
|
73214
|
+
normalizedCode = code.trim().toUpperCase();
|
|
73215
|
+
setStatus('loading');
|
|
73216
|
+
setErrorMessage('');
|
|
73217
|
+
_context.prev = 5;
|
|
73218
|
+
_context.next = 8;
|
|
73219
|
+
return onRedeem(normalizedCode);
|
|
73220
|
+
case 8:
|
|
73221
|
+
result = _context.sent;
|
|
73222
|
+
if (result.success) {
|
|
73223
|
+
setStatus('success');
|
|
73224
|
+
setDcAmount(result.dcAmount);
|
|
73225
|
+
} else {
|
|
73226
|
+
setStatus('error');
|
|
73227
|
+
setErrorMessage((_result$error = result.error) != null ? _result$error : 'Redemption failed. Please try again.');
|
|
73228
|
+
}
|
|
73229
|
+
_context.next = 16;
|
|
73230
|
+
break;
|
|
73231
|
+
case 12:
|
|
73232
|
+
_context.prev = 12;
|
|
73233
|
+
_context.t0 = _context["catch"](5);
|
|
73234
|
+
setStatus('error');
|
|
73235
|
+
setErrorMessage('Something went wrong. Please try again.');
|
|
73236
|
+
case 16:
|
|
73237
|
+
case "end":
|
|
73238
|
+
return _context.stop();
|
|
73239
|
+
}
|
|
73240
|
+
}, _callee, null, [[5, 12]]);
|
|
73241
|
+
}));
|
|
73242
|
+
return function handleSubmit() {
|
|
73243
|
+
return _ref2.apply(this, arguments);
|
|
73244
|
+
};
|
|
73245
|
+
}();
|
|
73246
|
+
var handleReset = function handleReset() {
|
|
73247
|
+
setCode('');
|
|
73248
|
+
setStatus('idle');
|
|
73249
|
+
setDcAmount(undefined);
|
|
73250
|
+
setErrorMessage('');
|
|
73251
|
+
};
|
|
73252
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
73253
|
+
if (e.key === 'Enter') {
|
|
73254
|
+
void handleSubmit();
|
|
73255
|
+
}
|
|
73256
|
+
};
|
|
73257
|
+
if (status === 'success') {
|
|
73258
|
+
return React__default.createElement(Container$O, null, React__default.createElement(ResultContainer, null, React__default.createElement(SuccessIcon, null, React__default.createElement(fa.FaCheckCircle, {
|
|
73259
|
+
size: 32
|
|
73260
|
+
})), React__default.createElement(SuccessTitle, null, "Code Redeemed!"), dcAmount != null && React__default.createElement(DCAmountDisplay, null, "+", dcAmount.toLocaleString(), " DC"), React__default.createElement(SuccessHint, null, "Your wallet balance has been updated."), React__default.createElement(ButtonWrapper$3, null, React__default.createElement(CTAButton, {
|
|
73261
|
+
icon: React__default.createElement(fa.FaTicketAlt, null),
|
|
73262
|
+
label: "Redeem Another",
|
|
73263
|
+
onClick: handleReset
|
|
73264
|
+
}))));
|
|
73265
|
+
}
|
|
73266
|
+
if (status === 'error') {
|
|
73267
|
+
return React__default.createElement(Container$O, null, React__default.createElement(ResultContainer, null, React__default.createElement(ErrorIcon, null, React__default.createElement(fa.FaExclamationCircle, {
|
|
73268
|
+
size: 32
|
|
73269
|
+
})), React__default.createElement(ErrorTitle, null, errorMessage), React__default.createElement(ButtonWrapper$3, null, React__default.createElement(CTAButton, {
|
|
73270
|
+
icon: React__default.createElement(fa.FaTicketAlt, null),
|
|
73271
|
+
label: "Try Again",
|
|
73272
|
+
onClick: handleReset
|
|
73273
|
+
}))));
|
|
73274
|
+
}
|
|
73275
|
+
return React__default.createElement(Container$O, null, React__default.createElement(Title$p, null, "Redeem a Voucher Code"), React__default.createElement(Description$7, null, "Enter your voucher code below to receive Definya Coins."), React__default.createElement(InputRow, null, React__default.createElement(CodeInput, {
|
|
73276
|
+
type: "text",
|
|
73277
|
+
value: code,
|
|
73278
|
+
onChange: function onChange(e) {
|
|
73279
|
+
return setCode(e.target.value);
|
|
73280
|
+
},
|
|
73281
|
+
onFocus: onInputFocus,
|
|
73282
|
+
onBlur: onInputBlur,
|
|
73283
|
+
onKeyDown: handleKeyDown,
|
|
73284
|
+
placeholder: "Enter code...",
|
|
73285
|
+
disabled: status === 'loading',
|
|
73286
|
+
autoComplete: "off",
|
|
73287
|
+
spellCheck: false
|
|
73288
|
+
})), React__default.createElement(ButtonWrapper$3, null, React__default.createElement(CTAButton, {
|
|
73289
|
+
icon: React__default.createElement(fa.FaTicketAlt, null),
|
|
73290
|
+
label: status === 'loading' ? 'Redeeming...' : 'Redeem Code',
|
|
73291
|
+
onClick: function onClick() {
|
|
73292
|
+
void handleSubmit();
|
|
73293
|
+
},
|
|
73294
|
+
disabled: !canSubmit,
|
|
73295
|
+
fullWidth: true
|
|
73296
|
+
})));
|
|
73297
|
+
};
|
|
73298
|
+
var Container$O = /*#__PURE__*/styled__default.div.withConfig({
|
|
73299
|
+
displayName: "StoreRedeemSection__Container",
|
|
73300
|
+
componentId: "sc-1pzosml-0"
|
|
73301
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1.5rem;max-width:420px;margin:0 auto;gap:1rem;"]);
|
|
73302
|
+
var Title$p = /*#__PURE__*/styled__default.h3.withConfig({
|
|
73303
|
+
displayName: "StoreRedeemSection__Title",
|
|
73304
|
+
componentId: "sc-1pzosml-1"
|
|
73305
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.85rem;color:", ";margin:0;text-align:center;"], uiColors.white);
|
|
73306
|
+
var Description$7 = /*#__PURE__*/styled__default.p.withConfig({
|
|
73307
|
+
displayName: "StoreRedeemSection__Description",
|
|
73308
|
+
componentId: "sc-1pzosml-2"
|
|
73309
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.55rem;color:", ";margin:0;text-align:center;line-height:1.6;"], uiColors.lightGray);
|
|
73310
|
+
var InputRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
73311
|
+
displayName: "StoreRedeemSection__InputRow",
|
|
73312
|
+
componentId: "sc-1pzosml-3"
|
|
73313
|
+
})(["width:100%;"]);
|
|
73314
|
+
var CodeInput = /*#__PURE__*/styled__default.input.withConfig({
|
|
73315
|
+
displayName: "StoreRedeemSection__CodeInput",
|
|
73316
|
+
componentId: "sc-1pzosml-4"
|
|
73317
|
+
})(["width:100%;padding:12px 14px;font-family:'Press Start 2P',cursive;font-size:0.75rem;color:", ";background:rgba(0,0,0,0.4);border:2px solid #f59e0b;border-radius:4px;text-transform:uppercase;letter-spacing:2px;text-align:center;box-sizing:border-box;outline:none;&::placeholder{color:", ";text-transform:none;letter-spacing:0;}&:focus{border-color:#fbbf24;box-shadow:0 0 8px rgba(251,191,36,0.3);}&:disabled{opacity:0.5;cursor:not-allowed;}"], uiColors.white, uiColors.lightGray);
|
|
73318
|
+
var ButtonWrapper$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
73319
|
+
displayName: "StoreRedeemSection__ButtonWrapper",
|
|
73320
|
+
componentId: "sc-1pzosml-5"
|
|
73321
|
+
})(["width:100%;margin-top:0.5rem;"]);
|
|
73322
|
+
var ResultContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
73323
|
+
displayName: "StoreRedeemSection__ResultContainer",
|
|
73324
|
+
componentId: "sc-1pzosml-6"
|
|
73325
|
+
})(["display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem 0;"]);
|
|
73326
|
+
var glowPulse$1 = /*#__PURE__*/styled.keyframes(["0%,100%{opacity:1;}50%{opacity:0.7;}"]);
|
|
73327
|
+
var SuccessIcon = /*#__PURE__*/styled__default.div.withConfig({
|
|
73328
|
+
displayName: "StoreRedeemSection__SuccessIcon",
|
|
73329
|
+
componentId: "sc-1pzosml-7"
|
|
73330
|
+
})(["color:", ";animation:", " 1.5s ease-in-out infinite;"], uiColors.green, glowPulse$1);
|
|
73331
|
+
var SuccessTitle = /*#__PURE__*/styled__default.h3.withConfig({
|
|
73332
|
+
displayName: "StoreRedeemSection__SuccessTitle",
|
|
73333
|
+
componentId: "sc-1pzosml-8"
|
|
73334
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.85rem;color:", ";margin:0;"], uiColors.green);
|
|
73335
|
+
var DCAmountDisplay = /*#__PURE__*/styled__default.div.withConfig({
|
|
73336
|
+
displayName: "StoreRedeemSection__DCAmountDisplay",
|
|
73337
|
+
componentId: "sc-1pzosml-9"
|
|
73338
|
+
})(["font-family:'Press Start 2P',cursive;font-size:1.2rem;color:#fef08a;text-shadow:0 0 10px rgba(254,240,138,0.5);"]);
|
|
73339
|
+
var SuccessHint = /*#__PURE__*/styled__default.p.withConfig({
|
|
73340
|
+
displayName: "StoreRedeemSection__SuccessHint",
|
|
73341
|
+
componentId: "sc-1pzosml-10"
|
|
73342
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.5rem;color:", ";margin:0;"], uiColors.lightGray);
|
|
73343
|
+
var ErrorIcon = /*#__PURE__*/styled__default.div.withConfig({
|
|
73344
|
+
displayName: "StoreRedeemSection__ErrorIcon",
|
|
73345
|
+
componentId: "sc-1pzosml-11"
|
|
73346
|
+
})(["color:", ";"], uiColors.red);
|
|
73347
|
+
var ErrorTitle = /*#__PURE__*/styled__default.p.withConfig({
|
|
73348
|
+
displayName: "StoreRedeemSection__ErrorTitle",
|
|
73349
|
+
componentId: "sc-1pzosml-12"
|
|
73350
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.65rem;color:", ";margin:0;text-align:center;line-height:1.6;"], uiColors.red);
|
|
73351
|
+
|
|
73183
73352
|
var StoreItemDetails = function StoreItemDetails(_ref) {
|
|
73184
73353
|
var _item$regionalPrice;
|
|
73185
73354
|
var item = _ref.item,
|
|
@@ -73193,12 +73362,12 @@ var StoreItemDetails = function StoreItemDetails(_ref) {
|
|
|
73193
73362
|
if (typeof imageUrl === 'string') return imageUrl;
|
|
73194
73363
|
return imageUrl["default"] || imageUrl.src;
|
|
73195
73364
|
};
|
|
73196
|
-
return React__default.createElement(Container$
|
|
73365
|
+
return React__default.createElement(Container$P, null, React__default.createElement(Header$j, null, React__default.createElement(BackButton, {
|
|
73197
73366
|
onClick: onBack
|
|
73198
73367
|
}, React__default.createElement(fa.FaArrowLeft, null), React__default.createElement("span", null, "Back"))), React__default.createElement(Content$5, null, React__default.createElement(DetailsGrid, null, React__default.createElement(ItemIcon, null, React__default.createElement("img", {
|
|
73199
73368
|
src: getImageSrc(),
|
|
73200
73369
|
alt: item.name
|
|
73201
|
-
})), React__default.createElement(ItemInfo$3, null, React__default.createElement(ItemName$9, null, item.name), React__default.createElement(ItemPrice$2, null, currencySymbol, 'priceUSD' in item ? item.priceUSD : (_item$regionalPrice = item.regionalPrice) != null ? _item$regionalPrice : item.price, item.dcPrice ? " \xB7 " + item.dcPrice.toLocaleString() + " DC" : ''), React__default.createElement(Description$
|
|
73370
|
+
})), React__default.createElement(ItemInfo$3, null, React__default.createElement(ItemName$9, null, item.name), React__default.createElement(ItemPrice$2, null, currencySymbol, 'priceUSD' in item ? item.priceUSD : (_item$regionalPrice = item.regionalPrice) != null ? _item$regionalPrice : item.price, item.dcPrice ? " \xB7 " + item.dcPrice.toLocaleString() + " DC" : ''), React__default.createElement(Description$8, null, item.description))), React__default.createElement(Actions$1, null, React__default.createElement(CTAButton, {
|
|
73202
73371
|
icon: React__default.createElement(fa.FaCartPlus, null),
|
|
73203
73372
|
label: "Add to Cart",
|
|
73204
73373
|
onClick: function onClick() {
|
|
@@ -73207,7 +73376,7 @@ var StoreItemDetails = function StoreItemDetails(_ref) {
|
|
|
73207
73376
|
fullWidth: true
|
|
73208
73377
|
}))));
|
|
73209
73378
|
};
|
|
73210
|
-
var Container$
|
|
73379
|
+
var Container$P = /*#__PURE__*/styled__default.div.withConfig({
|
|
73211
73380
|
displayName: "StoreItemDetails__Container",
|
|
73212
73381
|
componentId: "sc-k3ho5z-0"
|
|
73213
73382
|
})(["display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;height:100%;"]);
|
|
@@ -73243,7 +73412,7 @@ var ItemPrice$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
73243
73412
|
displayName: "StoreItemDetails__ItemPrice",
|
|
73244
73413
|
componentId: "sc-k3ho5z-8"
|
|
73245
73414
|
})(["font-family:'Press Start 2P',cursive;font-size:1rem;color:#fef08a;"]);
|
|
73246
|
-
var Description$
|
|
73415
|
+
var Description$8 = /*#__PURE__*/styled__default.p.withConfig({
|
|
73247
73416
|
displayName: "StoreItemDetails__Description",
|
|
73248
73417
|
componentId: "sc-k3ho5z-9"
|
|
73249
73418
|
})(["margin:0;font-family:'Press Start 2P',cursive;font-size:0.875rem;line-height:1.6;color:#ffffff;"]);
|
|
@@ -73296,18 +73465,23 @@ var Store = function Store(_ref) {
|
|
|
73296
73465
|
onPurchaseError = _ref.onPurchaseError,
|
|
73297
73466
|
onBuyDC = _ref.onBuyDC,
|
|
73298
73467
|
_ref$currencySymbol = _ref.currencySymbol,
|
|
73299
|
-
currencySymbol = _ref$currencySymbol === void 0 ? '$' : _ref$currencySymbol
|
|
73468
|
+
currencySymbol = _ref$currencySymbol === void 0 ? '$' : _ref$currencySymbol,
|
|
73469
|
+
onRedeem = _ref.onRedeem,
|
|
73470
|
+
onRedeemInputFocus = _ref.onRedeemInputFocus,
|
|
73471
|
+
onRedeemInputBlur = _ref.onRedeemInputBlur;
|
|
73472
|
+
var defaultTabOrder = ['premium', 'packs', 'items'];
|
|
73300
73473
|
var _useState = React.useState(null),
|
|
73301
73474
|
selectedPack = _useState[0],
|
|
73302
73475
|
setSelectedPack = _useState[1];
|
|
73303
73476
|
var _useState2 = React.useState(function () {
|
|
73304
|
-
var
|
|
73477
|
+
var _initialTabs$;
|
|
73478
|
+
var initialTabs = (tabOrder != null ? tabOrder : defaultTabOrder).filter(function (id) {
|
|
73305
73479
|
return !(hidePremiumTab && id === 'premium');
|
|
73306
73480
|
});
|
|
73307
73481
|
if (defaultActiveTab && initialTabs.includes(defaultActiveTab)) {
|
|
73308
73482
|
return defaultActiveTab;
|
|
73309
73483
|
}
|
|
73310
|
-
return hidePremiumTab ? 'items' : 'premium';
|
|
73484
|
+
return (_initialTabs$ = initialTabs[0]) != null ? _initialTabs$ : hidePremiumTab ? 'items' : 'premium';
|
|
73311
73485
|
}),
|
|
73312
73486
|
activeTab = _useState2[0],
|
|
73313
73487
|
setActiveTab = _useState2[1];
|
|
@@ -73418,7 +73592,7 @@ var Store = function Store(_ref) {
|
|
|
73418
73592
|
return React__default.createElement(ErrorMessage$3, null, error);
|
|
73419
73593
|
}
|
|
73420
73594
|
// Build tabs dynamically based on props
|
|
73421
|
-
var tabIds = [].concat(tabOrder != null ? tabOrder :
|
|
73595
|
+
var tabIds = [].concat(tabOrder != null ? tabOrder : defaultTabOrder, onRedeem ? ['redeem'] : [], onShowWallet || customWalletContent ? ['wallet'] : [], onShowHistory || customHistoryContent ? ['history'] : []);
|
|
73422
73596
|
var availableTabIds = Array.from(new Set(tabIds.filter(function (id) {
|
|
73423
73597
|
return !(hidePremiumTab && id === 'premium');
|
|
73424
73598
|
})));
|
|
@@ -73558,6 +73732,18 @@ var Store = function Store(_ref) {
|
|
|
73558
73732
|
currencySymbol: currencySymbol
|
|
73559
73733
|
})
|
|
73560
73734
|
},
|
|
73735
|
+
redeem: {
|
|
73736
|
+
id: 'redeem',
|
|
73737
|
+
title: 'Redeem',
|
|
73738
|
+
icon: React__default.createElement(fa.FaTicketAlt, {
|
|
73739
|
+
size: 16
|
|
73740
|
+
}),
|
|
73741
|
+
content: onRedeem ? React__default.createElement(StoreRedeemSection, {
|
|
73742
|
+
onRedeem: onRedeem,
|
|
73743
|
+
onInputFocus: onRedeemInputFocus,
|
|
73744
|
+
onInputBlur: onRedeemInputBlur
|
|
73745
|
+
}) : null
|
|
73746
|
+
},
|
|
73561
73747
|
wallet: {
|
|
73562
73748
|
id: 'wallet',
|
|
73563
73749
|
title: walletLabel != null ? walletLabel : 'Wallet',
|
|
@@ -73642,7 +73828,7 @@ var Store = function Store(_ref) {
|
|
|
73642
73828
|
return handleAddPackToCart(selectedPack);
|
|
73643
73829
|
},
|
|
73644
73830
|
currencySymbol: currencySymbol
|
|
73645
|
-
}) : React__default.createElement(Container$
|
|
73831
|
+
}) : React__default.createElement(Container$Q, null, featuredItems && featuredItems.length > 0 && React__default.createElement(FeaturedBanner, {
|
|
73646
73832
|
items: featuredItems,
|
|
73647
73833
|
atlasJSON: atlasJSON,
|
|
73648
73834
|
atlasIMG: atlasIMG,
|
|
@@ -73724,7 +73910,7 @@ var Store = function Store(_ref) {
|
|
|
73724
73910
|
fullWidth: true
|
|
73725
73911
|
}))));
|
|
73726
73912
|
};
|
|
73727
|
-
var Container$
|
|
73913
|
+
var Container$Q = /*#__PURE__*/styled__default.div.withConfig({
|
|
73728
73914
|
displayName: "Store__Container",
|
|
73729
73915
|
componentId: "sc-64dj00-0"
|
|
73730
73916
|
})(["display:flex;flex-direction:column;width:100%;height:100%;gap:0.5rem;position:relative;"]);
|
|
@@ -74107,7 +74293,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
74107
74293
|
width: "500px",
|
|
74108
74294
|
cancelDrag: "#TraderContainer",
|
|
74109
74295
|
scale: scale
|
|
74110
|
-
}, React__default.createElement(Container$
|
|
74296
|
+
}, React__default.createElement(Container$R, null, React__default.createElement(Title$q, null, type.charAt(0).toUpperCase() + type.slice(1), " Menu"), React__default.createElement("hr", {
|
|
74111
74297
|
className: "golden"
|
|
74112
74298
|
}), React__default.createElement(ScrollWrapper, {
|
|
74113
74299
|
id: "TraderContainer"
|
|
@@ -74124,7 +74310,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
74124
74310
|
scale: scale,
|
|
74125
74311
|
isBuy: isBuy()
|
|
74126
74312
|
});
|
|
74127
|
-
})), React__default.createElement(InfoSection$2, null, React__default.createElement(GoldInfo, null, React__default.createElement("p", null, "Available Gold:"), React__default.createElement("p", null, "$", characterAvailableGold.toFixed(2))), React__default.createElement(GoldInfo, null, React__default.createElement("p", null, "Total:"), React__default.createElement("p", null, "$", sum)), !hasGoldForSale() ? React__default.createElement(AlertText, null, "Sorry, not enough money.") : React__default.createElement(GoldInfo, null, React__default.createElement("p", null, "Final Gold:"), React__default.createElement("p", null, "$", getFinalGold().toFixed(2)))), React__default.createElement(ButtonWrapper$
|
|
74313
|
+
})), React__default.createElement(InfoSection$2, null, React__default.createElement(GoldInfo, null, React__default.createElement("p", null, "Available Gold:"), React__default.createElement("p", null, "$", characterAvailableGold.toFixed(2))), React__default.createElement(GoldInfo, null, React__default.createElement("p", null, "Total:"), React__default.createElement("p", null, "$", sum)), !hasGoldForSale() ? React__default.createElement(AlertText, null, "Sorry, not enough money.") : React__default.createElement(GoldInfo, null, React__default.createElement("p", null, "Final Gold:"), React__default.createElement("p", null, "$", getFinalGold().toFixed(2)))), React__default.createElement(ButtonWrapper$4, null, React__default.createElement(Button, {
|
|
74128
74314
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
74129
74315
|
disabled: !hasGoldForSale(),
|
|
74130
74316
|
onPointerDown: function onPointerDown() {
|
|
@@ -74135,11 +74321,11 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
74135
74321
|
onPointerDown: onClose
|
|
74136
74322
|
}, "Cancel"))));
|
|
74137
74323
|
};
|
|
74138
|
-
var Container$
|
|
74324
|
+
var Container$R = /*#__PURE__*/styled__default.div.withConfig({
|
|
74139
74325
|
displayName: "TradingMenu__Container",
|
|
74140
74326
|
componentId: "sc-1wjsz1l-0"
|
|
74141
74327
|
})(["width:100%;"]);
|
|
74142
|
-
var Title$
|
|
74328
|
+
var Title$q = /*#__PURE__*/styled__default.h1.withConfig({
|
|
74143
74329
|
displayName: "TradingMenu__Title",
|
|
74144
74330
|
componentId: "sc-1wjsz1l-1"
|
|
74145
74331
|
})(["font-size:0.7rem !important;color:yellow !important;text-align:center;"]);
|
|
@@ -74159,7 +74345,7 @@ var AlertText = /*#__PURE__*/styled__default.p.withConfig({
|
|
|
74159
74345
|
displayName: "TradingMenu__AlertText",
|
|
74160
74346
|
componentId: "sc-1wjsz1l-5"
|
|
74161
74347
|
})(["color:red !important;text-align:center;margin:0.3rem 0;font-size:0.5rem;"]);
|
|
74162
|
-
var ButtonWrapper$
|
|
74348
|
+
var ButtonWrapper$4 = /*#__PURE__*/styled__default.div.withConfig({
|
|
74163
74349
|
displayName: "TradingMenu__ButtonWrapper",
|
|
74164
74350
|
componentId: "sc-1wjsz1l-6"
|
|
74165
74351
|
})(["display:flex;justify-content:space-around;width:100%;margin-top:1rem;"]);
|
|
@@ -74169,11 +74355,11 @@ var Truncate = function Truncate(_ref) {
|
|
|
74169
74355
|
var _ref$maxLines = _ref.maxLines,
|
|
74170
74356
|
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
74171
74357
|
children = _ref.children;
|
|
74172
|
-
return React__default.createElement(Container$
|
|
74358
|
+
return React__default.createElement(Container$S, {
|
|
74173
74359
|
maxLines: maxLines
|
|
74174
74360
|
}, children);
|
|
74175
74361
|
};
|
|
74176
|
-
var Container$
|
|
74362
|
+
var Container$S = /*#__PURE__*/styled__default.div.withConfig({
|
|
74177
74363
|
displayName: "Truncate__Container",
|
|
74178
74364
|
componentId: "sc-6x00qb-0"
|
|
74179
74365
|
})(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
|
|
@@ -74282,7 +74468,7 @@ var TutorialStepper = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
74282
74468
|
};
|
|
74283
74469
|
});
|
|
74284
74470
|
}, [lessons, imageStyle]);
|
|
74285
|
-
return React__default.createElement(Container$
|
|
74471
|
+
return React__default.createElement(Container$T, null, React__default.createElement(Stepper, {
|
|
74286
74472
|
steps: generateLessons,
|
|
74287
74473
|
finalCTAButton: {
|
|
74288
74474
|
label: 'Close',
|
|
@@ -74300,7 +74486,7 @@ var LessonBody = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
74300
74486
|
displayName: "TutorialStepper__LessonBody",
|
|
74301
74487
|
componentId: "sc-7tgzv2-1"
|
|
74302
74488
|
})([""]);
|
|
74303
|
-
var Container$
|
|
74489
|
+
var Container$T = /*#__PURE__*/styled__default.div.withConfig({
|
|
74304
74490
|
displayName: "TutorialStepper__Container",
|
|
74305
74491
|
componentId: "sc-7tgzv2-2"
|
|
74306
74492
|
})(["width:80%;max-width:600px;@media (max-width:600px){width:95%;}"]);
|
|
@@ -74429,6 +74615,7 @@ exports.SpriteFromAtlas = SpriteFromAtlas;
|
|
|
74429
74615
|
exports.Stepper = Stepper;
|
|
74430
74616
|
exports.Store = Store;
|
|
74431
74617
|
exports.StoreBadges = StoreBadges;
|
|
74618
|
+
exports.StoreRedeemSection = StoreRedeemSection;
|
|
74432
74619
|
exports.TRANSACTION_TYPE_FILTER_ALL = TRANSACTION_TYPE_FILTER_ALL;
|
|
74433
74620
|
exports.TabBody = TabBody;
|
|
74434
74621
|
exports.Table = Table;
|