@rpg-engine/long-bow 0.3.80 → 0.3.82

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.
Files changed (149) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +181 -181
  3. package/dist/components/Abstractions/ModalPortal.d.ts +6 -0
  4. package/dist/long-bow.cjs.development.js +805 -807
  5. package/dist/long-bow.cjs.development.js.map +1 -1
  6. package/dist/long-bow.cjs.production.min.js +1 -1
  7. package/dist/long-bow.cjs.production.min.js.map +1 -1
  8. package/dist/long-bow.esm.js +808 -810
  9. package/dist/long-bow.esm.js.map +1 -1
  10. package/package.json +100 -100
  11. package/src/components/Abstractions/ModalPortal.tsx +22 -0
  12. package/src/components/Abstractions/SlotsContainer.tsx +48 -48
  13. package/src/components/Arrow/SelectArrow.tsx +69 -69
  14. package/src/components/Arrow/img/arrow01-left-clicked.png +0 -0
  15. package/src/components/Arrow/img/arrow01-left.png +0 -0
  16. package/src/components/Arrow/img/arrow01-right-clicked.png +0 -0
  17. package/src/components/Arrow/img/arrow01-right.png +0 -0
  18. package/src/components/Arrow/img/arrow02-left-clicked.png +0 -0
  19. package/src/components/Arrow/img/arrow02-left.png +0 -0
  20. package/src/components/Arrow/img/arrow02-right-clicked.png +0 -0
  21. package/src/components/Arrow/img/arrow02-right.png +0 -0
  22. package/src/components/Button.tsx +40 -40
  23. package/src/components/Character/CharacterSelection.tsx +96 -96
  24. package/src/components/CharacterStatus/CharacterStatus.tsx +120 -120
  25. package/src/components/Chat/Chat.tsx +196 -195
  26. package/src/components/Chatdeprecated/ChatDeprecated.tsx +198 -198
  27. package/src/components/CheckButton.tsx +65 -65
  28. package/src/components/CircularController/CircularController.tsx +248 -248
  29. package/src/components/CraftBook/CraftBook.tsx +241 -241
  30. package/src/components/CraftBook/MockItems.ts +77 -77
  31. package/src/components/DraggableContainer.tsx +156 -156
  32. package/src/components/Dropdown.tsx +90 -90
  33. package/src/components/DropdownSelectorContainer.tsx +42 -42
  34. package/src/components/Equipment/EquipmentSet.tsx +191 -191
  35. package/src/components/HistoryDialog.tsx +104 -104
  36. package/src/components/Input.tsx +15 -15
  37. package/src/components/Item/Cards/ItemInfo.tsx +252 -252
  38. package/src/components/Item/Cards/ItemInfoDisplay.tsx +128 -128
  39. package/src/components/Item/Cards/ItemInfoWrapper.tsx +62 -62
  40. package/src/components/Item/Cards/ItemTooltip.tsx +83 -85
  41. package/src/components/Item/Cards/MobileItemTooltip.tsx +149 -134
  42. package/src/components/Item/Inventory/ErrorBoundary.tsx +42 -42
  43. package/src/components/Item/Inventory/ItemContainer.tsx +218 -215
  44. package/src/components/Item/Inventory/ItemContainerTypes.ts +6 -6
  45. package/src/components/Item/Inventory/ItemQuantitySelector.tsx +138 -138
  46. package/src/components/Item/Inventory/ItemSlot.tsx +546 -544
  47. package/src/components/Item/Inventory/itemContainerHelper.ts +156 -156
  48. package/src/components/ListMenu.tsx +63 -63
  49. package/src/components/Multitab/Tab.tsx +66 -66
  50. package/src/components/Multitab/TabBody.tsx +13 -13
  51. package/src/components/Multitab/TabsContainer.tsx +97 -97
  52. package/src/components/NPCDialog/NPCDialog.tsx +121 -121
  53. package/src/components/NPCDialog/NPCDialogText.tsx +113 -113
  54. package/src/components/NPCDialog/NPCMultiDialog.tsx +159 -159
  55. package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +237 -237
  56. package/src/components/ProgressBar.tsx +92 -92
  57. package/src/components/PropertySelect/PropertySelect.tsx +106 -106
  58. package/src/components/QuestInfo/QuestInfo.tsx +233 -233
  59. package/src/components/QuestList.tsx +135 -135
  60. package/src/components/RPGUIContainer.tsx +47 -47
  61. package/src/components/RPGUIForceRenderStart.tsx +45 -45
  62. package/src/components/RPGUIRoot.tsx +14 -14
  63. package/src/components/RadioButton.tsx +53 -53
  64. package/src/components/RadioInput/RadioButton.tsx +96 -96
  65. package/src/components/RadioInput/RadioInput.tsx +102 -102
  66. package/src/components/RadioInput/instruments.ts +15 -15
  67. package/src/components/RangeSlider.tsx +78 -78
  68. package/src/components/RelativeListMenu.tsx +83 -83
  69. package/src/components/ScrollList.tsx +79 -79
  70. package/src/components/Shortcuts/Shortcuts.tsx +151 -151
  71. package/src/components/Shortcuts/ShortcutsSetter.tsx +132 -132
  72. package/src/components/Shortcuts/SingleShortcut.ts +62 -62
  73. package/src/components/SimpleProgressBar.tsx +62 -62
  74. package/src/components/SkillProgressBar.tsx +133 -133
  75. package/src/components/SkillsContainer.tsx +206 -206
  76. package/src/components/Spellbook/Spell.tsx +201 -201
  77. package/src/components/Spellbook/Spellbook.tsx +153 -153
  78. package/src/components/Spellbook/constants.ts +8 -8
  79. package/src/components/Spellbook/mockSpells.ts +60 -60
  80. package/src/components/StaticBook/StaticBook.tsx +103 -103
  81. package/src/components/TextArea.tsx +11 -11
  82. package/src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx +35 -35
  83. package/src/components/TimeWidget/TimeWidget.tsx +65 -65
  84. package/src/components/TradingMenu/TradingItemRow.tsx +198 -198
  85. package/src/components/TradingMenu/TradingMenu.tsx +216 -216
  86. package/src/components/TradingMenu/items.mock.ts +48 -48
  87. package/src/components/Truncate.tsx +25 -25
  88. package/src/components/itemSelector/ItemSelector.tsx +136 -136
  89. package/src/components/shared/Column.tsx +16 -16
  90. package/src/components/shared/Ellipsis.tsx +65 -65
  91. package/src/components/shared/SpriteFromAtlas.tsx +104 -104
  92. package/src/components/typography/DynamicText.tsx +49 -49
  93. package/src/constants/uiColors.ts +20 -20
  94. package/src/constants/uiDevices.ts +3 -3
  95. package/src/constants/uiFonts.ts +12 -12
  96. package/src/hooks/useEventListener.ts +21 -21
  97. package/src/hooks/useOutsideAlerter.ts +25 -25
  98. package/src/index.tsx +40 -40
  99. package/src/libs/StringHelpers.ts +3 -3
  100. package/src/mocks/atlas/entities/entities.json +20215 -20215
  101. package/src/mocks/atlas/icons/icons.json +735 -735
  102. package/src/mocks/atlas/items/items.json +12086 -12086
  103. package/src/mocks/equipmentSet.mocks.ts +391 -391
  104. package/src/mocks/itemContainer.mocks.ts +563 -563
  105. package/src/mocks/skills.mocks.ts +128 -128
  106. package/src/stories/Arrow.stories.tsx +26 -26
  107. package/src/stories/Button.stories.tsx +36 -36
  108. package/src/stories/CharacterSelection.stories.tsx +45 -45
  109. package/src/stories/CharacterStatus.stories.tsx +29 -29
  110. package/src/stories/Chat.stories.tsx +187 -187
  111. package/src/stories/ChatDeprecated.stories.tsx +170 -170
  112. package/src/stories/CheckButton.stories.tsx +48 -48
  113. package/src/stories/CircullarController.stories.tsx +37 -37
  114. package/src/stories/CraftBook.stories.tsx +42 -42
  115. package/src/stories/DayNightPeriod.stories.tsx +27 -27
  116. package/src/stories/DraggableContainer.stories.tsx +28 -28
  117. package/src/stories/Dropdown.stories.tsx +46 -46
  118. package/src/stories/DropdownSelectorContainer.stories.tsx +41 -41
  119. package/src/stories/EquipmentSet.stories.tsx +65 -65
  120. package/src/stories/HistoryDialog.stories.tsx +61 -61
  121. package/src/stories/ItemContainer.stories.tsx +200 -200
  122. package/src/stories/ItemInfoDisplay.stories.tsx +33 -33
  123. package/src/stories/ItemQuantitySelector.stories.tsx +26 -26
  124. package/src/stories/ItemSelector.stories.tsx +77 -77
  125. package/src/stories/ItemTradingComponent.stories.tsx +35 -35
  126. package/src/stories/ListMenu.stories.tsx +56 -56
  127. package/src/stories/Multitab.stories.tsx +51 -51
  128. package/src/stories/NPCDialog.stories.tsx +130 -130
  129. package/src/stories/NPCMultiDialog.stories.tsx +71 -71
  130. package/src/stories/ProgressBar.stories.tsx +23 -23
  131. package/src/stories/PropertySelect.stories.tsx +40 -40
  132. package/src/stories/QuestInfo.stories.tsx +107 -107
  133. package/src/stories/QuestList.stories.tsx +82 -82
  134. package/src/stories/RPGUIContainers.stories.tsx +42 -42
  135. package/src/stories/RadioButton.stories.tsx +49 -49
  136. package/src/stories/RadioInput.stories.tsx +34 -34
  137. package/src/stories/RangeSlider.stories.tsx +64 -64
  138. package/src/stories/ScrollList.stories.tsx +85 -85
  139. package/src/stories/Shortcuts.stories.tsx +39 -39
  140. package/src/stories/SimpleProgressBar.stories.tsx +22 -22
  141. package/src/stories/SkillProgressBar.stories.tsx +34 -34
  142. package/src/stories/SkillsContainer.stories.tsx +35 -35
  143. package/src/stories/Spellbook.stories.tsx +104 -104
  144. package/src/stories/StaticBook.stories.tsx +32 -32
  145. package/src/stories/Text.stories.tsx +42 -42
  146. package/src/stories/TimeWidget.stories.tsx +27 -27
  147. package/src/stories/TradingMenu.stories.tsx +47 -47
  148. package/src/types/eventTypes.ts +4 -4
  149. package/src/types/index.d.ts +2 -2
@@ -1,215 +1,218 @@
1
- import {
2
- IEquipmentSet,
3
- IItem,
4
- IItemContainer,
5
- IShortcut,
6
- ItemContainerType,
7
- ItemType,
8
- } from '@rpg-engine/shared';
9
- import React, { useState } from 'react';
10
- import styled from 'styled-components';
11
- import { SlotsContainer } from '../../Abstractions/SlotsContainer';
12
- import { ItemQuantitySelector } from './ItemQuantitySelector';
13
-
14
- import { IPosition } from '../../../types/eventTypes';
15
- import { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';
16
- import { ItemSlot } from './ItemSlot';
17
-
18
- export interface IItemContainerProps {
19
- itemContainer: IItemContainer;
20
- onClose?: () => void;
21
- onItemClick?: (
22
- item: IItem,
23
- ItemType: IItem['type'],
24
- itemContainerType: ItemContainerType | null
25
- ) => void;
26
- onItemDragStart?: (
27
- item: IItem,
28
- slotIndex: number,
29
- itemContainerType: ItemContainerType | null
30
- ) => void;
31
- onItemDragEnd?: (quantity?: number) => void;
32
- onOutsideDrop?: (item: IItem, position: IPosition) => void;
33
- onItemPlaceDrop?: (
34
- item: IItem | null,
35
- slotIndex: number,
36
- itemContainerType: ItemContainerType | null
37
- ) => void;
38
- scale?: number;
39
- checkIfItemCanBeMoved: () => boolean;
40
- checkIfItemShouldDragEnd?: () => boolean;
41
- onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
42
- onSelected?: (optionId: string, item: IItem) => void;
43
- type: ItemContainerType;
44
- atlasJSON: any;
45
- atlasIMG: any;
46
- disableContextMenu?: boolean;
47
- initialPosition?: { x: number; y: number };
48
- shortcuts?: IShortcut[];
49
- setItemShortcut?: (key: string, index: number) => void;
50
- removeShortcut?: (index: number) => void;
51
- equipmentSet?: IEquipmentSet | null;
52
- }
53
-
54
- export const ItemContainer: React.FC<IItemContainerProps> = ({
55
- itemContainer,
56
- onClose,
57
- onMouseOver,
58
- onSelected,
59
- onItemClick,
60
- type,
61
- atlasJSON,
62
- atlasIMG,
63
- disableContextMenu = false,
64
- onItemDragEnd,
65
- onItemDragStart,
66
- onItemPlaceDrop,
67
- onOutsideDrop,
68
- checkIfItemCanBeMoved,
69
- initialPosition,
70
- checkIfItemShouldDragEnd,
71
- scale,
72
- shortcuts,
73
- setItemShortcut,
74
- removeShortcut,
75
- equipmentSet,
76
- }) => {
77
- const [quantitySelect, setQuantitySelect] = useState({
78
- isOpen: false,
79
- maxQuantity: 1,
80
- callback: (_quantity: number) => {},
81
- });
82
- const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);
83
-
84
- const onRenderSlots = () => {
85
- const slots = [];
86
-
87
- for (let i = 0; i < itemContainer.slotQty; i++) {
88
- slots.push(
89
- <ItemSlot
90
- isContextMenuDisabled={disableContextMenu}
91
- key={i}
92
- slotIndex={i}
93
- item={itemContainer.slots?.[i] || null}
94
- itemContainerType={type}
95
- onMouseOver={(event, slotIndex, item) => {
96
- if (onMouseOver) onMouseOver(event, slotIndex, item);
97
- }}
98
- onPointerDown={(itemType, containerType, item) => {
99
- if (settingShortcutIndex !== -1) {
100
- setSettingShortcutIndex(-1);
101
-
102
- if (
103
- itemType === ItemType.Consumable ||
104
- itemType === ItemType.Tool
105
- ) {
106
- setItemShortcut?.(item.key, settingShortcutIndex);
107
- }
108
- } else if (onItemClick) onItemClick(item, itemType, containerType);
109
- }}
110
- onSelected={(optionId: string, item: IItem) => {
111
- if (onSelected) onSelected(optionId, item);
112
- }}
113
- onDragStart={(item, slotIndex, itemContainerType) => {
114
- if (onItemDragStart)
115
- onItemDragStart(item, slotIndex, itemContainerType);
116
- }}
117
- onDragEnd={quantity => {
118
- if (onItemDragEnd) onItemDragEnd(quantity);
119
- }}
120
- dragScale={scale}
121
- checkIfItemCanBeMoved={checkIfItemCanBeMoved}
122
- checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}
123
- openQuantitySelector={(maxQuantity, callback) => {
124
- setQuantitySelect({
125
- isOpen: true,
126
- maxQuantity,
127
- callback,
128
- });
129
- }}
130
- onPlaceDrop={(item, slotIndex, itemContainerType) => {
131
- if (onItemPlaceDrop)
132
- onItemPlaceDrop(item, slotIndex, itemContainerType);
133
- }}
134
- onOutsideDrop={(item, position) => {
135
- if (onOutsideDrop) onOutsideDrop(item, position);
136
- }}
137
- atlasIMG={atlasIMG}
138
- atlasJSON={atlasJSON}
139
- isSelectingShortcut={settingShortcutIndex !== -1}
140
- equipmentSet={equipmentSet}
141
- />
142
- );
143
- }
144
- return slots;
145
- };
146
-
147
- return (
148
- <>
149
- <SlotsContainer
150
- title={itemContainer.name || 'Container'}
151
- onClose={onClose}
152
- initialPosition={initialPosition}
153
- scale={scale}
154
- >
155
- {type === ItemContainerType.Inventory &&
156
- shortcuts &&
157
- removeShortcut && (
158
- <ShortcutsSetter
159
- setSettingShortcutIndex={setSettingShortcutIndex}
160
- settingShortcutIndex={settingShortcutIndex}
161
- shortcuts={shortcuts}
162
- removeShortcut={removeShortcut}
163
- atlasIMG={atlasIMG}
164
- atlasJSON={atlasJSON}
165
- />
166
- )}
167
- <ItemsContainer className="item-container-body">
168
- {onRenderSlots()}
169
- </ItemsContainer>
170
- </SlotsContainer>
171
- {quantitySelect.isOpen && (
172
- <QuantitySelectorContainer>
173
- <ItemQuantitySelector
174
- quantity={quantitySelect.maxQuantity}
175
- onConfirm={quantity => {
176
- quantitySelect.callback(quantity);
177
- setQuantitySelect({
178
- isOpen: false,
179
- maxQuantity: 1,
180
- callback: () => {},
181
- });
182
- }}
183
- onClose={() => {
184
- quantitySelect.callback(-1);
185
- setQuantitySelect({
186
- isOpen: false,
187
- maxQuantity: 1,
188
- callback: () => {},
189
- });
190
- }}
191
- />
192
- </QuantitySelectorContainer>
193
- )}
194
- </>
195
- );
196
- };
197
-
198
- const ItemsContainer = styled.div`
199
- display: flex;
200
- justify-content: center;
201
- flex-wrap: wrap;
202
- `;
203
-
204
- const QuantitySelectorContainer = styled.div`
205
- position: absolute;
206
- top: 0;
207
- left: 0;
208
- width: 100vw;
209
- height: 100vh;
210
- z-index: 100;
211
- display: flex;
212
- justify-content: center;
213
- align-items: center;
214
- background-color: rgba(0, 0, 0, 0.5);
215
- `;
1
+ import {
2
+ IEquipmentSet,
3
+ IItem,
4
+ IItemContainer,
5
+ IShortcut,
6
+ ItemContainerType,
7
+ ItemType,
8
+ } from '@rpg-engine/shared';
9
+ import React, { useState } from 'react';
10
+ import styled from 'styled-components';
11
+ import { SlotsContainer } from '../../Abstractions/SlotsContainer';
12
+ import { ItemQuantitySelector } from './ItemQuantitySelector';
13
+
14
+ import { IPosition } from '../../../types/eventTypes';
15
+ import ModalPortal from '../../Abstractions/ModalPortal';
16
+ import { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';
17
+ import { ItemSlot } from './ItemSlot';
18
+
19
+ export interface IItemContainerProps {
20
+ itemContainer: IItemContainer;
21
+ onClose?: () => void;
22
+ onItemClick?: (
23
+ item: IItem,
24
+ ItemType: IItem['type'],
25
+ itemContainerType: ItemContainerType | null
26
+ ) => void;
27
+ onItemDragStart?: (
28
+ item: IItem,
29
+ slotIndex: number,
30
+ itemContainerType: ItemContainerType | null
31
+ ) => void;
32
+ onItemDragEnd?: (quantity?: number) => void;
33
+ onOutsideDrop?: (item: IItem, position: IPosition) => void;
34
+ onItemPlaceDrop?: (
35
+ item: IItem | null,
36
+ slotIndex: number,
37
+ itemContainerType: ItemContainerType | null
38
+ ) => void;
39
+ scale?: number;
40
+ checkIfItemCanBeMoved: () => boolean;
41
+ checkIfItemShouldDragEnd?: () => boolean;
42
+ onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
43
+ onSelected?: (optionId: string, item: IItem) => void;
44
+ type: ItemContainerType;
45
+ atlasJSON: any;
46
+ atlasIMG: any;
47
+ disableContextMenu?: boolean;
48
+ initialPosition?: { x: number; y: number };
49
+ shortcuts?: IShortcut[];
50
+ setItemShortcut?: (key: string, index: number) => void;
51
+ removeShortcut?: (index: number) => void;
52
+ equipmentSet?: IEquipmentSet | null;
53
+ }
54
+
55
+ export const ItemContainer: React.FC<IItemContainerProps> = ({
56
+ itemContainer,
57
+ onClose,
58
+ onMouseOver,
59
+ onSelected,
60
+ onItemClick,
61
+ type,
62
+ atlasJSON,
63
+ atlasIMG,
64
+ disableContextMenu = false,
65
+ onItemDragEnd,
66
+ onItemDragStart,
67
+ onItemPlaceDrop,
68
+ onOutsideDrop,
69
+ checkIfItemCanBeMoved,
70
+ initialPosition,
71
+ checkIfItemShouldDragEnd,
72
+ scale,
73
+ shortcuts,
74
+ setItemShortcut,
75
+ removeShortcut,
76
+ equipmentSet,
77
+ }) => {
78
+ const [quantitySelect, setQuantitySelect] = useState({
79
+ isOpen: false,
80
+ maxQuantity: 1,
81
+ callback: (_quantity: number) => {},
82
+ });
83
+ const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);
84
+
85
+ const onRenderSlots = () => {
86
+ const slots = [];
87
+
88
+ for (let i = 0; i < itemContainer.slotQty; i++) {
89
+ slots.push(
90
+ <ItemSlot
91
+ isContextMenuDisabled={disableContextMenu}
92
+ key={i}
93
+ slotIndex={i}
94
+ item={itemContainer.slots?.[i] || null}
95
+ itemContainerType={type}
96
+ onMouseOver={(event, slotIndex, item) => {
97
+ if (onMouseOver) onMouseOver(event, slotIndex, item);
98
+ }}
99
+ onPointerDown={(itemType, containerType, item) => {
100
+ if (settingShortcutIndex !== -1) {
101
+ setSettingShortcutIndex(-1);
102
+
103
+ if (
104
+ itemType === ItemType.Consumable ||
105
+ itemType === ItemType.Tool
106
+ ) {
107
+ setItemShortcut?.(item.key, settingShortcutIndex);
108
+ }
109
+ } else if (onItemClick) onItemClick(item, itemType, containerType);
110
+ }}
111
+ onSelected={(optionId: string, item: IItem) => {
112
+ if (onSelected) onSelected(optionId, item);
113
+ }}
114
+ onDragStart={(item, slotIndex, itemContainerType) => {
115
+ if (onItemDragStart)
116
+ onItemDragStart(item, slotIndex, itemContainerType);
117
+ }}
118
+ onDragEnd={quantity => {
119
+ if (onItemDragEnd) onItemDragEnd(quantity);
120
+ }}
121
+ dragScale={scale}
122
+ checkIfItemCanBeMoved={checkIfItemCanBeMoved}
123
+ checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}
124
+ openQuantitySelector={(maxQuantity, callback) => {
125
+ setQuantitySelect({
126
+ isOpen: true,
127
+ maxQuantity,
128
+ callback,
129
+ });
130
+ }}
131
+ onPlaceDrop={(item, slotIndex, itemContainerType) => {
132
+ if (onItemPlaceDrop)
133
+ onItemPlaceDrop(item, slotIndex, itemContainerType);
134
+ }}
135
+ onOutsideDrop={(item, position) => {
136
+ if (onOutsideDrop) onOutsideDrop(item, position);
137
+ }}
138
+ atlasIMG={atlasIMG}
139
+ atlasJSON={atlasJSON}
140
+ isSelectingShortcut={settingShortcutIndex !== -1}
141
+ equipmentSet={equipmentSet}
142
+ />
143
+ );
144
+ }
145
+ return slots;
146
+ };
147
+
148
+ return (
149
+ <>
150
+ <SlotsContainer
151
+ title={itemContainer.name || 'Container'}
152
+ onClose={onClose}
153
+ initialPosition={initialPosition}
154
+ scale={scale}
155
+ >
156
+ {type === ItemContainerType.Inventory &&
157
+ shortcuts &&
158
+ removeShortcut && (
159
+ <ShortcutsSetter
160
+ setSettingShortcutIndex={setSettingShortcutIndex}
161
+ settingShortcutIndex={settingShortcutIndex}
162
+ shortcuts={shortcuts}
163
+ removeShortcut={removeShortcut}
164
+ atlasIMG={atlasIMG}
165
+ atlasJSON={atlasJSON}
166
+ />
167
+ )}
168
+ <ItemsContainer className="item-container-body">
169
+ {onRenderSlots()}
170
+ </ItemsContainer>
171
+ </SlotsContainer>
172
+ {quantitySelect.isOpen && (
173
+ <ModalPortal>
174
+ <QuantitySelectorContainer>
175
+ <ItemQuantitySelector
176
+ quantity={quantitySelect.maxQuantity}
177
+ onConfirm={quantity => {
178
+ quantitySelect.callback(quantity);
179
+ setQuantitySelect({
180
+ isOpen: false,
181
+ maxQuantity: 1,
182
+ callback: () => {},
183
+ });
184
+ }}
185
+ onClose={() => {
186
+ quantitySelect.callback(-1);
187
+ setQuantitySelect({
188
+ isOpen: false,
189
+ maxQuantity: 1,
190
+ callback: () => {},
191
+ });
192
+ }}
193
+ />
194
+ </QuantitySelectorContainer>
195
+ </ModalPortal>
196
+ )}
197
+ </>
198
+ );
199
+ };
200
+
201
+ const ItemsContainer = styled.div`
202
+ display: flex;
203
+ justify-content: center;
204
+ flex-wrap: wrap;
205
+ `;
206
+
207
+ const QuantitySelectorContainer = styled.div`
208
+ position: absolute;
209
+ top: 0;
210
+ left: 0;
211
+ width: 100vw;
212
+ height: 100vh;
213
+ z-index: 100;
214
+ display: flex;
215
+ justify-content: center;
216
+ align-items: center;
217
+ background-color: rgba(0, 0, 0, 0.5);
218
+ `;
@@ -1,6 +1,6 @@
1
- export enum SlotContainerType {
2
- INVENTORY = 'Inventory',
3
- EQUIPMENT_SET = 'EquipmentSet',
4
- LOOT = 'Loot',
5
- MAP_CONTAINER = 'Map-Container',
6
- }
1
+ export enum SlotContainerType {
2
+ INVENTORY = 'Inventory',
3
+ EQUIPMENT_SET = 'EquipmentSet',
4
+ LOOT = 'Loot',
5
+ MAP_CONTAINER = 'Map-Container',
6
+ }