diff --git a/src/components/GameBoard/DoudizhuGameBoard.js b/src/components/GameBoard/DoudizhuGameBoard.js
index 016f0ec..7658d9c 100644
--- a/src/components/GameBoard/DoudizhuGameBoard.js
+++ b/src/components/GameBoard/DoudizhuGameBoard.js
@@ -23,15 +23,33 @@ class DoudizhuGameBoard extends React.Component {
computePlayerPortrait(playerId, playerIdx) {
if (this.props.playerInfo.length > 0) {
+ const chipTitle =
+ this.props.playerInfo[playerIdx].agentInfo && this.props.playerInfo[playerIdx].agentInfo.name
+ ? ''
+ : 'ID';
+ const chipLabel =
+ this.props.playerInfo[playerIdx].agentInfo && this.props.playerInfo[playerIdx].agentInfo.name
+ ? this.props.playerInfo[playerIdx].agentInfo.name
+ : playerId;
return this.props.playerInfo[playerIdx].role === 'landlord' ? (
+
{millisecond2Second(this.props.considerationTime)}
- )
- }else{
- return
{this.computeActionText(this.props.latestAction[playerIdx])}
+ );
+ } else {
+ return
{this.computeActionText(this.props.latestAction[playerIdx])}
;
}
}
- displayPublicCard(){
- if(this.props.round === 0){
+ displayPublicCard() {
+ if (this.props.round === 0) {
return (
- )
- }else{
+ );
+ } else {
const [rankClass, suitClass, rankText, suitText] = translateCardData(this.props.publicCard);
return (
@@ -124,57 +140,68 @@ class LeducHoldemGameBoard extends React.Component {
{suitText}
- )
+ );
}
}
render() {
// compute the id as well as index in list for every player
const bottomId = this.props.mainPlayerId;
- let found = this.props.playerInfo.find(element=>{
+ let found = this.props.playerInfo.find((element) => {
return element.id === bottomId;
});
const bottomIdx = found ? found.index : -1;
- const topIdx = bottomIdx >= 0 ? (bottomIdx+1)%2 : -1;
+ const topIdx = bottomIdx >= 0 ? (bottomIdx + 1) % 2 : -1;
let topId = -1;
- if(topIdx > -1){
- found = this.props.playerInfo.find(element=>{
+ if (topIdx > -1) {
+ found = this.props.playerInfo.find((element) => {
return element.index === topIdx;
});
- if(found)
- topId = found.id;
+ if (found) topId = found.id;
}
return (