@rpg-engine/long-bow 0.2.38 → 0.2.40

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.38",
3
+ "version": "0.2.40",
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';
@@ -13,7 +13,6 @@ export interface ITrandingMenu {
13
13
  atlasJSON: any;
14
14
  atlasIMG: any;
15
15
  characterAvailableGold: number;
16
- onChangeTraderItems: (traderItems: ITradeResponseItem[]) => void;
17
16
  }
18
17
 
19
18
  export const TradingMenu: React.FC<ITrandingMenu> = ({
@@ -23,7 +22,6 @@ export const TradingMenu: React.FC<ITrandingMenu> = ({
23
22
  atlasJSON,
24
23
  atlasIMG,
25
24
  characterAvailableGold,
26
- onChangeTraderItems,
27
25
  onConfirm,
28
26
  }) => {
29
27
  const [sum, setSum] = useState(0);
@@ -40,11 +38,6 @@ export const TradingMenu: React.FC<ITrandingMenu> = ({
40
38
  });
41
39
  };
42
40
 
43
- useEffect(() => {
44
- if (onChangeTraderItems) {
45
- onChangeTraderItems(traderItems);
46
- }
47
- }, [traderItems]);
48
41
  const Capitalize = (word: string) => {
49
42
  return word[0].toUpperCase() + word.substring(1);
50
43
  };
@@ -64,8 +57,8 @@ export const TradingMenu: React.FC<ITrandingMenu> = ({
64
57
  <hr className="golden" />
65
58
  </div>
66
59
  <TradingComponentScrollWrapper>
67
- {traderItems.map(tradeItem => (
68
- <ItemWrapper>
60
+ {traderItems.map((tradeItem, index) => (
61
+ <ItemWrapper key={`${tradeItem.key}_${index}`}>
69
62
  <TradingItemRow
70
63
  atlasIMG={atlasIMG}
71
64
  atlasJSON={atlasJSON}
@@ -158,6 +151,7 @@ const GoldWrapper = styled.div`
158
151
  `;
159
152
 
160
153
  const AlertWrapper = styled.div`
154
+ margin-top: 1rem;
161
155
  display: flex;
162
156
  width: 100%;
163
157
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import { ITransactionItem } from '@rpg-engine/shared';
1
+ import { ITradeResponseItem } from '@rpg-engine/shared';
2
2
  import { Meta, Story } from '@storybook/react';
3
3
  import React from 'react';
4
4
  import { RPGUIRoot } from '../components/RPGUIRoot';
@@ -10,7 +10,7 @@ import {
10
10
  import atlasJSON from '../mocks/atlas/items/items.json';
11
11
  import atlasIMG from '../mocks/atlas/items/items.png';
12
12
 
13
- const updateChartTotals = (itemInfo: ITransactionItem) => {
13
+ const updateChartTotals = (itemInfo: ITradeResponseItem) => {
14
14
  console.log(itemInfo);
15
15
  // will be needed read all itens from chart list ignoring the current item (itemInfo) and recalculate the totals
16
16
  // with the amount updated set the total to a state to be shown to the player.
Binary file
Binary file