From e45385065e84876b2880c16fcfcae9adc74c0a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EA=B8=B0=EC=98=81?= Date: Tue, 16 Jul 2024 14:01:40 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20ChatInput=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ChatInput/ChatInput.jsx | 27 +++++++++++++++++++ .../components/ChatInput/ChatInput.module.css | 25 +++++++++++++++++ frontend/src/components/ChatInput/index.js | 1 + 3 files changed, 53 insertions(+) create mode 100644 frontend/src/components/ChatInput/ChatInput.jsx create mode 100644 frontend/src/components/ChatInput/ChatInput.module.css create mode 100644 frontend/src/components/ChatInput/index.js diff --git a/frontend/src/components/ChatInput/ChatInput.jsx b/frontend/src/components/ChatInput/ChatInput.jsx new file mode 100644 index 0000000..273cd53 --- /dev/null +++ b/frontend/src/components/ChatInput/ChatInput.jsx @@ -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 ( +
+ +
+
+ ); +} diff --git a/frontend/src/components/ChatInput/ChatInput.module.css b/frontend/src/components/ChatInput/ChatInput.module.css new file mode 100644 index 0000000..b76ac65 --- /dev/null +++ b/frontend/src/components/ChatInput/ChatInput.module.css @@ -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); +} diff --git a/frontend/src/components/ChatInput/index.js b/frontend/src/components/ChatInput/index.js new file mode 100644 index 0000000..8475734 --- /dev/null +++ b/frontend/src/components/ChatInput/index.js @@ -0,0 +1 @@ +export { default as ChatInput } from './ChatInput'; \ No newline at end of file