Merge pull request #19 from TeamBNBN/fe/chatInput

[Front-end] feat: ChatInput 추가
This commit is contained in:
Jo Hyeonsoo 2024-07-16 14:10:17 +09:00 committed by GitHub
commit b9eb4b00c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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';