diff --git a/packages/client/src/ui/Chessboard.css b/packages/client/src/ui/Chessboard.css index f66cb6e..5c257c7 100644 --- a/packages/client/src/ui/Chessboard.css +++ b/packages/client/src/ui/Chessboard.css @@ -285,72 +285,6 @@ /* line-height: 0px; */ } -.playerList { - width: 295px; - background: linear-gradient( - 180deg, - rgba(80, 219, 255, 0.27) 0%, - rgba(255, 255, 255, 0) 100% - ); - border-radius: 20px 20px 20px 20px; - opacity: 1; - padding: 20px 10px; - box-sizing: border-box; -} - -.playerList-tit { - height: 21px; - font-size: 16px; - font-family: Arial-Regular, Arial; - font-weight: 400; - color: #ffffff; - line-height: 0px; -} - -.players { - width: 275px; - height: 76px; - background: rgba(0, 0, 0, 0.27); - border-radius: 10px 10px 10px 10px; - opacity: 1; -} - -.player-addr { - width: 100px; - height: 16px; - font-size: 14px; - font-family: Arial-Regular, Arial; - font-weight: 400; - color: #ffffff; - line-height: 1; -} -.player-coin { - width: 30px; - height: 16px; - font-size: 14px; - font-family: Arial-Regular, Arial; - font-weight: 400; - color: #ffd426; - line-height: 1; -} -.player-lv { - width: 30px; - height: 16px; - font-size: 14px; - font-family: Arial-Regular, Arial; - font-weight: 400; - color: #ff7167; - line-height: 1; -} - -.player-hp { - height: 17px; - font-size: 16px; - font-family: Arial-Regular, Arial; - font-weight: 400; - color: red; -} - .notice-board { width: 109px; height: 70px; diff --git a/packages/client/src/ui/Playlist.tsx b/packages/client/src/ui/Playlist.tsx index e08f477..5de5ab5 100644 --- a/packages/client/src/ui/Playlist.tsx +++ b/packages/client/src/ui/Playlist.tsx @@ -1,17 +1,57 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import useChessboard from "@/hooks/useChessboard"; -interface Player { +interface IPlayerStatus { id: string; + name: string; + isCurrent: boolean; avatar: string; level: number; hp: number; + maxHp: number; coin: number; } -interface Props { - players: Player[]; - currentUserId: string; +function PlayerStatus({ + id, + name, + isCurrent, + avatar, + level, + hp, + maxHp, + coin, +}: IPlayerStatus) { + const healthPercentage = (hp / maxHp) * 100; + + return ( +