Merge pull request #19 from TeamBNBN/fe/chatInput
[Front-end] feat: ChatInput 추가
This commit is contained in:
commit
b9eb4b00c1
27
frontend/src/components/ChatInput/ChatInput.jsx
Normal file
27
frontend/src/components/ChatInput/ChatInput.jsx
Normal file
@ -0,0 +1,27 @@
|
||||
import styles from './ChatInput.module.css';
|
||||
import { useRef } from 'react';
|
||||
|
||||
export default function ChattingInput() {
|
||||
// TODO: 채팅이 넘어갈 시 줄바꿈이 되도록 수정
|
||||
// TODO: ㅁ 을 아이콘으로 변경
|
||||
const message = useRef('');
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
// TODO: 실제 메시지 전송 기능 추가
|
||||
console.log(message.current.value);
|
||||
message.current.value = '';
|
||||
};
|
||||
return (
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
className={styles.chattingInput}
|
||||
>
|
||||
<input
|
||||
ref={message}
|
||||
className={styles.input}
|
||||
placeholder="메시지를 입력하세요"
|
||||
/>
|
||||
<div onClick={handleSubmit}>ㅁ</div>
|
||||
</form>
|
||||
);
|
||||
}
|
25
frontend/src/components/ChatInput/ChatInput.module.css
Normal file
25
frontend/src/components/ChatInput/ChatInput.module.css
Normal file
@ -0,0 +1,25 @@
|
||||
.chattingInput {
|
||||
border-radius: 9999px;
|
||||
background-color: var(--background);
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.input {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
color: var(--text-color);
|
||||
border: 0;
|
||||
outline: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input::placeholder {
|
||||
color: var(--text-color-tertiary);
|
||||
}
|
1
frontend/src/components/ChatInput/index.js
Normal file
1
frontend/src/components/ChatInput/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as ChatInput } from './ChatInput';
|
Loading…
Reference in New Issue
Block a user