implemented purchase of a reserved card

This commit is contained in:
2022-08-16 12:18:22 -05:00
parent 40904d36d3
commit 6914d44900
4 changed files with 27 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ import { CardData, PlayerData } from "../../util/types"
import { hasMaxReserved } from "./ActionMethods/reserveCardActions";
import { hasMaxChips } from "./ActionMethods/getChipsActions";
import { v4 } from "uuid";
import Card from "../Card/Card";
export default function Player({ player, state, setState }: PlayerProps) {
const [dynamic, setDynamic] = useState<PlayerData>();
@@ -30,17 +31,7 @@ export default function Player({ player, state, setState }: PlayerProps) {
<p>Reserved cards:</p>
{
dynamic.reservedCards?.map((data: CardData) => {
return (
<div key={v4()} className="mini-card" id={`${dynamic.name}-player-ui`} style={{backgroundColor: 'white'}}>
<p>{data.gemValue} cards</p>
<p>{data.points + " points" || null}</p>
{
Object.entries(data.resourceCost).map(([key, value]) => {
return value > 0 && <p key={v4()}>{key}: {value}</p>
})
}
</div>
)
return <Card key={v4()} data={data} state={state} setState={setState} />
})
}
</>