From c87d3aa6e115610f688a3fa3986c708d71479213 Mon Sep 17 00:00:00 2001 From: "chanki.kim" Date: Sat, 28 Dec 2024 10:54:25 +0900 Subject: [PATCH 01/72] =?UTF-8?q?Refactor(mentor):=20useResponsive?= =?UTF-8?q?=ED=9B=85=20=EB=82=B4=EB=B6=80=20=EB=B3=80=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useResponsive.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hooks/useResponsive.js b/src/hooks/useResponsive.js index fb4d92a72..ecbe87cbb 100644 --- a/src/hooks/useResponsive.js +++ b/src/hooks/useResponsive.js @@ -2,21 +2,21 @@ import { useEffect, useState } from "react"; import { getDeviceType } from "@util/breakpoints"; import { debounce } from "@util/debounce"; -export default function useReponsive( +export default function useResponsive( initialOption = { pc: 10, tablet: 6, mobile: 4, } ) { - const [pageSize, setPageSize] = useState( + const [responsiveValue, setResponsiveValue] = useState( () => initialOption[getDeviceType()] ); useEffect(() => { const debounceHandleResize = debounce(function () { const targetSize = initialOption[getDeviceType()]; - setPageSize(targetSize); + setResponsiveValue(targetSize); }, 100); window.addEventListener("resize", debounceHandleResize); @@ -26,5 +26,5 @@ export default function useReponsive( }; }, []); - return pageSize; + return responsiveValue; } From 4b8509b94732afa508acc68c7373242447756443 Mon Sep 17 00:00:00 2001 From: "chanki.kim" Date: Sat, 28 Dec 2024 11:15:58 +0900 Subject: [PATCH 02/72] =?UTF-8?q?Refactor(mentor):=20module=20css=EB=A5=BC?= =?UTF-8?q?=20flat=20=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Comment/Comment.module.scss | 45 +++-------- src/components/Comment/CommentAdd.jsx | 7 +- src/components/Comment/CommentAdd.module.scss | 3 + src/components/Comment/CommentForm.jsx | 77 +++++++++---------- .../Comment/CommentForm.module.scss | 13 +++- src/components/Section/Section.module.scss | 42 +++++----- 6 files changed, 86 insertions(+), 101 deletions(-) create mode 100644 src/components/Comment/CommentAdd.module.scss diff --git a/src/components/Comment/Comment.module.scss b/src/components/Comment/Comment.module.scss index 62947252c..823ef2540 100644 --- a/src/components/Comment/Comment.module.scss +++ b/src/components/Comment/Comment.module.scss @@ -2,41 +2,18 @@ margin-bottom: 2.4rem; padding-bottom: 2.4rem; border-bottom: 1px solid var(--color-secondary-200); +} - .form { - margin-bottom: -4rem; - } - - .comment { - display: flex; - gap: 2rem; - - .content { - flex: 1; - - .text { - margin-bottom: 2.4rem; - white-space: pre-wrap; - } - - .footer { - display: flex; - justify-content: space-between; - - .controls { - display: flex; - gap: 0.4rem; - } - } - } +.comment { + display: flex; + gap: 2rem; +} - .actions { - flex: 0 0 2.4rem; - } +.content { + flex: 1; +} - textarea { - height: 8rem; - margin-bottom: 1.6rem; - } - } +.text { + margin-bottom: 2.4rem; + white-space: pre-wrap; } diff --git a/src/components/Comment/CommentAdd.jsx b/src/components/Comment/CommentAdd.jsx index 3fc0fd404..ed83c9e28 100644 --- a/src/components/Comment/CommentAdd.jsx +++ b/src/components/Comment/CommentAdd.jsx @@ -1,7 +1,12 @@ import { CommentForm } from "."; import useComment from "./useComment"; +import styles from "./CommentAdd.module.scss"; export function CommentAdd({ name }) { const { handleSubmit } = useComment(name); - return ; + return ( +
+ +
+ ); } diff --git a/src/components/Comment/CommentAdd.module.scss b/src/components/Comment/CommentAdd.module.scss new file mode 100644 index 000000000..d36cc7558 --- /dev/null +++ b/src/components/Comment/CommentAdd.module.scss @@ -0,0 +1,3 @@ +.form { + margin-bottom: 4rem; +} diff --git a/src/components/Comment/CommentForm.jsx b/src/components/Comment/CommentForm.jsx index f3c542ad7..5a399859e 100644 --- a/src/components/Comment/CommentForm.jsx +++ b/src/components/Comment/CommentForm.jsx @@ -1,6 +1,5 @@ import useForm from "@hooks/useForm"; import { FieldItem, Form, Textarea } from "@components/Field"; -import { Section } from "@components/Section"; import { Author, Button } from "@components/ui"; import { commentSchema } from "./schema"; import styles from "./CommentForm.module.scss"; @@ -39,48 +38,44 @@ export function CommentForm({ error={formError} onSubmit={handleSubmit(onSubmit)} > -
- - - {!isEdit && ( - 문의하기 - )} -