diff --git a/src/components/GameBoard/DoudizhuGameBoard.js b/src/components/GameBoard/DoudizhuGameBoard.js index 8e42abe..09742e2 100644 --- a/src/components/GameBoard/DoudizhuGameBoard.js +++ b/src/components/GameBoard/DoudizhuGameBoard.js @@ -1,70 +1,65 @@ +import Avatar from '@material-ui/core/Avatar'; +import Button from '@material-ui/core/Button'; +import Chip from '@material-ui/core/Chip'; import React from 'react'; -import { translateCardData, millisecond2Second, computeHandCardsWidth } from '../../utils' - import '../../assets/doudizhu.scss'; import Landlord_wName from '../../assets/images/Portrait/Landlord_wName.png'; import Peasant_wName from '../../assets/images/Portrait/Peasant_wName.png'; import PlaceHolderPlayer from '../../assets/images/Portrait/Player.png'; - -import Button from "@material-ui/core/Button"; -import Chip from '@material-ui/core/Chip'; -import Avatar from '@material-ui/core/Avatar'; +import { computeHandCardsWidth, millisecond2Second, translateCardData } from '../../utils'; class DoudizhuGameBoard extends React.Component { - computePlayerPortrait(playerId, playerIdx){ - if(this.props.playerInfo.length > 0){ - return this.props.playerInfo[playerIdx].role === "landlord" ? + computePlayerPortrait(playerId, playerIdx) { + if (this.props.playerInfo.length > 0) { + return this.props.playerInfo[playerIdx].role === 'landlord' ? (
- {"Landlord"} - ID} - label={playerId} - clickable - color="primary" - /> + {'Landlord'} + ID} label={playerId} clickable color="primary" />
- : + ) : (
- {"Peasant"} - ID} - label={playerId} - clickable - color="primary" - /> + {'Peasant'} + ID} label={playerId} clickable color="primary" />
- }else + ); + } else return (
- {"Player"} - ID} - label={playerId} - clickable - color="primary" - /> + {'Player'} + ID} label={playerId} clickable color="primary" />
- ) + ); } - computeSingleLineHand(cards, fadeClassName="", cardSelectable = false) { - if(cards === "pass"){ - return
PASS
- }else{ + computeSingleLineHand(cards, fadeClassName = '', cardSelectable = false) { + if (cards === 'pass') { return ( -
-