source: components/blackjack/Cards.jsx@ 95ce58b

main
Last change on this file since 95ce58b was 9bd09b0, checked in by anastasovv <simon@…>, 2 years ago

Roulette place a bet functionality

  • Property mode set to 100644
File size: 861 bytes
Line 
1import React from 'react'
2
3import { useSelector } from 'react-redux'
4
5import Card from '../Card'
6
7const Cards = () => {
8 const playerState = useSelector(state => state.player)
9
10 let playerPos = {
11 left: 50,
12 top: 75.5
13 }
14
15 let dealerPos = {
16 left: 50,
17 top: 32,
18 }
19
20 const splitCardsMultiplyByInt = 2;
21
22 return (
23 <div className="blackjackCards">
24 {playerState?.blackjackGame?.playerCards?.map((card, i) => (
25 <Card key={card} card={card} rotateZ={i*splitCardsMultiplyByInt} pos={{left: playerPos.left+i*splitCardsMultiplyByInt, top: playerPos.top}}/>
26 ))}
27 {playerState?.blackjackGame?.dealerCards?.map((card, i) => (
28 <Card key={card} card={card} rotateZ={i*splitCardsMultiplyByInt} pos={{left: dealerPos.left+i*splitCardsMultiplyByInt, top: dealerPos.top}}/>
29 ))}
30 </div>
31 )
32}
33
34export default Cards
Note: See TracBrowser for help on using the repository browser.