@rpg-engine/long-bow 0.8.145 → 0.8.146
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/BlueprintTable.d.ts +9 -0
- package/dist/long-bow.cjs.development.js +116 -72
- 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 +116 -72
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Marketplace/BlueprintSearchModal.tsx +14 -137
- package/src/components/Marketplace/BlueprintTable.tsx +158 -0
- package/src/components/Marketplace/BuyOrderDetailsModal.tsx +9 -10
- package/src/components/Marketplace/BuyOrderPanel.tsx +25 -7
- package/src/stories/Features/marketplace/BuyOrderPanel.stories.tsx +197 -81
- package/src/stories/Features/trading/Marketplace.stories.tsx +27 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IMarketplaceBlueprintSummary } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IBlueprintTableProps {
|
|
4
|
+
blueprints: IMarketplaceBlueprintSummary[];
|
|
5
|
+
atlasJSON: any;
|
|
6
|
+
atlasIMG: any;
|
|
7
|
+
onSelect?: (blueprint: IMarketplaceBlueprintSummary) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const BlueprintTable: React.FC<IBlueprintTableProps>;
|
|
@@ -44510,7 +44510,79 @@ var TabButton$1 = /*#__PURE__*/styled__default.button.withConfig({
|
|
|
44510
44510
|
return $active ? '#ffffff' : '#888888';
|
|
44511
44511
|
});
|
|
44512
44512
|
|
|
44513
|
+
var BlueprintTable = function BlueprintTable(_ref) {
|
|
44514
|
+
var blueprints = _ref.blueprints,
|
|
44515
|
+
atlasJSON = _ref.atlasJSON,
|
|
44516
|
+
atlasIMG = _ref.atlasIMG,
|
|
44517
|
+
onSelect = _ref.onSelect;
|
|
44518
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(ResultsHeader, null, React__default.createElement("span", null), React__default.createElement(ColName, null, "Name"), React__default.createElement(ColType, null, "Type"), React__default.createElement(ColTier, null, "Tier")), blueprints.map(function (blueprint) {
|
|
44519
|
+
return React__default.createElement(ResultRow, {
|
|
44520
|
+
key: blueprint.key,
|
|
44521
|
+
"$selectable": !!onSelect,
|
|
44522
|
+
onPointerDown: onSelect ? function () {
|
|
44523
|
+
return onSelect(blueprint);
|
|
44524
|
+
} : undefined
|
|
44525
|
+
}, React__default.createElement(SpriteWrapper$1, null, React__default.createElement(SpriteFromAtlas, {
|
|
44526
|
+
atlasJSON: atlasJSON,
|
|
44527
|
+
atlasIMG: atlasIMG,
|
|
44528
|
+
spriteKey: blueprint.texturePath || blueprint.key,
|
|
44529
|
+
width: 32,
|
|
44530
|
+
height: 32,
|
|
44531
|
+
imgScale: 2,
|
|
44532
|
+
centered: true
|
|
44533
|
+
})), React__default.createElement(ColName, null, React__default.createElement(BlueprintName, null, blueprint.name), (blueprint.type || blueprint.subType) && React__default.createElement(BlueprintMeta, null, [blueprint.type, blueprint.subType].filter(Boolean).filter(function (v, i, arr) {
|
|
44534
|
+
return arr.indexOf(v) === i;
|
|
44535
|
+
}).join(' · '))), React__default.createElement(ColType, null, React__default.createElement(TypeText, null, blueprint.type), blueprint.subType && blueprint.subType !== blueprint.type && React__default.createElement(SubTypeText, null, blueprint.subType)), React__default.createElement(ColTier, null, "T", blueprint.tier));
|
|
44536
|
+
}));
|
|
44537
|
+
};
|
|
44538
|
+
var tableRowBase = "\n display: grid;\n grid-template-columns: 40px 1fr 120px 50px;\n align-items: center;\n gap: 8px;\n padding: 6px 12px;\n";
|
|
44539
|
+
var ResultsHeader = /*#__PURE__*/styled__default.div.withConfig({
|
|
44540
|
+
displayName: "BlueprintTable__ResultsHeader",
|
|
44541
|
+
componentId: "sc-1ysxhx2-0"
|
|
44542
|
+
})(["", " background:rgba(0,0,0,0.4);border-bottom:1px solid rgba(255,255,255,0.1);position:sticky;top:0;z-index:1;> *{font-size:0.45rem;color:#888;text-transform:uppercase;letter-spacing:1px;}"], tableRowBase);
|
|
44543
|
+
var ResultRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
44544
|
+
displayName: "BlueprintTable__ResultRow",
|
|
44545
|
+
componentId: "sc-1ysxhx2-1"
|
|
44546
|
+
})(["", " border-bottom:1px solid rgba(255,255,255,0.04);cursor:", ";transition:background 0.1s;&:hover{background:", ";}&:last-child{border-bottom:none;}"], tableRowBase, function (p) {
|
|
44547
|
+
return p.$selectable ? 'pointer' : 'default';
|
|
44548
|
+
}, function (p) {
|
|
44549
|
+
return p.$selectable ? 'rgba(245, 158, 11, 0.08)' : 'none';
|
|
44550
|
+
});
|
|
44551
|
+
var SpriteWrapper$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44552
|
+
displayName: "BlueprintTable__SpriteWrapper",
|
|
44553
|
+
componentId: "sc-1ysxhx2-2"
|
|
44554
|
+
})(["display:flex;align-items:center;justify-content:center;width:40px;height:32px;"]);
|
|
44555
|
+
var ColName = /*#__PURE__*/styled__default.div.withConfig({
|
|
44556
|
+
displayName: "BlueprintTable__ColName",
|
|
44557
|
+
componentId: "sc-1ysxhx2-3"
|
|
44558
|
+
})(["display:flex;flex-direction:column;gap:2px;overflow:hidden;"]);
|
|
44559
|
+
var BlueprintName = /*#__PURE__*/styled__default.span.withConfig({
|
|
44560
|
+
displayName: "BlueprintTable__BlueprintName",
|
|
44561
|
+
componentId: "sc-1ysxhx2-4"
|
|
44562
|
+
})(["font-size:0.5rem;color:#ddd;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
44563
|
+
var BlueprintMeta = /*#__PURE__*/styled__default.span.withConfig({
|
|
44564
|
+
displayName: "BlueprintTable__BlueprintMeta",
|
|
44565
|
+
componentId: "sc-1ysxhx2-5"
|
|
44566
|
+
})(["font-size:0.4rem;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
44567
|
+
var ColType = /*#__PURE__*/styled__default.div.withConfig({
|
|
44568
|
+
displayName: "BlueprintTable__ColType",
|
|
44569
|
+
componentId: "sc-1ysxhx2-6"
|
|
44570
|
+
})(["display:flex;flex-direction:column;gap:2px;"]);
|
|
44571
|
+
var TypeText = /*#__PURE__*/styled__default.span.withConfig({
|
|
44572
|
+
displayName: "BlueprintTable__TypeText",
|
|
44573
|
+
componentId: "sc-1ysxhx2-7"
|
|
44574
|
+
})(["font-size:0.45rem;color:#aaa;"]);
|
|
44575
|
+
var SubTypeText = /*#__PURE__*/styled__default.span.withConfig({
|
|
44576
|
+
displayName: "BlueprintTable__SubTypeText",
|
|
44577
|
+
componentId: "sc-1ysxhx2-8"
|
|
44578
|
+
})(["font-size:0.4rem;color:#666;"]);
|
|
44579
|
+
var ColTier = /*#__PURE__*/styled__default.div.withConfig({
|
|
44580
|
+
displayName: "BlueprintTable__ColTier",
|
|
44581
|
+
componentId: "sc-1ysxhx2-9"
|
|
44582
|
+
})(["font-size:0.5rem;color:#f59e0b;text-align:center;"]);
|
|
44583
|
+
|
|
44513
44584
|
var BLUEPRINTS_PER_PAGE = 10;
|
|
44585
|
+
var scaleIn = /*#__PURE__*/styled.keyframes(["from{transform:scale(0.85);opacity:0;}to{transform:scale(1);opacity:1;}"]);
|
|
44514
44586
|
var typeOptions = /*#__PURE__*/[{
|
|
44515
44587
|
id: 1,
|
|
44516
44588
|
value: '',
|
|
@@ -44625,22 +44697,12 @@ var BlueprintSearchModal = function BlueprintSearchModal(_ref) {
|
|
|
44625
44697
|
options: subTypeOptions,
|
|
44626
44698
|
onChange: handleSubTypeChange,
|
|
44627
44699
|
width: "100%"
|
|
44628
|
-
})), React__default.createElement(ResultsWrapper, null, isLoading ? React__default.createElement(EmptyState$2, null, "Loading...") : blueprints.length === 0 ? React__default.createElement(EmptyState$2, null, "No blueprints found") : React__default.createElement(
|
|
44629
|
-
|
|
44630
|
-
|
|
44631
|
-
|
|
44632
|
-
|
|
44633
|
-
|
|
44634
|
-
}, React__default.createElement(SpriteWrapper$1, null, React__default.createElement(SpriteFromAtlas, {
|
|
44635
|
-
atlasJSON: atlasJSON,
|
|
44636
|
-
atlasIMG: atlasIMG,
|
|
44637
|
-
spriteKey: blueprint.texturePath || blueprint.key,
|
|
44638
|
-
width: 32,
|
|
44639
|
-
height: 32,
|
|
44640
|
-
imgScale: 2,
|
|
44641
|
-
centered: true
|
|
44642
|
-
})), React__default.createElement(ColName, null, React__default.createElement(BlueprintName, null, blueprint.name), React__default.createElement(BlueprintKey, null, blueprint.key)), React__default.createElement(ColType, null, React__default.createElement(TypeText, null, blueprint.type), blueprint.subType && blueprint.subType !== blueprint.type && React__default.createElement(SubTypeText, null, blueprint.subType)), React__default.createElement(ColTier, null, "T", blueprint.tier));
|
|
44643
|
-
}))), React__default.createElement(PagerContainer$1, null, React__default.createElement(Pager, {
|
|
44700
|
+
})), React__default.createElement(ResultsWrapper, null, isLoading ? React__default.createElement(EmptyState$2, null, "Loading...") : blueprints.length === 0 ? React__default.createElement(EmptyState$2, null, "No blueprints found") : React__default.createElement(BlueprintTable, {
|
|
44701
|
+
blueprints: blueprints,
|
|
44702
|
+
atlasJSON: atlasJSON,
|
|
44703
|
+
atlasIMG: atlasIMG,
|
|
44704
|
+
onSelect: onSelect
|
|
44705
|
+
})), React__default.createElement(PagerContainer$1, null, React__default.createElement(Pager, {
|
|
44644
44706
|
totalItems: totalCount,
|
|
44645
44707
|
currentPage: currentPage,
|
|
44646
44708
|
itemsPerPage: BLUEPRINTS_PER_PAGE,
|
|
@@ -44658,7 +44720,7 @@ var ModalContainer$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
44658
44720
|
var ModalContent$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44659
44721
|
displayName: "BlueprintSearchModal__ModalContent",
|
|
44660
44722
|
componentId: "sc-i7bssq-2"
|
|
44661
|
-
})(["background:#1a1a2e;border:2px solid #f59e0b;border-radius:8px;padding:20px 24px;width:600px;max-width:90%;display:flex;flex-direction:column;gap:12px;pointer-events:auto;animation:
|
|
44723
|
+
})(["background:#1a1a2e;border:2px solid #f59e0b;border-radius:8px;padding:20px 24px;width:600px;max-width:90%;display:flex;flex-direction:column;gap:12px;pointer-events:auto;animation:", " 0.15s ease-out;"], scaleIn);
|
|
44662
44724
|
var Header$8 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44663
44725
|
displayName: "BlueprintSearchModal__Header",
|
|
44664
44726
|
componentId: "sc-i7bssq-3"
|
|
@@ -44678,7 +44740,7 @@ var InputWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
44678
44740
|
var StyledInput$2 = /*#__PURE__*/styled__default(Input).withConfig({
|
|
44679
44741
|
displayName: "BlueprintSearchModal__StyledInput",
|
|
44680
44742
|
componentId: "sc-i7bssq-7"
|
|
44681
|
-
})(["flex:1;
|
|
44743
|
+
})(["flex:1;"]);
|
|
44682
44744
|
var FiltersRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
44683
44745
|
displayName: "BlueprintSearchModal__FiltersRow",
|
|
44684
44746
|
componentId: "sc-i7bssq-8"
|
|
@@ -44691,56 +44753,16 @@ var ResultsWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
44691
44753
|
displayName: "BlueprintSearchModal__ResultsWrapper",
|
|
44692
44754
|
componentId: "sc-i7bssq-10"
|
|
44693
44755
|
})(["overflow-y:auto;max-height:320px;background:rgba(0,0,0,0.2);border:1px solid rgba(255,255,255,0.05);border-radius:4px;"]);
|
|
44694
|
-
var tableRowBase = "\n display: grid;\n grid-template-columns: 32px 1fr 120px 60px;\n align-items: center;\n gap: 8px;\n padding: 6px 12px;\n";
|
|
44695
|
-
var ResultsHeader = /*#__PURE__*/styled__default.div.withConfig({
|
|
44696
|
-
displayName: "BlueprintSearchModal__ResultsHeader",
|
|
44697
|
-
componentId: "sc-i7bssq-11"
|
|
44698
|
-
})(["", " background:rgba(0,0,0,0.4);border-bottom:1px solid rgba(255,255,255,0.1);position:sticky;top:0;z-index:1;> *{font-size:0.45rem;color:#888;text-transform:uppercase;letter-spacing:1px;}"], tableRowBase);
|
|
44699
|
-
var ResultRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
44700
|
-
displayName: "BlueprintSearchModal__ResultRow",
|
|
44701
|
-
componentId: "sc-i7bssq-12"
|
|
44702
|
-
})(["", " border-bottom:1px solid rgba(255,255,255,0.04);cursor:pointer;transition:background 0.1s;&:hover{background:rgba(245,158,11,0.08);}&:last-child{border-bottom:none;}"], tableRowBase);
|
|
44703
|
-
var SpriteWrapper$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44704
|
-
displayName: "BlueprintSearchModal__SpriteWrapper",
|
|
44705
|
-
componentId: "sc-i7bssq-13"
|
|
44706
|
-
})(["display:flex;align-items:center;justify-content:center;width:32px;height:32px;"]);
|
|
44707
|
-
var ColName = /*#__PURE__*/styled__default.div.withConfig({
|
|
44708
|
-
displayName: "BlueprintSearchModal__ColName",
|
|
44709
|
-
componentId: "sc-i7bssq-14"
|
|
44710
|
-
})(["display:flex;flex-direction:column;gap:2px;overflow:hidden;"]);
|
|
44711
|
-
var BlueprintName = /*#__PURE__*/styled__default.span.withConfig({
|
|
44712
|
-
displayName: "BlueprintSearchModal__BlueprintName",
|
|
44713
|
-
componentId: "sc-i7bssq-15"
|
|
44714
|
-
})(["font-size:0.5rem;color:#ddd;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
44715
|
-
var BlueprintKey = /*#__PURE__*/styled__default.span.withConfig({
|
|
44716
|
-
displayName: "BlueprintSearchModal__BlueprintKey",
|
|
44717
|
-
componentId: "sc-i7bssq-16"
|
|
44718
|
-
})(["font-size:0.4rem;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
44719
|
-
var ColType = /*#__PURE__*/styled__default.div.withConfig({
|
|
44720
|
-
displayName: "BlueprintSearchModal__ColType",
|
|
44721
|
-
componentId: "sc-i7bssq-17"
|
|
44722
|
-
})(["display:flex;flex-direction:column;gap:2px;"]);
|
|
44723
|
-
var TypeText = /*#__PURE__*/styled__default.span.withConfig({
|
|
44724
|
-
displayName: "BlueprintSearchModal__TypeText",
|
|
44725
|
-
componentId: "sc-i7bssq-18"
|
|
44726
|
-
})(["font-size:0.45rem;color:#aaa;"]);
|
|
44727
|
-
var SubTypeText = /*#__PURE__*/styled__default.span.withConfig({
|
|
44728
|
-
displayName: "BlueprintSearchModal__SubTypeText",
|
|
44729
|
-
componentId: "sc-i7bssq-19"
|
|
44730
|
-
})(["font-size:0.4rem;color:#666;"]);
|
|
44731
|
-
var ColTier = /*#__PURE__*/styled__default.div.withConfig({
|
|
44732
|
-
displayName: "BlueprintSearchModal__ColTier",
|
|
44733
|
-
componentId: "sc-i7bssq-20"
|
|
44734
|
-
})(["font-size:0.5rem;color:#f59e0b;text-align:center;"]);
|
|
44735
44756
|
var EmptyState$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44736
44757
|
displayName: "BlueprintSearchModal__EmptyState",
|
|
44737
|
-
componentId: "sc-i7bssq-
|
|
44758
|
+
componentId: "sc-i7bssq-11"
|
|
44738
44759
|
})(["display:flex;align-items:center;justify-content:center;height:100px;font-size:0.55rem;color:#666;text-transform:uppercase;letter-spacing:1px;"]);
|
|
44739
44760
|
var PagerContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44740
44761
|
displayName: "BlueprintSearchModal__PagerContainer",
|
|
44741
|
-
componentId: "sc-i7bssq-
|
|
44762
|
+
componentId: "sc-i7bssq-12"
|
|
44742
44763
|
})(["display:flex;justify-content:center;align-items:center;"]);
|
|
44743
44764
|
|
|
44765
|
+
var scaleIn$1 = /*#__PURE__*/styled.keyframes(["from{transform:scale(0.85);opacity:0;}to{transform:scale(1);opacity:1;}"]);
|
|
44744
44766
|
var rarityOptions = [{
|
|
44745
44767
|
id: 1,
|
|
44746
44768
|
value: 'Common',
|
|
@@ -44799,7 +44821,9 @@ var BuyOrderDetailsModal = function BuyOrderDetailsModal(_ref) {
|
|
|
44799
44821
|
width: 32,
|
|
44800
44822
|
height: 32,
|
|
44801
44823
|
imgScale: 2
|
|
44802
|
-
})), React__default.createElement(ItemInfo$1, null, React__default.createElement(ItemName, null, blueprint.name), React__default.createElement(
|
|
44824
|
+
})), React__default.createElement(ItemInfo$1, null, React__default.createElement(ItemName, null, blueprint.name), React__default.createElement(ItemMeta, null, [blueprint.type, blueprint.subType].filter(Boolean).filter(function (v, i, arr) {
|
|
44825
|
+
return arr.indexOf(v) === i;
|
|
44826
|
+
}).join(' · '), " \xB7 T", blueprint.tier))), React__default.createElement(FormSection, null, React__default.createElement(FieldRow, null, React__default.createElement(Label$4, null, "Quantity"), React__default.createElement(StyledInput$3, {
|
|
44803
44827
|
value: quantity || '',
|
|
44804
44828
|
onChange: function onChange(e) {
|
|
44805
44829
|
return onQuantityChange(Number(e.target.value));
|
|
@@ -44843,7 +44867,7 @@ var ModalContainer$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
44843
44867
|
var ModalContent$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44844
44868
|
displayName: "BuyOrderDetailsModal__ModalContent",
|
|
44845
44869
|
componentId: "sc-6bghe9-2"
|
|
44846
|
-
})(["background:#1a1a2e;border:2px solid #f59e0b;border-radius:8px;padding:20px 24px;width:400px;max-width:90%;display:flex;flex-direction:column;gap:16px;pointer-events:auto;animation:
|
|
44870
|
+
})(["background:#1a1a2e;border:2px solid #f59e0b;border-radius:8px;padding:20px 24px;width:400px;max-width:90%;display:flex;flex-direction:column;gap:16px;pointer-events:auto;animation:", " 0.15s ease-out;"], scaleIn$1);
|
|
44847
44871
|
var Header$9 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44848
44872
|
displayName: "BuyOrderDetailsModal__Header",
|
|
44849
44873
|
componentId: "sc-6bghe9-3"
|
|
@@ -44872,8 +44896,8 @@ var ItemName = /*#__PURE__*/styled__default.span.withConfig({
|
|
|
44872
44896
|
displayName: "BuyOrderDetailsModal__ItemName",
|
|
44873
44897
|
componentId: "sc-6bghe9-9"
|
|
44874
44898
|
})(["font-size:0.55rem;color:#ddd;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
44875
|
-
var
|
|
44876
|
-
displayName: "
|
|
44899
|
+
var ItemMeta = /*#__PURE__*/styled__default.span.withConfig({
|
|
44900
|
+
displayName: "BuyOrderDetailsModal__ItemMeta",
|
|
44877
44901
|
componentId: "sc-6bghe9-10"
|
|
44878
44902
|
})(["font-size:0.4rem;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
44879
44903
|
var FormSection = /*#__PURE__*/styled__default.div.withConfig({
|
|
@@ -44891,7 +44915,7 @@ var Label$4 = /*#__PURE__*/styled__default.label.withConfig({
|
|
|
44891
44915
|
var StyledInput$3 = /*#__PURE__*/styled__default(Input).withConfig({
|
|
44892
44916
|
displayName: "BuyOrderDetailsModal__StyledInput",
|
|
44893
44917
|
componentId: "sc-6bghe9-14"
|
|
44894
|
-
})(["
|
|
44918
|
+
})(["width:100%;"]);
|
|
44895
44919
|
var StyledDropdown$3 = /*#__PURE__*/styled__default(Dropdown).withConfig({
|
|
44896
44920
|
displayName: "BuyOrderDetailsModal__StyledDropdown",
|
|
44897
44921
|
componentId: "sc-6bghe9-15"
|
|
@@ -45269,17 +45293,37 @@ var BuyOrderPanel = function BuyOrderPanel(props) {
|
|
|
45269
45293
|
yourBuyOrdersPage = props.yourBuyOrdersPage,
|
|
45270
45294
|
onYourBuyOrdersPageChange = props.onYourBuyOrdersPageChange,
|
|
45271
45295
|
onCancelBuyOrder = props.onCancelBuyOrder;
|
|
45296
|
+
// Local blueprint display: cleared immediately on Place Request so the
|
|
45297
|
+
// panel returns to "Select Item" without waiting for the consumer to update
|
|
45298
|
+
// the prop. Cancel keeps it shown so the user can reopen the modal.
|
|
45299
|
+
var _useState = React.useState(selectedBlueprint),
|
|
45300
|
+
displayedBlueprint = _useState[0],
|
|
45301
|
+
setDisplayedBlueprint = _useState[1];
|
|
45302
|
+
var _useState2 = React.useState(!!selectedBlueprint),
|
|
45303
|
+
isDetailsOpen = _useState2[0],
|
|
45304
|
+
setIsDetailsOpen = _useState2[1];
|
|
45305
|
+
// Sync when consumer provides a new blueprint (e.g. after search selection)
|
|
45306
|
+
React.useEffect(function () {
|
|
45307
|
+
if (selectedBlueprint) {
|
|
45308
|
+
setDisplayedBlueprint(selectedBlueprint);
|
|
45309
|
+
setIsDetailsOpen(true);
|
|
45310
|
+
}
|
|
45311
|
+
}, [selectedBlueprint]);
|
|
45312
|
+
// Place request: clear display + close modal, then notify consumer
|
|
45272
45313
|
var handleConfirm = function handleConfirm() {
|
|
45273
45314
|
onPlaceBuyOrder();
|
|
45315
|
+
setDisplayedBlueprint(undefined);
|
|
45316
|
+
setIsDetailsOpen(false);
|
|
45274
45317
|
onCloseDetails == null ? void 0 : onCloseDetails();
|
|
45275
45318
|
};
|
|
45319
|
+
// Cancel: just close the modal, keep blueprint displayed for reopening
|
|
45276
45320
|
var handleCloseDetails = function handleCloseDetails() {
|
|
45277
|
-
|
|
45321
|
+
setIsDetailsOpen(false);
|
|
45278
45322
|
};
|
|
45279
|
-
return React__default.createElement(PanelWrapper, null,
|
|
45323
|
+
return React__default.createElement(PanelWrapper, null, displayedBlueprint && isDetailsOpen && React__default.createElement(BuyOrderDetailsModal, {
|
|
45280
45324
|
isOpen: true,
|
|
45281
45325
|
onClose: handleCloseDetails,
|
|
45282
|
-
blueprint:
|
|
45326
|
+
blueprint: displayedBlueprint,
|
|
45283
45327
|
quantity: currentQuantity,
|
|
45284
45328
|
maxPrice: currentMaxPrice,
|
|
45285
45329
|
rarity: selectedRarity,
|
|
@@ -45289,19 +45333,19 @@ var BuyOrderPanel = function BuyOrderPanel(props) {
|
|
|
45289
45333
|
onConfirm: handleConfirm,
|
|
45290
45334
|
atlasJSON: atlasJSON,
|
|
45291
45335
|
atlasIMG: atlasIMG
|
|
45292
|
-
}), React__default.createElement(FormRow, null,
|
|
45336
|
+
}), React__default.createElement(FormRow, null, displayedBlueprint ? React__default.createElement(SelectedBlueprintDisplay, {
|
|
45293
45337
|
onPointerDown: onOpenBlueprintSearch
|
|
45294
45338
|
}, React__default.createElement(RarityContainer, {
|
|
45295
45339
|
"$rarity": selectedRarity
|
|
45296
45340
|
}, React__default.createElement(SpriteFromAtlas, {
|
|
45297
45341
|
atlasIMG: atlasIMG,
|
|
45298
45342
|
atlasJSON: atlasJSON,
|
|
45299
|
-
spriteKey:
|
|
45343
|
+
spriteKey: displayedBlueprint.texturePath || displayedBlueprint.key,
|
|
45300
45344
|
width: 32,
|
|
45301
45345
|
height: 32,
|
|
45302
45346
|
imgScale: 2,
|
|
45303
45347
|
centered: true
|
|
45304
|
-
})), React__default.createElement(ChangeTextWrapper, null, React__default.createElement(BlueprintName$1, null,
|
|
45348
|
+
})), React__default.createElement(ChangeTextWrapper, null, React__default.createElement(BlueprintName$1, null, displayedBlueprint.name), React__default.createElement(ChangeText, null, "change"))) : React__default.createElement(CTAButton, {
|
|
45305
45349
|
icon: React__default.createElement(Search.Search, {
|
|
45306
45350
|
width: 18,
|
|
45307
45351
|
height: 18
|