Overnap

UserInfo 컴포넌트 추가 및 Room 컴포넌트에 적용

1 +import React from 'react';
2 +import { User } from './types';
3 +import { UserStatus } from './UserStatus';
4 +
5 +interface UserInfoProps {
6 + users: User[];
7 +}
8 +
9 +export const UserInfo: React.FC<UserInfoProps> = ({ users }) => {
10 + return (
11 + <div className='w-7/12 h-60 flex justify-center'>
12 + {users.map((user) => (<UserStatus user={user} />))}
13 + </div>
14 + );
15 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -6,6 +6,8 @@ import { Canvas } from '../components/room/Canvas'; ...@@ -6,6 +6,8 @@ import { Canvas } from '../components/room/Canvas';
6 import { Chat } from '../components/room/Chat'; 6 import { Chat } from '../components/room/Chat';
7 import { RoomInfo } from '../components/room/RoomInfo'; 7 import { RoomInfo } from '../components/room/RoomInfo';
8 import { RoomData, UpdateRoomUser } from '../components/room/types'; 8 import { RoomData, UpdateRoomUser } from '../components/room/types';
9 +import { UserInfo } from '../components/room/UserInfo';
10 +import { UserStatus } from '../components/room/UserStatus';
9 import SocketContext from '../contexts/SocketContext'; 11 import SocketContext from '../contexts/SocketContext';
10 12
11 interface RoomLocation { 13 interface RoomLocation {
...@@ -87,8 +89,9 @@ export const Room: React.FC = () => { ...@@ -87,8 +89,9 @@ export const Room: React.FC = () => {
87 <Chat w='w-4/12' h='h-80' /> 89 <Chat w='w-4/12' h='h-80' />
88 </div> 90 </div>
89 ) : ( 91 ) : (
90 - <div className='w-full flex justify-center'> 92 + <div className='w-full flex flex-col justify-center items-center'>
91 - <Chat w='w-9/12' h='h-96' /> 93 + <UserInfo users={roomData.users}/>
94 + <Chat w='w-7/12' h='h-96' />
92 </div> 95 </div>
93 ) 96 )
94 } 97 }
......