Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Overnap
2021-06-09 17:52:12 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1bbaeb98970ba3ab134dd751a71ff1d8d655cb39
1bbaeb98
1 parent
7fec6ca8
Chat 컴포넌트를 프롭으로 크기 변경할 수 있도록 수정
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
web/src/components/room/Chat.tsx
web/src/components/room/Chat.tsx
View file @
1bbaeb9
...
...
@@ -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>
...
...
Please
register
or
login
to post a comment