implemented adding new card groups

This commit is contained in:
Djeeberjr 2021-11-14 16:50:09 +01:00
parent eebc68e4ad
commit e559f9e29a

View File

@ -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<Props> = ({deck,side,title,onChange}) => {
}}
/>
)}
<div className="bg-red-500 m-1 p-1 cursor-pointer"
onClick={()=>onChange?.(
new Deck(
deck.numDefusers,
...deck.cardGroups,
new CardGroup(1,new Card("New card",false,false))
)
)}
>
<div>
Add Group
</div>
</div>
</div>
</div>
)