From e675e4cff6076bc3ca3d3fe351168c9373ff29c3 Mon Sep 17 00:00:00 2001 From: bicochan Date: Fri, 9 May 2025 14:38:54 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B2=8C=EC=8B=9C=EB=AC=BC=20=EB=8B=B5?= =?UTF-8?q?=EA=B8=80=20=EB=93=B1=EB=A1=9D=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pst/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx | 10 ++++++++++ .../src/pages/(pst)/normal/ui/create-page.tsx | 9 +++++++-- .../src/widgets/post/model/post-table-columns.tsx | 15 +++++++++++++-- .../features/src/widgets/post/ui/post-action.tsx | 8 ++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 apps/common/features/app/(with-base-layout)/pst/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx diff --git a/apps/common/features/app/(with-base-layout)/pst/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx b/apps/common/features/app/(with-base-layout)/pst/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx new file mode 100644 index 000000000..bf13cb3e7 --- /dev/null +++ b/apps/common/features/app/(with-base-layout)/pst/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx @@ -0,0 +1,10 @@ +import { CreatePage } from "@/pages/(pst)/normal"; + +export default async function PstBbsNormalAnswerPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx b/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx index ddbc22ece..c5cbf7923 100644 --- a/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx +++ b/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx @@ -8,7 +8,9 @@ import { PostForm } from "@/widgets/post"; import { PostApi, postFormSchema, type PostFormData } from "@/entities/post"; import { useAlertStore, useUserStore } from "@/shared/lib"; -function CreatePage({ bbsId }: { bbsId: string }) { +function CreatePage({ bbsId, pstNo }: { bbsId: string; pstNo?: string }) { + const answerRegisterMode = !!pstNo; + const router = useRouter(); const { userInfo } = useUserStore((state) => state); const { setMessage: alert } = useAlertStore((state) => state); @@ -30,13 +32,16 @@ function CreatePage({ bbsId }: { bbsId: string }) { popupYn: "N", upndFixYn: "N", prdPstgYn: "N", + parentPstNo: pstNo ? parseInt(pstNo) : null, }, }); return (
-

게시글 등록

+

+ {answerRegisterMode ? "답글 등록" : "게시글 등록"} +

diff --git a/apps/common/features/src/widgets/post/model/post-table-columns.tsx b/apps/common/features/src/widgets/post/model/post-table-columns.tsx index 63987c0c2..e892b5d82 100644 --- a/apps/common/features/src/widgets/post/model/post-table-columns.tsx +++ b/apps/common/features/src/widgets/post/model/post-table-columns.tsx @@ -47,10 +47,21 @@ export const columns: ColumnDef[] = [ accessorKey: "pstTtl", header: "제목", cell: ({ row }) => { - const { pstTtl, inqNocs } = row.original; + const { ansPstn, pstTtl, inqNocs } = row.original; return ( -
+
+ {ansPstn > 0 && ( +
+
+ +
+ 답변 +
+ )} {inqNocs >= 100 && HOT} {dayjs().diff(dayjs(row.original.regDt), "hour") < 24 && ( NEW diff --git a/apps/common/features/src/widgets/post/ui/post-action.tsx b/apps/common/features/src/widgets/post/ui/post-action.tsx index 6cc9fc100..f427136dd 100644 --- a/apps/common/features/src/widgets/post/ui/post-action.tsx +++ b/apps/common/features/src/widgets/post/ui/post-action.tsx @@ -50,6 +50,14 @@ function PostAction({ children, bbsId, pstNo }: PostActionProps) { > 수정 +