- {player1Deck.map((item) => (
+ {gameOver ?
+
Turn: {turn}
+
+ {currentUser === 'Player 1' && <>
+
+ {player1Deck.map((item) => (
+
onCardPlayedHandler(item)}
+ src={require(`../assets/cards-front/${item}.png`).default}
+ width='100px'
+ />
+ ))}
+
+
+
+
+ {playedCardsPile && playedCardsPile.length>0 &&
onCardPlayedHandler(item)}
- src={require(`../assets/cards-front/${item}.png`).default}
+ src={require(`../assets/cards-front/${playedCardsPile[playedCardsPile.length-1]}.png`).default}
width='100px'
- />
- ))}
-
-
-
-
- {playedCardsPile && playedCardsPile.length>0 &&
-
}
-
-
-
- {player2Deck.map((item) => (
+ /> }
+
+
+
+ {player2Deck.map((item) => (
+
onCardPlayedHandler(item)}
+ src={require(`../assets/card-back.png`).default}
+ width='100px'
+ />
+ ))}
+
+
> }
+
+ {currentUser === 'Player 2' && <>
+
+ {player1Deck.map((item) => (
+
onCardPlayedHandler(item)}
+ src={require(`../assets/card-back.png`).default}
+ width='100px'
+ />
+ ))}
+
+
+
+
+ {playedCardsPile && playedCardsPile.length>0 &&
onCardPlayedHandler(item)}
- src={require(`../assets/card-back.png`).default}
+ src={require(`../assets/cards-front/${playedCardsPile[playedCardsPile.length-1]}.png`).default}
width='100px'
- />
- ))}
-
-
> }
+ /> }
+
+ {player2Deck.map((item) => (
+
onCardPlayedHandler(item)}
+ src={require(`../assets/cards-front/${item}.png`).default}
+ width='100px'
+ />
+ ))}
+
+
> }
- {currentUser === 'Player 2' && <>
-
- {player1Deck.map((item) => (
-
onCardPlayedHandler(item)}
- src={require(`../assets/card-back.png`).default}
- width='100px'
- />
- ))}
-
-
- {player2Deck.map((item) => (
-
onCardPlayedHandler(item)}
- src={require(`../assets/cards-front/${item}.png`).default}
- width='100px'
- />
- ))}
-
-