@rpg-engine/long-bow 0.8.67 → 0.8.68
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 +13 -1
- package/dist/long-bow.cjs.development.js +17 -8
- 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 +18 -9
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Store/Store.tsx +31 -2
- package/src/stories/Features/store/Store.stories.tsx +3 -1
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IItemPack, IPurchase, IStoreItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
export interface IStoreProps {
|
|
4
|
+
items: IStoreItem[];
|
|
5
|
+
packs?: IItemPack[];
|
|
6
|
+
atlasJSON: any;
|
|
7
|
+
atlasIMG: string;
|
|
8
|
+
onPurchase: (purchase: Partial<IPurchase>) => Promise<boolean>;
|
|
9
|
+
onShowHistory?: () => void;
|
|
10
|
+
userAccountType: UserAccountTypes;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
3
15
|
export declare const Store: React.FC<IStoreProps>;
|
|
@@ -38240,6 +38240,7 @@ var Store = function Store(_ref) {
|
|
|
38240
38240
|
atlasJSON = _ref.atlasJSON,
|
|
38241
38241
|
atlasIMG = _ref.atlasIMG,
|
|
38242
38242
|
_onPurchase = _ref.onPurchase,
|
|
38243
|
+
onShowHistory = _ref.onShowHistory,
|
|
38243
38244
|
userAccountType = _ref.userAccountType,
|
|
38244
38245
|
_ref$loading = _ref.loading,
|
|
38245
38246
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
@@ -38417,7 +38418,11 @@ var Store = function Store(_ref) {
|
|
|
38417
38418
|
onAddToCart: function onAddToCart() {
|
|
38418
38419
|
return handleAddPackToCart(selectedPack);
|
|
38419
38420
|
}
|
|
38420
|
-
}) : React__default.createElement(Container$N, null, React__default.createElement(TopBar$1, null, React__default.createElement(
|
|
38421
|
+
}) : React__default.createElement(Container$N, null, React__default.createElement(TopBar$1, null, React__default.createElement(HistoryButton, null, onShowHistory && React__default.createElement(CTAButton, {
|
|
38422
|
+
icon: React__default.createElement(fa.FaHistory, null),
|
|
38423
|
+
label: "History",
|
|
38424
|
+
onClick: onShowHistory
|
|
38425
|
+
})), React__default.createElement(CartButton, null, React__default.createElement(CTAButton, {
|
|
38421
38426
|
icon: React__default.createElement(fa.FaShoppingCart, null),
|
|
38422
38427
|
label: getTotalItems() + " items ($" + getTotalPrice().toFixed(2) + ")",
|
|
38423
38428
|
onClick: openCart
|
|
@@ -38445,33 +38450,37 @@ var TopBar$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
38445
38450
|
displayName: "Store__TopBar",
|
|
38446
38451
|
componentId: "sc-64dj00-1"
|
|
38447
38452
|
})(["display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:0 1rem;flex-shrink:0;margin-top:0.5rem;"]);
|
|
38453
|
+
var HistoryButton = /*#__PURE__*/styled__default.div.withConfig({
|
|
38454
|
+
displayName: "Store__HistoryButton",
|
|
38455
|
+
componentId: "sc-64dj00-2"
|
|
38456
|
+
})(["min-width:fit-content;margin-right:auto;"]);
|
|
38448
38457
|
var CartButton = /*#__PURE__*/styled__default.div.withConfig({
|
|
38449
38458
|
displayName: "Store__CartButton",
|
|
38450
|
-
componentId: "sc-64dj00-
|
|
38459
|
+
componentId: "sc-64dj00-3"
|
|
38451
38460
|
})(["min-width:fit-content;"]);
|
|
38452
38461
|
var MainContent$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
38453
38462
|
displayName: "Store__MainContent",
|
|
38454
|
-
componentId: "sc-64dj00-
|
|
38463
|
+
componentId: "sc-64dj00-4"
|
|
38455
38464
|
})(["flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden;.rpgui-tabs-content{flex:1;overflow-y:auto;padding-right:0.5rem;}"]);
|
|
38456
38465
|
var Footer$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
38457
38466
|
displayName: "Store__Footer",
|
|
38458
|
-
componentId: "sc-64dj00-
|
|
38467
|
+
componentId: "sc-64dj00-5"
|
|
38459
38468
|
})(["display:flex;flex-direction:column;gap:1rem;padding:1rem;border-top:2px solid #f59e0b;background:rgba(0,0,0,0.2);flex-shrink:0;"]);
|
|
38460
38469
|
var CartSummary = /*#__PURE__*/styled__default.div.withConfig({
|
|
38461
38470
|
displayName: "Store__CartSummary",
|
|
38462
|
-
componentId: "sc-64dj00-
|
|
38471
|
+
componentId: "sc-64dj00-6"
|
|
38463
38472
|
})(["display:flex;flex-direction:column;gap:0.5rem;"]);
|
|
38464
38473
|
var CartInfo = /*#__PURE__*/styled__default.div.withConfig({
|
|
38465
38474
|
displayName: "Store__CartInfo",
|
|
38466
|
-
componentId: "sc-64dj00-
|
|
38475
|
+
componentId: "sc-64dj00-7"
|
|
38467
38476
|
})(["display:flex;align-items:center;gap:0.75rem;font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#ffffff;span:last-child{color:#fef08a;}"]);
|
|
38468
38477
|
var LoadingMessage$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
38469
38478
|
displayName: "Store__LoadingMessage",
|
|
38470
|
-
componentId: "sc-64dj00-
|
|
38479
|
+
componentId: "sc-64dj00-8"
|
|
38471
38480
|
})(["text-align:center;color:", ";padding:2rem;"], uiColors.white);
|
|
38472
38481
|
var ErrorMessage$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
38473
38482
|
displayName: "Store__ErrorMessage",
|
|
38474
|
-
componentId: "sc-64dj00-
|
|
38483
|
+
componentId: "sc-64dj00-9"
|
|
38475
38484
|
})(["text-align:center;color:", ";padding:2rem;"], uiColors.red);
|
|
38476
38485
|
|
|
38477
38486
|
var TextArea = function TextArea(_ref) {
|