@@ -10,12 +10,12 @@ const CreateRoom = () => {
1010 const [ end , setEnd ] = useState ( '' ) ;
1111 const [ dateTime , setDateTime ] = useState ( '' ) ;
1212 const [ roomName , setRoomName ] = useState ( '' ) ;
13- const [ maxParticipants , setMaxParticipants ] = useState ( 1 ) ;
13+ const [ minParticipants , setMinParticipants ] = useState ( 2 ) ;
1414
1515 const handleParticipantChange = ( amount : number ) => {
16- setMaxParticipants ( ( prev ) => {
16+ setMinParticipants ( ( prev ) => {
1717 const newValue = prev + amount ;
18- if ( newValue >= 1 && newValue <= 4 ) {
18+ if ( newValue >= 2 && newValue <= 4 ) {
1919 return newValue ;
2020 }
2121 return prev ;
@@ -30,9 +30,11 @@ const CreateRoom = () => {
3030
3131 // check for development
3232 if ( ! userState . isLoggedIn ) {
33- // placeholder email
34- // alert("로그인이 필요합니다.");
35- // return;
33+ alert ( '로그인이 필요합니다.' ) ;
34+ window . location . href = '/login' ;
35+ return ;
36+ }
37+ if ( import . meta. env . DEV ) {
3638 userState . email = 'dev@snu.ac.kr' ;
3739 }
3840
@@ -42,7 +44,7 @@ const CreateRoom = () => {
4244 from : start ,
4345 to : end ,
4446 time : dateTime ,
45- maxHeadcount : maxParticipants ,
47+ minHeadcount : minParticipants ,
4648 user : userState . email , // Send user's email
4749 } ) ;
4850
@@ -112,10 +114,10 @@ const CreateRoom = () => {
112114
113115 < div className = "card" >
114116 < div className = "input-group" >
115- < label > 최대 인원</ label >
117+ < label > 최소 인원</ label >
116118 < div className = "participant-control" >
117119 < button onClick = { ( ) => handleParticipantChange ( - 1 ) } > -</ button >
118- < span > { maxParticipants } 명</ span >
120+ < span > { minParticipants } 명</ span >
119121 < button onClick = { ( ) => handleParticipantChange ( 1 ) } > +</ button >
120122 </ div >
121123 </ div >
0 commit comments