Skip to content

Commit

Permalink
优化样式,增加上个出牌的人的提示
Browse files Browse the repository at this point in the history
  • Loading branch information
HullQin committed Oct 7, 2021
1 parent 7a467d3 commit ef91b3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Seat/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
width: 20px;
height: 20px;
line-height: 20px;
font-size: 20px;
font-size: 18px;
border-radius: 50%;
border: var(--seat-border) 2px solid;
background-color: black;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Room/GamingRoom/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const GamingRoom = (props) => {
render={(seat) => (
<>
<div className='room-seat-info'>
<div className='room-seat-role'>{game.state === 2 && game.landlord === seat ? '👲 地主' : '👨‍🌾 农民'}</div>
<div><span className='room-seat-rest'>{game.held[seat]}</span> 张牌</div>
<div className='room-seat-role' style={game.top === seat ? { color: 'red' } : undefined}>{game.state === 2 && game.landlord === seat ? '👲 地主' : '👨‍🌾 农民'}</div>
<div><span className='room-seat-rest' style={game.held[seat] < 3 ? { color: 'red' } : undefined}>{game.held[seat]}</span> 张牌</div>
</div>
{game.state === 2 && (
<StaticPokerList ids={game.last[seat]} overlap sort height={58} style={{ flex: '1 0 auto', marginLeft: 24 }} />
Expand Down
5 changes: 4 additions & 1 deletion src/pages/Room/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Room = () => {
revealed: [],
total: 0,
landlord: null,
top: null,
}));

useEffect(() => {
Expand Down Expand Up @@ -169,7 +170,9 @@ const Room = () => {
) : room.state === 1 ? (
<GamingRoom room={room} game={game} seat={seat} />
) : null}
<button style={{ position: 'absolute', top: 0, right: 0 }} onClick={() => setLocation('/')}>重选房间</button>
{room.state >= 0 && (
<button style={{ position: 'absolute', top: 0, right: 0 }} onClick={() => setLocation('/')}>重选房间</button>
)}
</>
);
};
Expand Down

0 comments on commit ef91b3b

Please sign in to comment.