From ca3ce8bb5c9ef278bcc0c7094011fd4d7c46e90b Mon Sep 17 00:00:00 2001 From: hobaksweetpotato <164849940+hobaksweetpotato@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:47:28 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EB=AC=BC=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1=20=EB=B0=8F=20=ED=99=95=EC=9D=B8=20=EB=AA=A8=EB=8B=AC?= =?UTF-8?q?,=20=EA=B2=8C=EC=8B=9C=EB=AC=BC=20=EC=9E=91=EC=84=B1=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/common/post-box.js | 127 ++++++++++++++++++++++ src/app/components/common/post-confirm.js | 13 +++ src/app/components/common/post-page.js | 124 +++++++++++++++++++++ src/app/components/common/post-unuse.js | 71 ++++++++++++ src/app/components/common/post.js | 71 ------------ src/app/components/common/shortcut.js | 2 +- 6 files changed, 336 insertions(+), 72 deletions(-) create mode 100644 src/app/components/common/post-box.js create mode 100644 src/app/components/common/post-confirm.js create mode 100644 src/app/components/common/post-page.js create mode 100644 src/app/components/common/post-unuse.js delete mode 100644 src/app/components/common/post.js diff --git a/src/app/components/common/post-box.js b/src/app/components/common/post-box.js new file mode 100644 index 0000000..f32010d --- /dev/null +++ b/src/app/components/common/post-box.js @@ -0,0 +1,127 @@ +'use client'; + +import { useState } from 'react'; +import ConfirmModal from './post-confirm'; +import WritingPage from './post-page'; + +export default function PostBox({ onClose }) { + const [showConfirm, setShowConfirm] = useState(false); + const [showFullPage, setShowFullPage] = useState(false); + + const handleSubmit = () => { + console.log('등록 처리 완료'); + setShowConfirm(false); + onClose(); + }; + + const handleExpand = () => { + setShowFullPage(true); + }; + + if (showFullPage) { + return ; + } + + return ( +
+
+

상품 등록

+
+ {/* 이미지 업로드 */} +
+ + +
+ + {/* 제목 */} +
+ + +
+ + {/* 금액 + 인원 */} +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ + {/* 카테고리 + 거래방식 */} +
+
+ + +
+
+ + +
+
+ + {/* 상세설명 */} +
+ + +
+ + {/* 등록 버튼 */} + +
+ + {/* 등록 확인 모달 */} + {showConfirm && ( + setShowConfirm(false)} + onConfirm={handleSubmit} + /> + )} + + + + +
+
+ ); +} diff --git a/src/app/components/common/post-confirm.js b/src/app/components/common/post-confirm.js new file mode 100644 index 0000000..2011e2b --- /dev/null +++ b/src/app/components/common/post-confirm.js @@ -0,0 +1,13 @@ +export default function ConfirmModal({ onConfirm, onCancel }) { + return ( +
+
+

상품을 등록하시겠습니까?

+
+ + +
+
+
+ ); +} diff --git a/src/app/components/common/post-page.js b/src/app/components/common/post-page.js new file mode 100644 index 0000000..1afe1b7 --- /dev/null +++ b/src/app/components/common/post-page.js @@ -0,0 +1,124 @@ +'use client'; + +import { useState } from 'react'; +import { useRef } from 'react'; +import ConfirmModal from './post-confirm'; + +export default function WritingPage() { + const [showConfirm, setShowConfirm] = useState(false); + + const handleSubmit = () => { + console.log('등록 처리 완료'); + setShowConfirm(false); + onClose(); + }; + + const fileInputRef = useRef(null); + + const handleClick = () => { + fileInputRef.current?.click(); + }; + + return ( +
+ {/*

상품 등록

*/} +
+ {/* 이미지 업로드 */} +
+ +
📷 + 이미지 등록
+ +
+ + {/* 제목 */} +
+ + +
+ + {/* 금액 + 인원 */} +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ + {/* 카테고리 + 거래방식 */} +
+
+ + +
+
+ + +
+
+ + {/* 상세설명 */} +
+ + +
+ + {/* 등록 버튼 */} + +
+ + {/* 등록 확인 모달 */} + {showConfirm && ( + setShowConfirm(false)} + onConfirm={handleSubmit} + /> + )} +
+ ); +} diff --git a/src/app/components/common/post-unuse.js b/src/app/components/common/post-unuse.js new file mode 100644 index 0000000..4c1d092 --- /dev/null +++ b/src/app/components/common/post-unuse.js @@ -0,0 +1,71 @@ +// import { useState } from "react"; +// import Image from "next/image"; +// import category_lists from "@constants/simpleDB"; +// +// export default function PostBox({ onClose }) { +// const [activeTags, setActiveTags] = useState([]); +// +// const handleClick = (value) => { +// setActiveTags((prev) => +// prev.includes(value) ? prev.filter((v) => v !== value) : [...prev, value] +// ); +// }; +// +// return ( +//
+// {/* 상단 */} +//
+// +//

게시글

+//
+// +// {/* 제목 */} +//
+// +// +//
+// +// {/* 이미지 첨부 */} +//
+// +//
+//
+//
+// +//
+//
+// +// {/* 본문 입력 */} +//
+//