From 967a449029a371647b105b030869bad1f3b042fa Mon Sep 17 00:00:00 2001 From: parkseyoung Date: Fri, 25 Oct 2024 10:42:29 +0900 Subject: [PATCH] =?UTF-8?q?styles:=20=EB=8C=93=EA=B8=80=EB=8B=A4=EB=8A=94?= =?UTF-8?q?=20=EB=B6=80=EB=B6=84=20scss=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/Comment.jsx | 2 +- src/component/CommentInput.jsx | 8 ++--- src/component/styles/CommentInput.scss | 45 ++++++++++++++++++++++++++ src/containers/PostForm.jsx | 1 + 4 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 src/component/styles/CommentInput.scss diff --git a/src/component/Comment.jsx b/src/component/Comment.jsx index 60a122b..c3d2ff2 100644 --- a/src/component/Comment.jsx +++ b/src/component/Comment.jsx @@ -230,7 +230,7 @@ const Comment = ({ parentId={comment.id} postId={postId} // 명시적으로 postId 전달 currentUserId={currentUserId} // 명시적으로 currentUserId 전달 - depth={depth} + depth={depth + 1} /> )} diff --git a/src/component/CommentInput.jsx b/src/component/CommentInput.jsx index 7f8ae34..e38528c 100644 --- a/src/component/CommentInput.jsx +++ b/src/component/CommentInput.jsx @@ -1,5 +1,6 @@ import PropTypes from "prop-types"; import { useState } from "react"; +import "./styles/CommentInput.scss"; const CommentInput = ({ onSubmit, @@ -17,16 +18,15 @@ const CommentInput = ({ if (!content.trim() || isSubmitting) return; try { - // 모든 필요한 파라미터를 명시적으로 전달 await onSubmit(postId, currentUserId, content.trim(), parentId, depth); - setContent(""); // 입력 성공 시 초기화 + setContent(""); } catch (error) { console.error("댓글 작성 실패:", error); } }; return ( -
+