fix post?.

This commit is contained in:
tangly1024.com
2023-07-11 18:28:16 +08:00
parent 47b3fa28e9
commit bb6b2b3e1d
10 changed files with 14 additions and 18 deletions

View File

@@ -87,10 +87,10 @@ export default function ArticleDetail(props) {
<ShareBar post={post} />
{/* 版权声明 */}
{post.type === 'Post' && <ArticleCopyright author={BLOG.AUTHOR} url={url} />}
{post?.type === 'Post' && <ArticleCopyright author={BLOG.AUTHOR} url={url} />}
{/* 推荐文章 */}
{post.type === 'Post' && <RecommendPosts currentPost={post} recommendPosts={recommendPosts} />}
{post?.type === 'Post' && <RecommendPosts currentPost={post} recommendPosts={recommendPosts} />}
<section className="flex justify-between">
{/* 分类 */}
@@ -104,7 +104,7 @@ export default function ArticleDetail(props) {
</>}
{/* 标签列表 */}
{post.type === 'Post' && (
{post?.type === 'Post' && (
<>
{post.tagItems && (
<div className="flex flex-nowrap leading-8 p-1 py-4 overflow-x-auto">
@@ -119,7 +119,7 @@ export default function ArticleDetail(props) {
</>
)}
</section>
{post.type === 'Post' && <BlogAround prev={prev} next={next} />}
{post?.type === 'Post' && <BlogAround prev={prev} next={next} />}
</>}
{/* 评论互动 */}