From d1154817184e447f3c137a1b0058db8fdd424c4c Mon Sep 17 00:00:00 2001
From: Mikayla Dobson <93477693+innocuous-symmetry@users.noreply.github.com>
Date: Sat, 16 Apr 2022 11:56:54 -0500
Subject: [PATCH] card tier handling for game board rendering
---
client/src/components/Game/GameBoard.js | 33 ++++++++++++++++---------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/client/src/components/Game/GameBoard.js b/client/src/components/Game/GameBoard.js
index a3e2f99..71c461b 100644
--- a/client/src/components/Game/GameBoard.js
+++ b/client/src/components/Game/GameBoard.js
@@ -10,31 +10,42 @@ export default function GameBoard() {
const [tierOne, setTierOne] = useState(null);
const [content, setContent] = useState(null);
-
- let currentCards = {
- tierOneCards: null,
- tierTwoCards: null,
- tierThreeCards: null,
- };
useEffect(() => {
// param limit sets limit on number of cards rendered
// param tier filters by card tier
- const buildGameBoardRow = (limit) => {
+ const buildGameBoardRow = (limit, tier) => {
let newBoard = [];
let iter = 0;
for (let cardConfig of CardDeck) {
+ if (cardConfig.tier !== tier) continue;
while (iter < limit) {
iter++;
// if (cardConfig.tier !== tier) continue;
newBoard.push(