From 68d949c647fb167f91e28c2c0c59b224a2d28193 Mon Sep 17 00:00:00 2001 From: Kwon Seo Jin <97675977+B0XERCAT@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:43:24 +0900 Subject: [PATCH] feat(fe): implement notice create and detail page (#2248) * feat(fe): add create notice gql mutation * feat(fe): implement notice create page * feat(fe): add simple notice detail page * fix(fe): replace sanitize with KatexContent * chore(fe): route to detail page after creating notice --- .../(main)/notice/[noticeId]/page.tsx | 8 +-- .../{problem => }/_components/VisibleForm.tsx | 2 +- .../app/admin/notice/[noticeId]/page.tsx | 39 +++++++++++++ .../notice/_components/CreateNoticeForm.tsx | 58 +++++++++++++++++++ .../admin/notice/_components/FixedForm.tsx | 54 +++++++++++++++++ .../app/admin/notice/_libs/schemas.ts | 8 +++ .../frontend/app/admin/notice/create/page.tsx | 55 ++++++++++++++++++ .../admin/problem/[problemId]/edit/page.tsx | 2 +- .../app/admin/problem/create/page.tsx | 2 +- apps/frontend/graphql/notice/mutation.ts | 11 ++++ apps/frontend/graphql/notice/queries.ts | 12 ++++ 11 files changed, 244 insertions(+), 7 deletions(-) rename apps/frontend/app/admin/{problem => }/_components/VisibleForm.tsx (96%) create mode 100644 apps/frontend/app/admin/notice/[noticeId]/page.tsx create mode 100644 apps/frontend/app/admin/notice/_components/CreateNoticeForm.tsx create mode 100644 apps/frontend/app/admin/notice/_components/FixedForm.tsx create mode 100644 apps/frontend/app/admin/notice/_libs/schemas.ts create mode 100644 apps/frontend/app/admin/notice/create/page.tsx create mode 100644 apps/frontend/graphql/notice/mutation.ts create mode 100644 apps/frontend/graphql/notice/queries.ts diff --git a/apps/frontend/app/(client)/(main)/notice/[noticeId]/page.tsx b/apps/frontend/app/(client)/(main)/notice/[noticeId]/page.tsx index 09fd547a2c..a2f5aefa28 100644 --- a/apps/frontend/app/(client)/(main)/notice/[noticeId]/page.tsx +++ b/apps/frontend/app/(client)/(main)/notice/[noticeId]/page.tsx @@ -1,6 +1,6 @@ +import KatexContent from '@/components/KatexContent' import { baseUrl } from '@/libs/constants' import { dateFormatter } from '@/libs/utils' -import { sanitize } from 'isomorphic-dompurify' import Link from 'next/link' import { RxHamburgerMenu } from 'react-icons/rx' @@ -34,9 +34,9 @@ export default async function NoticeDetail({

{dateFormatter(createTime, 'YYYY-MM-DD')}

-