@rpg-engine/long-bow 0.2.37 → 0.2.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.2.37",
3
+ "version": "0.2.39",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import { ITradeResponseItem, TradeTransactionType } from '@rpg-engine/shared';
2
- import React, { useEffect, useState } from 'react';
2
+ import React, { useState } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Button, ButtonTypes } from '../Button';
5
5
  import { DraggableContainer } from '../DraggableContainer';
@@ -8,11 +8,11 @@ import { TradingItemRow } from './TradingItemRow';
8
8
  export interface ITrandingMenu {
9
9
  traderItems: ITradeResponseItem[];
10
10
  onClose: () => void;
11
+ onConfirm: () => void;
11
12
  type: TradeTransactionType;
12
13
  atlasJSON: any;
13
14
  atlasIMG: any;
14
15
  characterAvailableGold: number;
15
- onChangeTraderItems: (traderItems: ITradeResponseItem[]) => void;
16
16
  }
17
17
 
18
18
  export const TradingMenu: React.FC<ITrandingMenu> = ({
@@ -22,7 +22,7 @@ export const TradingMenu: React.FC<ITrandingMenu> = ({
22
22
  atlasJSON,
23
23
  atlasIMG,
24
24
  characterAvailableGold,
25
- onChangeTraderItems,
25
+ onConfirm,
26
26
  }) => {
27
27
  const [sum, setSum] = useState(0);
28
28
  let newSumArray = 0;
@@ -38,11 +38,6 @@ export const TradingMenu: React.FC<ITrandingMenu> = ({
38
38
  });
39
39
  };
40
40
 
41
- useEffect(() => {
42
- if (onChangeTraderItems) {
43
- onChangeTraderItems(traderItems);
44
- }
45
- }, [traderItems]);
46
41
  const Capitalize = (word: string) => {
47
42
  return word[0].toUpperCase() + word.substring(1);
48
43
  };
@@ -96,10 +91,16 @@ export const TradingMenu: React.FC<ITrandingMenu> = ({
96
91
  <Button
97
92
  buttonType={ButtonTypes.RPGUIButton}
98
93
  disabled={sum > characterAvailableGold}
94
+ onClick={() => onConfirm()}
99
95
  >
100
96
  Confirm
101
97
  </Button>
102
- <Button buttonType={ButtonTypes.RPGUIButton}>Cancel</Button>
98
+ <Button
99
+ buttonType={ButtonTypes.RPGUIButton}
100
+ onClick={() => onClose()}
101
+ >
102
+ Cancel
103
+ </Button>
103
104
  </ButtonWrapper>
104
105
  </>
105
106
  </DraggableContainer>
@@ -150,6 +151,7 @@ const GoldWrapper = styled.div`
150
151
  `;
151
152
 
152
153
  const AlertWrapper = styled.div`
154
+ margin-top: 1rem;
153
155
  display: flex;
154
156
  width: 100%;
155
157
  justify-content: center;