feat: ChatInput 추가

This commit is contained in:
정기영 2024-07-16 14:01:40 +09:00
parent 96f764880d
commit e45385065e
3 changed files with 53 additions and 0 deletions

View 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>
);
}

View 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);
}

View File

@ -0,0 +1 @@
export { default as ChatInput } from './ChatInput';