From e8bf2a79473f563f2ed5a52b464be2c6498bec89 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 14 Nov 2021 17:40:54 +0100 Subject: [PATCH] "fixed" some keys in loops --- src/components/Card.tsx | 4 +++- src/components/CardGroup.tsx | 5 ++++- src/components/Deck.tsx | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/Card.tsx b/src/components/Card.tsx index f31f220..256ee6c 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -27,7 +27,9 @@ const CardComp: React.FC = ({card,side,onChange,onRemove}) => {
{card.items.map((item,i)=> -
+
{ItemToDisplay(item,side)} { onChange?.(new Card(card.title,card.armor,card.helmet,...card.items.filter((_,fi)=>i!==fi))) }} className="float-right cursor-pointer" >X diff --git a/src/components/CardGroup.tsx b/src/components/CardGroup.tsx index 347de2c..5c52c0f 100644 --- a/src/components/CardGroup.tsx +++ b/src/components/CardGroup.tsx @@ -21,7 +21,10 @@ const CardGroupComp: React.FC = ({cardGroup,side,onChange,onRemove}) => { />
{cardGroup.cards.map((card,index) => - { onChange?.(new CardGroup( cardGroup.numInDeck, diff --git a/src/components/Deck.tsx b/src/components/Deck.tsx index ce4ba89..6a39fdc 100644 --- a/src/components/Deck.tsx +++ b/src/components/Deck.tsx @@ -24,7 +24,10 @@ const DeckComp: React.FC = ({deck,side,title,onChange}) => { /> }
{deck.cardGroups.map((group,index) => - { onChange?.(new Deck( deck.numDefusers,