@rpg-engine/long-bow 0.4.6 → 0.4.8
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/ConfirmModal.d.ts +8 -0
- package/dist/components/DraggableContainer.d.ts +1 -0
- package/dist/components/Item/Inventory/ItemSlot.d.ts +7 -7
- package/dist/components/Marketplace/BuyPanel.d.ts +22 -0
- package/dist/components/Marketplace/ManagmentPanel.d.ts +18 -0
- package/dist/components/Marketplace/Marketplace.d.ts +22 -9
- package/dist/components/Marketplace/MarketplaceRows.d.ts +3 -1
- package/dist/components/Marketplace/{__mocks__ → filters}/index.d.ts +1 -3
- package/dist/components/Pager.d.ts +9 -0
- package/dist/components/SkillProgressBar.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +552 -147
- 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 +552 -147
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ConfirmModal.tsx +87 -0
- package/src/components/DraggableContainer.tsx +3 -0
- package/src/components/Dropdown.tsx +14 -6
- package/src/components/Item/Inventory/ItemSlot.tsx +31 -16
- package/src/components/Marketplace/BuyPanel.tsx +296 -0
- package/src/components/Marketplace/ManagmentPanel.tsx +247 -0
- package/src/components/Marketplace/Marketplace.tsx +74 -100
- package/src/components/Marketplace/MarketplaceRows.tsx +82 -92
- package/src/components/Marketplace/{__mocks__ → filters}/index.tsx +13 -11
- package/src/components/Pager.tsx +94 -0
- package/src/components/SkillProgressBar.tsx +69 -4
- package/src/components/SkillsContainer.tsx +1 -0
- package/src/components/Spellbook/Spell.tsx +0 -1
- package/src/components/Spellbook/Spellbook.tsx +1 -17
- package/src/components/Spellbook/mockSpells.ts +68 -68
- package/src/components/shared/Ellipsis.tsx +10 -2
- package/src/mocks/skills.mocks.ts +2 -0
- package/src/stories/Marketplace.stories.tsx +22 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@rollup/plugin-image": "^2.1.1",
|
|
86
|
-
"@rpg-engine/shared": "^0.8.
|
|
86
|
+
"@rpg-engine/shared": "^0.8.13",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"font-awesome": "^4.7.0",
|
|
89
89
|
"fs-extra": "^10.1.0",
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import ModalPortal from './Abstractions/ModalPortal';
|
|
4
|
+
import { Button, ButtonTypes } from './Button';
|
|
5
|
+
import { DraggableContainer } from './DraggableContainer';
|
|
6
|
+
|
|
7
|
+
interface IConfirmModalProps {
|
|
8
|
+
onConfirm: () => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ConfirmModal: React.FC<IConfirmModalProps> = ({
|
|
14
|
+
onConfirm,
|
|
15
|
+
onClose,
|
|
16
|
+
message,
|
|
17
|
+
}) => {
|
|
18
|
+
return (
|
|
19
|
+
<ModalPortal>
|
|
20
|
+
<Background />
|
|
21
|
+
<Container onPointerDown={onClose}>
|
|
22
|
+
<DraggableContainer width="auto" dragDisabled>
|
|
23
|
+
<Wrapper onPointerDown={e => e.stopPropagation()}>
|
|
24
|
+
<p>{message ?? 'Are you sure?'}</p>
|
|
25
|
+
|
|
26
|
+
<ButtonsWrapper>
|
|
27
|
+
<div className="cancel-button">
|
|
28
|
+
<Button
|
|
29
|
+
buttonType={ButtonTypes.RPGUIButton}
|
|
30
|
+
onPointerDown={onClose}
|
|
31
|
+
>
|
|
32
|
+
No
|
|
33
|
+
</Button>
|
|
34
|
+
</div>
|
|
35
|
+
<Button
|
|
36
|
+
buttonType={ButtonTypes.RPGUIButton}
|
|
37
|
+
onPointerDown={onConfirm}
|
|
38
|
+
>
|
|
39
|
+
Yes
|
|
40
|
+
</Button>
|
|
41
|
+
</ButtonsWrapper>
|
|
42
|
+
</Wrapper>
|
|
43
|
+
</DraggableContainer>
|
|
44
|
+
</Container>
|
|
45
|
+
</ModalPortal>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const Background = styled.div`
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
background-color: #000000;
|
|
54
|
+
opacity: 0.5;
|
|
55
|
+
left: 0;
|
|
56
|
+
top: 0;
|
|
57
|
+
z-index: 1000;
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
const Container = styled.div`
|
|
61
|
+
position: absolute;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
left: 0;
|
|
65
|
+
top: 0;
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
align-items: center;
|
|
69
|
+
z-index: 1001;
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
const Wrapper = styled.div`
|
|
73
|
+
p {
|
|
74
|
+
margin: 0;
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
const ButtonsWrapper = styled.div`
|
|
79
|
+
display: flex;
|
|
80
|
+
justify-content: flex-end;
|
|
81
|
+
gap: 5px;
|
|
82
|
+
margin-top: 5px;
|
|
83
|
+
|
|
84
|
+
.cancel-button {
|
|
85
|
+
filter: grayscale(0.7);
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
@@ -23,6 +23,7 @@ export interface IDraggableContainerProps {
|
|
|
23
23
|
onOutsideClick?: () => void;
|
|
24
24
|
initialPosition?: IPosition;
|
|
25
25
|
scale?: number;
|
|
26
|
+
dragDisabled?: boolean;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
|
|
@@ -42,6 +43,7 @@ export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
|
|
|
42
43
|
onOutsideClick,
|
|
43
44
|
initialPosition = { x: 0, y: 0 },
|
|
44
45
|
scale,
|
|
46
|
+
dragDisabled = false,
|
|
45
47
|
}) => {
|
|
46
48
|
const draggableRef = useRef(null);
|
|
47
49
|
|
|
@@ -66,6 +68,7 @@ export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
|
|
|
66
68
|
return (
|
|
67
69
|
<Draggable
|
|
68
70
|
cancel={`.container-close,${cancelDrag}`}
|
|
71
|
+
disabled={dragDisabled}
|
|
69
72
|
onDrag={(_e, data) => {
|
|
70
73
|
if (onPositionChange) {
|
|
71
74
|
onPositionChange({
|
|
@@ -33,7 +33,7 @@ export const Dropdown: React.FC<IDropdownProps> = ({
|
|
|
33
33
|
if (firstOption) {
|
|
34
34
|
let change = !selectedValue;
|
|
35
35
|
if (!change) {
|
|
36
|
-
change = options.filter(
|
|
36
|
+
change = options.filter(o => o.value === selectedValue).length < 1;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -58,17 +58,17 @@ export const Dropdown: React.FC<IDropdownProps> = ({
|
|
|
58
58
|
<DropdownSelect
|
|
59
59
|
id={`dropdown-${dropdownId}`}
|
|
60
60
|
className="rpgui-dropdown-imp rpgui-dropdown-imp-header"
|
|
61
|
-
|
|
61
|
+
onPointerUp={() => setOpened(prev => !prev)}
|
|
62
62
|
>
|
|
63
63
|
<label>▼</label> {selectedOption}
|
|
64
64
|
</DropdownSelect>
|
|
65
65
|
|
|
66
66
|
<DropdownOptions className="rpgui-dropdown-imp" opened={opened}>
|
|
67
|
-
{options.map(
|
|
67
|
+
{options.map(option => {
|
|
68
68
|
return (
|
|
69
69
|
<li
|
|
70
70
|
key={option.id}
|
|
71
|
-
|
|
71
|
+
onPointerUp={() => {
|
|
72
72
|
setSelectedValue(option.value);
|
|
73
73
|
setSelectedOption(option.option);
|
|
74
74
|
setOpened(false);
|
|
@@ -85,12 +85,17 @@ export const Dropdown: React.FC<IDropdownProps> = ({
|
|
|
85
85
|
|
|
86
86
|
const Container = styled.div<{ width: string | undefined }>`
|
|
87
87
|
position: relative;
|
|
88
|
-
width: ${
|
|
88
|
+
width: ${props => props.width || '100%'};
|
|
89
89
|
`;
|
|
90
90
|
|
|
91
91
|
const DropdownSelect = styled.p`
|
|
92
92
|
width: 100%;
|
|
93
93
|
box-sizing: border-box;
|
|
94
|
+
|
|
95
|
+
label {
|
|
96
|
+
display: inline-block;
|
|
97
|
+
transform: translateY(-2px);
|
|
98
|
+
}
|
|
94
99
|
`;
|
|
95
100
|
|
|
96
101
|
const DropdownOptions = styled.ul<{
|
|
@@ -98,8 +103,11 @@ const DropdownOptions = styled.ul<{
|
|
|
98
103
|
}>`
|
|
99
104
|
position: absolute;
|
|
100
105
|
width: 100%;
|
|
101
|
-
|
|
106
|
+
max-height: 300px;
|
|
107
|
+
overflow-y: auto;
|
|
108
|
+
display: ${props => (props.opened ? 'block' : 'none')};
|
|
102
109
|
box-sizing: border-box;
|
|
110
|
+
|
|
103
111
|
@media (max-width: 768px) {
|
|
104
112
|
padding: 8px 0;
|
|
105
113
|
}
|
|
@@ -41,10 +41,10 @@ interface IProps {
|
|
|
41
41
|
slotIndex: number;
|
|
42
42
|
item: IItem | null;
|
|
43
43
|
itemContainer?: IItemContainer | null;
|
|
44
|
-
itemContainerType
|
|
44
|
+
itemContainerType?: ItemContainerType | null;
|
|
45
45
|
slotSpriteMask?: ItemSlotType | null;
|
|
46
|
-
onSelected
|
|
47
|
-
onMouseOver
|
|
46
|
+
onSelected?: (selectedOption: string, item: IItem) => void;
|
|
47
|
+
onMouseOver?: (
|
|
48
48
|
event: any,
|
|
49
49
|
slotIndex: number,
|
|
50
50
|
item: IItem | null,
|
|
@@ -57,18 +57,18 @@ interface IProps {
|
|
|
57
57
|
itemContainerType: ItemContainerType | null,
|
|
58
58
|
item: IItem
|
|
59
59
|
) => void;
|
|
60
|
-
onDragStart
|
|
60
|
+
onDragStart?: (
|
|
61
61
|
item: IItem,
|
|
62
62
|
slotIndex: number,
|
|
63
63
|
itemContainerType: ItemContainerType | null
|
|
64
64
|
) => void;
|
|
65
|
-
onDragEnd
|
|
65
|
+
onDragEnd?: (quantity?: number) => void;
|
|
66
66
|
onOutsideDrop?: (item: IItem, position: IPosition) => void;
|
|
67
67
|
dragScale?: number;
|
|
68
|
-
checkIfItemCanBeMoved
|
|
68
|
+
checkIfItemCanBeMoved?: () => boolean;
|
|
69
69
|
checkIfItemShouldDragEnd?: () => boolean;
|
|
70
70
|
openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;
|
|
71
|
-
onPlaceDrop
|
|
71
|
+
onPlaceDrop?: (
|
|
72
72
|
item: IItem | null,
|
|
73
73
|
slotIndex: number,
|
|
74
74
|
itemContainerType: ItemContainerType | null
|
|
@@ -131,7 +131,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
131
131
|
setDragPosition({ x: 0, y: 0 });
|
|
132
132
|
setIsFocused(false);
|
|
133
133
|
|
|
134
|
-
if (item) {
|
|
134
|
+
if (item && containerType) {
|
|
135
135
|
setContextActions(
|
|
136
136
|
generateContextMenu(item, containerType, isDepotSystem)
|
|
137
137
|
);
|
|
@@ -278,7 +278,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
278
278
|
setDragPosition({ x: 0, y: 0 });
|
|
279
279
|
setIsFocused(false);
|
|
280
280
|
} else if (item) {
|
|
281
|
-
onDragEnd(quantity);
|
|
281
|
+
onDragEnd?.(quantity);
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
284
|
|
|
@@ -288,7 +288,8 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
288
288
|
className="rpgui-icon empty-slot"
|
|
289
289
|
onMouseUp={() => {
|
|
290
290
|
const data = item ? item : null;
|
|
291
|
-
if (onPlaceDrop
|
|
291
|
+
if (onPlaceDrop && containerType)
|
|
292
|
+
onPlaceDrop(data, slotIndex, containerType);
|
|
292
293
|
}}
|
|
293
294
|
onTouchEnd={e => {
|
|
294
295
|
const { clientX, clientY } = e.changedTouches[0];
|
|
@@ -302,6 +303,13 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
302
303
|
.elementFromPoint(clientX, clientY)
|
|
303
304
|
?.dispatchEvent(simulatedEvent);
|
|
304
305
|
}}
|
|
306
|
+
onPointerDown={
|
|
307
|
+
onDragStart !== undefined && onDragEnd !== undefined
|
|
308
|
+
? undefined
|
|
309
|
+
: () => {
|
|
310
|
+
if (item) onPointerDown(item.type, containerType ?? null, item);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
305
313
|
isSelectingShortcut={
|
|
306
314
|
isSelectingShortcut &&
|
|
307
315
|
(item?.type === ItemType.Consumable || item?.type === ItemType.Tool)
|
|
@@ -311,6 +319,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
311
319
|
axis={isSelectingShortcut ? 'none' : 'both'}
|
|
312
320
|
defaultClassName={item ? 'draggable' : 'empty-slot'}
|
|
313
321
|
scale={dragScale}
|
|
322
|
+
disabled={onDragStart === undefined || onDragEnd === undefined}
|
|
314
323
|
onStop={(e, data) => {
|
|
315
324
|
const target = e.target as HTMLElement;
|
|
316
325
|
if (
|
|
@@ -353,7 +362,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
353
362
|
setDragPosition({ x, y });
|
|
354
363
|
|
|
355
364
|
setTimeout(() => {
|
|
356
|
-
if (checkIfItemCanBeMoved()) {
|
|
365
|
+
if (checkIfItemCanBeMoved?.()) {
|
|
357
366
|
if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd())
|
|
358
367
|
return;
|
|
359
368
|
|
|
@@ -393,7 +402,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
393
402
|
}
|
|
394
403
|
}
|
|
395
404
|
|
|
396
|
-
onPointerDown(item.type, containerType, item);
|
|
405
|
+
onPointerDown(item.type, containerType ?? null, item);
|
|
397
406
|
}
|
|
398
407
|
}}
|
|
399
408
|
onStart={() => {
|
|
@@ -401,7 +410,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
401
410
|
return;
|
|
402
411
|
}
|
|
403
412
|
|
|
404
|
-
if (onDragStart) {
|
|
413
|
+
if (onDragStart && containerType) {
|
|
405
414
|
onDragStart(item, slotIndex, containerType);
|
|
406
415
|
}
|
|
407
416
|
}}
|
|
@@ -421,7 +430,13 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
421
430
|
ref={dragContainer}
|
|
422
431
|
isFocused={isFocused}
|
|
423
432
|
onMouseOver={event => {
|
|
424
|
-
onMouseOver(
|
|
433
|
+
onMouseOver?.(
|
|
434
|
+
event,
|
|
435
|
+
slotIndex,
|
|
436
|
+
item,
|
|
437
|
+
event.clientX,
|
|
438
|
+
event.clientY
|
|
439
|
+
);
|
|
425
440
|
}}
|
|
426
441
|
onMouseOut={() => {
|
|
427
442
|
if (onMouseOut) onMouseOut();
|
|
@@ -460,7 +475,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
460
475
|
onSelected={(optionId: string) => {
|
|
461
476
|
setIsContextMenuVisible(false);
|
|
462
477
|
if (item) {
|
|
463
|
-
onSelected(optionId, item);
|
|
478
|
+
onSelected?.(optionId, item);
|
|
464
479
|
}
|
|
465
480
|
}}
|
|
466
481
|
/>
|
|
@@ -472,7 +487,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
472
487
|
onSelected={(optionId: string) => {
|
|
473
488
|
setIsContextMenuVisible(false);
|
|
474
489
|
if (item) {
|
|
475
|
-
onSelected(optionId, item);
|
|
490
|
+
onSelected?.(optionId, item);
|
|
476
491
|
}
|
|
477
492
|
}}
|
|
478
493
|
onOutsideClick={() => {
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { IEquipmentSet, IMarketplaceItem } from '@rpg-engine/shared';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { AiFillCaretRight } from 'react-icons/ai';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { ConfirmModal } from '../ConfirmModal';
|
|
6
|
+
import { Dropdown } from '../Dropdown';
|
|
7
|
+
import { Input } from '../Input';
|
|
8
|
+
import { MarketplaceRows } from './MarketplaceRows';
|
|
9
|
+
import { itemRarityOptions, itemTypeOptions, orderByOptions } from './filters';
|
|
10
|
+
|
|
11
|
+
export interface IBuyPanelProps {
|
|
12
|
+
items: IMarketplaceItem[];
|
|
13
|
+
atlasJSON: any;
|
|
14
|
+
atlasIMG: any;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
onChangeType: (value: string) => void;
|
|
17
|
+
onChangeRarity: (value: string) => void;
|
|
18
|
+
onChangeOrder: (value: string) => void;
|
|
19
|
+
onChangeNameInput: (value: string) => void;
|
|
20
|
+
onChangeMainLevelInput: (
|
|
21
|
+
value: [number | undefined, number | undefined]
|
|
22
|
+
) => void;
|
|
23
|
+
onChangeSecondaryLevelInput: (
|
|
24
|
+
value: [number | undefined, number | undefined]
|
|
25
|
+
) => void;
|
|
26
|
+
onChangePriceInput: (value: [number | undefined, number | undefined]) => void;
|
|
27
|
+
scale?: number;
|
|
28
|
+
equipmentSet?: IEquipmentSet | null;
|
|
29
|
+
onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;
|
|
30
|
+
characterId: string;
|
|
31
|
+
enableHotkeys?: () => void;
|
|
32
|
+
disableHotkeys?: () => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const BuyPanel: React.FC<IBuyPanelProps> = ({
|
|
36
|
+
items,
|
|
37
|
+
atlasIMG,
|
|
38
|
+
atlasJSON,
|
|
39
|
+
onChangeType,
|
|
40
|
+
onChangeRarity,
|
|
41
|
+
onChangeOrder,
|
|
42
|
+
onChangeNameInput,
|
|
43
|
+
onChangeMainLevelInput,
|
|
44
|
+
onChangeSecondaryLevelInput,
|
|
45
|
+
onChangePriceInput,
|
|
46
|
+
equipmentSet,
|
|
47
|
+
onMarketPlaceItemBuy,
|
|
48
|
+
characterId,
|
|
49
|
+
enableHotkeys,
|
|
50
|
+
disableHotkeys,
|
|
51
|
+
}) => {
|
|
52
|
+
const [name, setName] = useState('');
|
|
53
|
+
const [mainLevel, setMainLevel] = useState<
|
|
54
|
+
[number | undefined, number | undefined]
|
|
55
|
+
>([undefined, undefined]);
|
|
56
|
+
const [secondaryLevel, setSecondaryLevel] = useState<
|
|
57
|
+
[number | undefined, number | undefined]
|
|
58
|
+
>([undefined, undefined]);
|
|
59
|
+
const [price, setPrice] = useState<[number | undefined, number | undefined]>([
|
|
60
|
+
undefined,
|
|
61
|
+
undefined,
|
|
62
|
+
]);
|
|
63
|
+
const [buyingItemId, setBuyingItemId] = useState<string | null>(null);
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<>
|
|
67
|
+
{buyingItemId && (
|
|
68
|
+
<ConfirmModal
|
|
69
|
+
onClose={setBuyingItemId.bind(null, null)}
|
|
70
|
+
onConfirm={() => {
|
|
71
|
+
onMarketPlaceItemBuy?.(buyingItemId);
|
|
72
|
+
setBuyingItemId(null);
|
|
73
|
+
enableHotkeys?.();
|
|
74
|
+
}}
|
|
75
|
+
message="Are you sure to buy this item?"
|
|
76
|
+
/>
|
|
77
|
+
)}
|
|
78
|
+
<InputWrapper>
|
|
79
|
+
<p>Search By Name</p>
|
|
80
|
+
<Input
|
|
81
|
+
onChange={e => {
|
|
82
|
+
setName(e.target.value);
|
|
83
|
+
onChangeNameInput(e.target.value);
|
|
84
|
+
}}
|
|
85
|
+
value={name}
|
|
86
|
+
placeholder="Enter name..."
|
|
87
|
+
onBlur={enableHotkeys}
|
|
88
|
+
onFocus={disableHotkeys}
|
|
89
|
+
/>
|
|
90
|
+
</InputWrapper>
|
|
91
|
+
|
|
92
|
+
<OptionsWrapper>
|
|
93
|
+
<FilterInputsWrapper>
|
|
94
|
+
<div>
|
|
95
|
+
<p>Main level</p>
|
|
96
|
+
<Input
|
|
97
|
+
onChange={e => {
|
|
98
|
+
setMainLevel([Number(e.target.value), mainLevel[1]]);
|
|
99
|
+
onChangeMainLevelInput([Number(e.target.value), mainLevel[1]]);
|
|
100
|
+
}}
|
|
101
|
+
placeholder="Min"
|
|
102
|
+
type="number"
|
|
103
|
+
min={0}
|
|
104
|
+
onBlur={enableHotkeys}
|
|
105
|
+
onFocus={disableHotkeys}
|
|
106
|
+
/>
|
|
107
|
+
<AiFillCaretRight />
|
|
108
|
+
<Input
|
|
109
|
+
onChange={e => {
|
|
110
|
+
setMainLevel([mainLevel[0], Number(e.target.value)]);
|
|
111
|
+
onChangeMainLevelInput([mainLevel[0], Number(e.target.value)]);
|
|
112
|
+
}}
|
|
113
|
+
placeholder="Max"
|
|
114
|
+
type="number"
|
|
115
|
+
min={0}
|
|
116
|
+
onBlur={enableHotkeys}
|
|
117
|
+
onFocus={disableHotkeys}
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div>
|
|
122
|
+
<p>Secondary level</p>
|
|
123
|
+
<Input
|
|
124
|
+
onChange={e => {
|
|
125
|
+
setSecondaryLevel([Number(e.target.value), secondaryLevel[1]]);
|
|
126
|
+
onChangeSecondaryLevelInput([
|
|
127
|
+
Number(e.target.value),
|
|
128
|
+
secondaryLevel[1],
|
|
129
|
+
]);
|
|
130
|
+
}}
|
|
131
|
+
placeholder="Min"
|
|
132
|
+
type="number"
|
|
133
|
+
min={0}
|
|
134
|
+
onBlur={enableHotkeys}
|
|
135
|
+
onFocus={disableHotkeys}
|
|
136
|
+
/>
|
|
137
|
+
<AiFillCaretRight />
|
|
138
|
+
<Input
|
|
139
|
+
onChange={e => {
|
|
140
|
+
setSecondaryLevel([secondaryLevel[0], Number(e.target.value)]);
|
|
141
|
+
onChangeSecondaryLevelInput([
|
|
142
|
+
secondaryLevel[0],
|
|
143
|
+
Number(e.target.value),
|
|
144
|
+
]);
|
|
145
|
+
}}
|
|
146
|
+
placeholder="Max"
|
|
147
|
+
type="number"
|
|
148
|
+
min={0}
|
|
149
|
+
onBlur={enableHotkeys}
|
|
150
|
+
onFocus={disableHotkeys}
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<div>
|
|
155
|
+
<p>Price</p>
|
|
156
|
+
<Input
|
|
157
|
+
onChange={e => {
|
|
158
|
+
setPrice([Number(e.target.value), price[1]]);
|
|
159
|
+
onChangePriceInput([Number(e.target.value), price[1]]);
|
|
160
|
+
}}
|
|
161
|
+
placeholder="Min"
|
|
162
|
+
type="number"
|
|
163
|
+
min={0}
|
|
164
|
+
className="big-input"
|
|
165
|
+
onBlur={enableHotkeys}
|
|
166
|
+
onFocus={disableHotkeys}
|
|
167
|
+
/>
|
|
168
|
+
<AiFillCaretRight />
|
|
169
|
+
<Input
|
|
170
|
+
onChange={e => {
|
|
171
|
+
setPrice([price[0], Number(e.target.value)]);
|
|
172
|
+
onChangePriceInput([price[0], Number(e.target.value)]);
|
|
173
|
+
}}
|
|
174
|
+
placeholder="Max"
|
|
175
|
+
type="number"
|
|
176
|
+
min={0}
|
|
177
|
+
className="big-input"
|
|
178
|
+
onBlur={enableHotkeys}
|
|
179
|
+
onFocus={disableHotkeys}
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
</FilterInputsWrapper>
|
|
183
|
+
|
|
184
|
+
<WrapperContainer>
|
|
185
|
+
<StyledDropdown
|
|
186
|
+
options={itemTypeOptions}
|
|
187
|
+
onChange={onChangeType}
|
|
188
|
+
width="95%"
|
|
189
|
+
/>
|
|
190
|
+
<StyledDropdown
|
|
191
|
+
options={itemRarityOptions}
|
|
192
|
+
onChange={onChangeRarity}
|
|
193
|
+
width="95%"
|
|
194
|
+
/>
|
|
195
|
+
<StyledDropdown
|
|
196
|
+
options={orderByOptions}
|
|
197
|
+
onChange={onChangeOrder}
|
|
198
|
+
width="100%"
|
|
199
|
+
/>
|
|
200
|
+
</WrapperContainer>
|
|
201
|
+
</OptionsWrapper>
|
|
202
|
+
|
|
203
|
+
<ItemComponentScrollWrapper id="MarketContainer">
|
|
204
|
+
{items?.map(({ item, price, _id, owner }, index) => (
|
|
205
|
+
<MarketplaceRows
|
|
206
|
+
key={`${item.key}_${index}`}
|
|
207
|
+
atlasIMG={atlasIMG}
|
|
208
|
+
atlasJSON={atlasJSON}
|
|
209
|
+
item={item}
|
|
210
|
+
itemPrice={price}
|
|
211
|
+
equipmentSet={equipmentSet}
|
|
212
|
+
onMarketPlaceItemBuy={setBuyingItemId.bind(null, _id)}
|
|
213
|
+
disabled={owner === characterId}
|
|
214
|
+
/>
|
|
215
|
+
))}
|
|
216
|
+
</ItemComponentScrollWrapper>
|
|
217
|
+
</>
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const InputWrapper = styled.div`
|
|
222
|
+
width: 95%;
|
|
223
|
+
display: flex !important;
|
|
224
|
+
justify-content: flex-start;
|
|
225
|
+
align-items: center;
|
|
226
|
+
margin: auto;
|
|
227
|
+
|
|
228
|
+
p {
|
|
229
|
+
width: auto;
|
|
230
|
+
margin-right: 20px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
input {
|
|
234
|
+
width: 68%;
|
|
235
|
+
height: 10px;
|
|
236
|
+
}
|
|
237
|
+
`;
|
|
238
|
+
|
|
239
|
+
const OptionsWrapper = styled.div`
|
|
240
|
+
width: 100%;
|
|
241
|
+
height: 100px;
|
|
242
|
+
`;
|
|
243
|
+
|
|
244
|
+
const FilterInputsWrapper = styled.div`
|
|
245
|
+
width: 95%;
|
|
246
|
+
display: flex;
|
|
247
|
+
justify-content: space-between;
|
|
248
|
+
align-items: center;
|
|
249
|
+
margin-bottom: 10px;
|
|
250
|
+
margin-left: 10px;
|
|
251
|
+
gap: 5px;
|
|
252
|
+
color: white;
|
|
253
|
+
flex-wrap: wrap;
|
|
254
|
+
|
|
255
|
+
p {
|
|
256
|
+
width: auto;
|
|
257
|
+
margin: 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
input {
|
|
261
|
+
width: 75px;
|
|
262
|
+
height: 10px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.big-input {
|
|
266
|
+
width: 130px;
|
|
267
|
+
}
|
|
268
|
+
`;
|
|
269
|
+
|
|
270
|
+
const WrapperContainer = styled.div`
|
|
271
|
+
display: grid;
|
|
272
|
+
grid-template-columns: 40% 30% 30%;
|
|
273
|
+
justify-content: space-between;
|
|
274
|
+
width: calc(100% - 40px);
|
|
275
|
+
margin-left: 10px;
|
|
276
|
+
|
|
277
|
+
.rpgui-content .rpgui-dropdown-imp-header {
|
|
278
|
+
padding: 0px 10px 0 !important;
|
|
279
|
+
}
|
|
280
|
+
`;
|
|
281
|
+
|
|
282
|
+
const ItemComponentScrollWrapper = styled.div`
|
|
283
|
+
overflow-y: scroll;
|
|
284
|
+
height: 390px;
|
|
285
|
+
width: 100%;
|
|
286
|
+
margin-top: 1rem;
|
|
287
|
+
|
|
288
|
+
@media (max-width: 950px) {
|
|
289
|
+
height: 250px;
|
|
290
|
+
}
|
|
291
|
+
`;
|
|
292
|
+
|
|
293
|
+
const StyledDropdown = styled(Dropdown)`
|
|
294
|
+
margin: 3px !important;
|
|
295
|
+
width: 170px !important;
|
|
296
|
+
`;
|