Skip to content

Commit

Permalink
feat: 스코어보드 시작 버튼 눌러야 보이게
Browse files Browse the repository at this point in the history
  • Loading branch information
glowisn committed Dec 12, 2023
1 parent b3a475e commit 66ede66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/components/buttons/ScoreBoardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function ScoreboardButton() {
const [isModalOpen, setIsModalOpen] = useState(false);
const [scores , setScores] = useState<Score[]>([]);
const modalOverlayRef = useRef<HTMLDivElement>(null);
const {roomCode} = useRoom();
const {roomCode,roomInfo} = useRoom();

const openModal = async () => {
try {
Expand All @@ -33,12 +33,16 @@ export default function ScoreboardButton() {
};
return (
<>
{roomInfo.isStarted ? (
<button
className="flex w-full flex-row items-center justify-center rounded-lg bg-accent px-3 py-2 text-default_white hover:opacity-80"
onClick={openModal}>
<FaChartSimple />
<div className="pl-2 font-medium">Scoreboard</div>
</button>
) : (
<></>
)}
{isModalOpen ? (
<ScoreBoardModal
scores={scores}
Expand Down

0 comments on commit 66ede66

Please sign in to comment.