From ef0c42fd212319fc9e9fa7b1d54ccce1845c9b14 Mon Sep 17 00:00:00 2001 From: Tekiter Date: Fri, 21 Jul 2023 01:23:17 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B8=94=EB=A1=9C=EA=B7=B8=20=EA=B8=80?= =?UTF-8?q?=20=EB=B3=B4=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/app/blog/article/[id]/page.tsx | 8 ++- .../web/src/components/blog/ArticleDetail.tsx | 65 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 apps/web/src/components/blog/ArticleDetail.tsx diff --git a/apps/web/src/app/blog/article/[id]/page.tsx b/apps/web/src/app/blog/article/[id]/page.tsx index b8350e5..e2635eb 100644 --- a/apps/web/src/app/blog/article/[id]/page.tsx +++ b/apps/web/src/app/blog/article/[id]/page.tsx @@ -1,5 +1,7 @@ import { FC } from 'react'; +import ArticlePage from '@/components/blog/ArticleDetail'; + interface BlogArticlePageProps { params: { id: string }; } @@ -7,7 +9,11 @@ interface BlogArticlePageProps { export const runtime = 'edge'; const BlogArticlePage: FC = ({ params }) => { - return <>{params.id}; + return ( + <> + + + ); }; export default BlogArticlePage; diff --git a/apps/web/src/components/blog/ArticleDetail.tsx b/apps/web/src/components/blog/ArticleDetail.tsx new file mode 100644 index 0000000..d65e864 --- /dev/null +++ b/apps/web/src/components/blog/ArticleDetail.tsx @@ -0,0 +1,65 @@ +import Link from 'next/link'; + +import { gateway } from '@/gateway'; + +import { BlockRenderer } from '../notion/renderer'; + +interface ArticlePageProps { + id: string; +} + +async function ArticlePage({ id }: ArticlePageProps) { + const article = await gateway.blog.article.query({ id }); + + return ( +
+
+ + + 블로그 홈 가기 + + {article.thumbnail && ( +
+ Thumbnail Image +
+ )} +
+ {article.category && ( + <> + + + {article.category} + + + + )} +
+

+ {article.title} +

+
+ {/* {article.publishedAt && format(article.publishedAt, 'yyyy.MM.dd')} */} + {article.publishedAt.toString()} +
+
+
Subpage not allowed
} /> +
+
+
+ ); +} + +export default ArticlePage; + +function BackIcon(props: React.SVGProps) { + return ( + + + + ); +}