diff --git a/src/app/recommend/page.tsx b/src/app/recommend/page.tsx index 51ea433..8ff49e0 100644 --- a/src/app/recommend/page.tsx +++ b/src/app/recommend/page.tsx @@ -1,6 +1,4 @@ -import ChatForm from '@/domains/recommend/components/ChatForm'; -import MyChat from '@/domains/recommend/components/MyChat'; -import SsuryChat from '@/domains/recommend/components/SsuryChat'; +import ChatSection from '@/domains/recommend/components/ChatSection'; import Bg from '@/shared/assets/images/recommend_bg.webp'; function Page() { @@ -10,13 +8,7 @@ function Page() { style={{ backgroundImage: `url(${Bg.src})` }} >

취향추천하기

-
-
- - -
-
- + ); } diff --git a/src/domains/recipe/skeleton/SkeletonRecipe.tsx b/src/domains/recipe/skeleton/SkeletonRecipe.tsx index 1b3229a..cb9fbd7 100644 --- a/src/domains/recipe/skeleton/SkeletonRecipe.tsx +++ b/src/domains/recipe/skeleton/SkeletonRecipe.tsx @@ -38,7 +38,6 @@ function SkeletonRecipe() { ))} - ); } diff --git a/src/domains/recommend/components/ChatForm.tsx b/src/domains/recommend/components/ChatForm.tsx index 68a8445..57e8e44 100644 --- a/src/domains/recommend/components/ChatForm.tsx +++ b/src/domains/recommend/components/ChatForm.tsx @@ -1,16 +1,23 @@ 'use client'; import Send from '@/shared/assets/icons/send_36.svg'; -import { keyDown } from '@/shared/utills/keyDown'; +import { handleTextareaSubmit } from '@/shared/utills/handleTextareaSubmit'; +import { resizeTextarea } from '@/shared/utills/textareaResize'; +import { useRef, useState } from 'react'; -function ChatForm() { - const handleInput = (e: React.FormEvent) => { - const target = e.currentTarget; +interface Props { + onSubmit: (message: string) => void; +} + +function ChatForm({ onSubmit }: Props) { + const [value, setValue] = useState(''); + const textareaRef = useRef(null); - if (target.value == '') { - target.style.height = ''; - } - target.style.height = `${target.scrollHeight}px`; + const handleSubmit = (value: string) => { + const text = value.trim(); + if (!text) return; + onSubmit(text); + setValue(''); }; return ( @@ -21,15 +28,19 @@ function ChatForm() { 질문 입력창