From c08e23d65986e86ce92dba412f41e6e26cbb920e Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 14 Nov 2021 16:57:58 +0100 Subject: [PATCH] implemented add new card --- src/components/CardGroup.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/CardGroup.tsx b/src/components/CardGroup.tsx index d4b335f..647ec7b 100644 --- a/src/components/CardGroup.tsx +++ b/src/components/CardGroup.tsx @@ -1,4 +1,5 @@ import React from "react" +import Card from "../types/Card" import CardGroup from "../types/CardGroup" import Side from "../types/Side" import CardComp from "./Card" @@ -33,6 +34,18 @@ const CardGroupComp: React.FC = ({cardGroup,side,onChange,onRemove}) => { )} /> )} +
onChange?.( + new CardGroup( + cardGroup.numInDeck, + ...cardGroup.cards, + new Card("New card",false,false) + ) + )} + > + Add card +
)