Overnap

Chat 컴포넌트를 프롭으로 크기 변경할 수 있도록 수정

......@@ -4,7 +4,12 @@ import { MessageType, RawMessage } from '../common/types';
import { ChatLine } from './ChatLine';
import { ChatData } from './types';
export const Chat: React.FC = () => {
interface ChatProps {
w: string;
h: string;
}
export const Chat: React.FC<ChatProps> = (props) => {
const socket = useContext(SocketContext);
const [ input, setInput ] = useState('');
const [ chatLines, setChatLines ] = useState<ChatData[]>([]);
......@@ -45,8 +50,8 @@ export const Chat: React.FC = () => {
}, [input]);
return (
<div className='w-4/12'>
<div className='w-full h-80 rounded shadow flex flex-col overflow-y-scroll'>
<div className={props.w}>
<div className={`${props.h} w-full rounded shadow flex flex-col overflow-y-scroll`}>
{chatLines.map((line, i) => (<ChatLine key={16383+i} chatData={line}/>))}
<div ref={messageEndRef} />
</div>
......