Changeset 22367db for components/admin


Ignore:
Timestamp:
07/19/22 19:38:51 (2 years ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
41d3f60
Parents:
faff334
Message:

Added authentication with google

File:
1 edited

Legend:

Unmodified
Added
Removed
  • components/admin/LiveGames.jsx

    rfaff334 r22367db  
    7171                    <h5><Calculations action="calculateHandValue" cards={room.playerCards}/></h5>
    7272                  </div>
    73                   <p>Player {room.displayName} (${parseInt(room.initialBet) + parseInt(room.sideBet)})</p>
     73                  <p>Player {room?.displayName} (${parseInt(room.initialBet) + parseInt(room.sideBet)})</p>
    7474                </div>
    7575                <div>
    7676                  <div>
    7777                      <h6><span>Status:</span><br/>{room.status}</h6>
    78                       <h6><span>Outcome:</span><br/>{room.outcome}</h6>
    79                       <h6><span>Side Bet Outcome:</span><br/>{room.sideBetOutcome}</h6>
     78                      { room?.outcome?.length > 0 && <h6><span>Outcome:</span><br/>{room.outcome}</h6> }
     79                      { room?.sideBetOutcome?.length > 0 && <h6><span>Side Bet Outcome:</span><br/>{room.sideBetOutcome}</h6> }
    8080                  </div>
    8181                </div>
     
    9999                <span>Status: </span>{adminInformationState.adminInformation?.liveGames?.roulette?.status}&nbsp;&nbsp;&nbsp;&nbsp;
    100100                <span>Time to start: </span>{adminInformationState.adminInformation?.liveGames?.roulette?.timeToStart}&nbsp;&nbsp;&nbsp;&nbsp;
    101                 <span>Ball on number: </span>{adminInformationState.adminInformation?.liveGames?.roulette?.magicNumber}&nbsp;&nbsp;&nbsp;&nbsp;
    102                 <span>Winning bets: </span>{adminInformationState.adminInformation?.liveGames?.roulette?.winningBets?.join(", ")}
     101                { adminInformationState.adminInformation?.liveGames?.roulette?.magicNumber != -1 && <><span>Ball on number: </span>{adminInformationState.adminInformation?.liveGames?.roulette?.magicNumber}&nbsp;&nbsp;&nbsp;&nbsp;</> }
     102                { adminInformationState.adminInformation?.liveGames?.roulette?.magicNumber != -1 && <><span>Winning bets: </span>{adminInformationState.adminInformation?.liveGames?.roulette?.winningBets?.join(", ")}</> }
    103103              </h6>
    104104              <h6 style={{marginTop: '2rem'}}><span>Players:</span></h6>
     
    109109                  </div>
    110110                  <div>
    111                     <h6><span>{player.name} (${player.betAmount})</span></h6>
     111                    <h6><span>{player.name} (${player?.betAmount})</span></h6>
    112112                  </div>
    113113                  <div>
    114                     <h6><span>Betted on: </span>{player.whichBets.join(", ")}</h6>
     114                    { player?.whichBets?.length > 0 && <h6><span>Betted on: </span>{player?.whichBets?.join(", ")}</h6> }
    115115                  </div>
    116116                  <div>
    117                     <h6><span>Outcome: {player.outcome}</span></h6>
     117                    { adminInformationState.adminInformation?.liveGames?.roulette?.magicNumber != -1 && player?.whichBets?.length > 0 && <h6><span>Outcome: </span>{player.outcome}</h6> }
    118118                  </div>
    119119                </div>
     
    129129                  <span>Round: </span>{table?.round}/4&nbsp;&nbsp;&nbsp;&nbsp;
    130130                  <span>Started: </span>{table?.started}&nbsp;&nbsp;&nbsp;&nbsp;
    131                   <span>Player on turn: </span>{table?.turnIdx}&nbsp;&nbsp;&nbsp;&nbsp;
    132                   <span>Pot: </span>{table?.pot}&nbsp;&nbsp;&nbsp;&nbsp;
    133                   <span>Winners: </span>{table?.winners?.map(e=>e.displayName)?.join(", ")}
     131                  <span>Player on turn: </span>{table.players[table.turnIdx]?.displayName ?? '-'}&nbsp;&nbsp;&nbsp;&nbsp;
     132                  <span>Pot: </span>${table?.pot}&nbsp;&nbsp;&nbsp;&nbsp;
     133                  { table?.winners?.length > 0 && <><span>Winners: </span>{table?.winners?.map(e=>e?.displayName)?.join(", ")}</> }
    134134                </h6>
    135135                <div className="cardsOnTable" style={{marginTop: '2rem'}}>
     
    142142                  <div key={player.id} className="playerInLivePokerGame">
    143143                    <div>
    144                       <h6><span>Player {player.displayName} (${player.betAmount})</span></h6>
     144                      <h6><span>Player {player?.displayName} (${player.betAmount})</span></h6>
    145145                    </div>
    146146                    <div className="cards">
     
    150150                    </div>
    151151                    <div>
    152                       <h6><span>Hand: </span><Calculations action="getBestHandDetails" cards={player.cards} cards2={table.cards}/></h6>
     152                      { table?.cards?.length > 0 && <h6><span>Hand: </span><Calculations action="getBestHandDetails" cards={player.cards} cards2={table.cards}/></h6> }
    153153                    </div>
    154154                  </div>
Note: See TracChangeset for help on using the changeset viewer.