From e559f9e29ac1427397b1dfec243059a88990d3cb Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 14 Nov 2021 16:50:09 +0100 Subject: [PATCH] implemented adding new card groups --- src/components/Deck.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/Deck.tsx b/src/components/Deck.tsx index a550323..ce4ba89 100644 --- a/src/components/Deck.tsx +++ b/src/components/Deck.tsx @@ -1,4 +1,6 @@ import React from "react" +import Card from "../types/Card" +import CardGroup from "../types/CardGroup" import Deck from "../types/Deck" import Side from "../types/Side" import CardGroupComp from "./CardGroup" @@ -37,6 +39,19 @@ const DeckComp: React.FC = ({deck,side,title,onChange}) => { }} /> )} +
onChange?.( + new Deck( + deck.numDefusers, + ...deck.cardGroups, + new CardGroup(1,new Card("New card",false,false)) + ) + )} + > +
+ Add Group +
+
)