Skip to content

Commit

Permalink
feat: 발언 종료 버튼 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
zizonyoungjun committed Dec 1, 2024
1 parent 3d295a6 commit 42d4ee8
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import EndingResult from './GamePhases/EndingResult';
import { usePeerConnectionStore } from '@/states/store/peerConnectionStore';
import VideoStream from '@/components/gamePage/stream/VideoStream';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { useSpeakingControl } from '@/hooks/useSpeakingControl';

export default function MainDisplay() {
const { userId } = useAuthStore();
Expand All @@ -28,6 +29,8 @@ export default function MainDisplay() {
const [selectedVote, setSelectedVote] = useState<string | null>(null);
const [isVoteSubmitted, setIsVoteSubmitted] = useState(false);
const { gameStartData, currentSpeaker, endSpeaking, votePinoco } = useGameSocket(setGamePhase);
const { endSpeakingEarly } = useSpeakingControl(currentSpeaker, userId);

const { endingResult } = useEnding(setGamePhase);
const { submitGuess } = useGuessing(isPinoco, setGamePhase);
const { voteResult, deadPerson, isDeadPersonPinoco } = useVoteResult(
Expand Down Expand Up @@ -103,6 +106,14 @@ export default function MainDisplay() {
<div className="absolute p-2 text-lg rounded-lg top-16 left-4 text-white-default bg-slate-950">
📢 {currentSpeaker}
</div>
{currentSpeaker === userId && (
<button
className="mt-4 px-6 py-2 bg-green-default text-white-default rounded-lg hover:bg-green-200 hover:text-black self-end ml-auto"
onClick={endSpeakingEarly}
>
발언 종료
</button>
)}
</div>
)}

Expand Down

0 comments on commit 42d4ee8

Please sign in to comment.