@@ -4,7 +4,7 @@ import { useState } from "react"
44import { useNavigate } from "react-router-dom"
55import { Settings } from "lucide-react"
66
7- function GameSettings ( { isHost = false , roomId, isReady = false , onReadyToggle } ) {
7+ function GameSettings ( { roomId } ) {
88 const [ timePerQuestion , setTimePerQuestion ] = useState ( "30초" )
99 const [ questionCount , setQuestionCount ] = useState ( 25 )
1010 const navigate = useNavigate ( )
@@ -22,77 +22,52 @@ function GameSettings({ isHost = false, roomId, isReady = false, onReadyToggle }
2222
2323 < div className = "space-y-4" >
2424 < div >
25- < label className = "block text-sm font-medium text-gray-700 mb-2" > 퀴즈 카테고리</ label >
26- { isHost ? (
27- < button className = "w-full px-4 py-3 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors font-medium" >
28- 퀴즈 선택
29- </ button >
30- ) : (
31- < div className = "w-full px-4 py-3 bg-gray-100 text-gray-600 rounded-lg font-medium" >
32- F1 2024 시즌 퀴즈 (방장이 선택함)
33- </ div >
34- ) }
25+ < label className = "block text-sm font-medium text-gray-700 mb-2" > 퀴즈</ label >
26+ < button className = "w-full px-4 py-3 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors font-medium" >
27+ 퀴즈 선택
28+ </ button >
3529 </ div >
3630
3731 < div className = "grid grid-cols-2 gap-4" >
3832 < div >
3933 < label className = "block text-sm font-medium text-gray-700 mb-2" > 제한 시간</ label >
40- { isHost ? (
41- < select
42- value = { timePerQuestion }
43- onChange = { ( e ) => setTimePerQuestion ( e . target . value ) }
44- className = "w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 appearance-none bg-white bg-no-repeat bg-right pr-8"
45- style = { {
46- backgroundImage : `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e")` ,
47- backgroundPosition : "right 0.5rem center" ,
48- backgroundSize : "1.5em 1.5em" ,
49- } }
50- >
51- < option > 15초</ option >
52- < option > 30초</ option >
53- < option > 45초</ option >
54- < option > 60초</ option >
55- </ select >
56- ) : (
57- < div className = "w-full px-3 py-2 bg-gray-100 text-gray-600 rounded-lg" > { timePerQuestion } </ div >
58- ) }
34+ < select
35+ value = { timePerQuestion }
36+ onChange = { ( e ) => setTimePerQuestion ( e . target . value ) }
37+ className = "w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 appearance-none bg-white bg-no-repeat bg-right pr-8"
38+ style = { {
39+ backgroundImage : `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e")` ,
40+ backgroundPosition : "right 0.5rem center" ,
41+ backgroundSize : "1.5em 1.5em" ,
42+ } }
43+ >
44+ < option > 15초</ option >
45+ < option > 30초</ option >
46+ < option > 45초</ option >
47+ < option > 60초</ option >
48+ </ select >
5949 </ div >
6050 < div >
6151 < label className = "block text-sm font-medium text-gray-700 mb-2" > 문제 수</ label >
62- { isHost ? (
63- < input
64- type = "number"
65- min = "10"
66- max = "80"
67- value = { questionCount }
68- onChange = { ( e ) => setQuestionCount ( Number . parseInt ( e . target . value ) || 30 ) }
69- className = "w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
70- placeholder = "문제 수를 입력하세요 (10-80)"
71- />
72- ) : (
73- < div className = "w-full px-3 py-2 bg-gray-100 text-gray-600 rounded-lg" > { questionCount } 문제</ div >
74- ) }
52+ < input
53+ type = "number"
54+ min = "10"
55+ max = "80"
56+ value = { questionCount }
57+ onChange = { ( e ) => setQuestionCount ( Number . parseInt ( e . target . value ) || 30 ) }
58+ className = "w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
59+ placeholder = "문제 수를 입력하세요 (10-80)"
60+ />
7561 </ div >
7662 </ div >
7763
7864 < div className = "pt-4" >
79- { isHost ? (
80- < button
81- onClick = { handleStartGame }
82- className = "w-full px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors font-semibold"
83- >
84- 게임 시작
85- </ button >
86- ) : (
87- < button
88- onClick = { onReadyToggle }
89- className = { `w-full px-6 py-3 rounded-lg transition-colors font-semibold ${
90- isReady ? "bg-red-600 text-white hover:bg-red-700" : "bg-blue-600 text-white hover:bg-blue-700"
91- } `}
92- >
93- { isReady ? "준비 취소" : "준비 완료" }
94- </ button >
95- ) }
65+ < button
66+ onClick = { handleStartGame }
67+ className = "w-full px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors font-semibold"
68+ >
69+ 게임 시작
70+ </ button >
9671 </ div >
9772 </ div >
9873 </ div >
0 commit comments