Overnap

Room에서 인게임 여부에 따라 구성이 변화하도록 수정

...@@ -24,6 +24,7 @@ export const Room: React.FC = () => { ...@@ -24,6 +24,7 @@ export const Room: React.FC = () => {
24 maxUsers: 9, 24 maxUsers: 9,
25 users: [] 25 users: []
26 }); 26 });
27 + const [ isInGame, setIsInGame ] = useState(false);
27 28
28 const handleUpdateRoomUser = useCallback((rawMessage: RawMessage) => { 29 const handleUpdateRoomUser = useCallback((rawMessage: RawMessage) => {
29 if (rawMessage.type == MessageType.ROOM_USER_UPDATE) { 30 if (rawMessage.type == MessageType.ROOM_USER_UPDATE) {
...@@ -79,10 +80,18 @@ export const Room: React.FC = () => { ...@@ -79,10 +80,18 @@ export const Room: React.FC = () => {
79 return ( 80 return (
80 <Main> 81 <Main>
81 <RoomInfo roomData={roomData}/> 82 <RoomInfo roomData={roomData}/>
82 - <div className='w-full flex'> 83 + {
83 - <Canvas /> 84 + isInGame ? (
84 - <Chat /> 85 + <div className='w-full flex'>
85 - </div> 86 + <Canvas />
87 + <Chat w='w-4/12' h='h-80' />
88 + </div>
89 + ) : (
90 + <div className='w-full flex justify-center'>
91 + <Chat w='w-9/12' h='h-96' />
92 + </div>
93 + )
94 + }
86 </Main> 95 </Main>
87 ); 96 );
88 } 97 }
...\ No newline at end of file ...\ No newline at end of file
......