From 9b941fdd0dba79bdc3df8fa47c5bbf5ca12e8454 Mon Sep 17 00:00:00 2001 From: PrinOrange Date: Sat, 6 Jan 2024 21:34:34 +0800 Subject: [PATCH] make tagslist visible in postsindex page only. --- pages/posts/[[...slug]].tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pages/posts/[[...slug]].tsx b/pages/posts/[[...slug]].tsx index b9e9c5d..f7e553c 100644 --- a/pages/posts/[[...slug]].tsx +++ b/pages/posts/[[...slug]].tsx @@ -10,7 +10,7 @@ import { TagBadge } from "@/components/utils/TagBadge"; import { PostCountPerPagination } from "@/consts/consts"; import { Config } from "@/data/config"; import { sortedPosts } from "@/lib/post-process"; -import { paginateArray } from "@/lib/utils"; +import { isEmptyArray, paginateArray } from "@/lib/utils"; import { fontFangZhengXiaoBiaoSongCN, fontSourceSerifScreenCN } from "@/styles/font"; import { TPostListItem } from "@/types/post-list"; import { nanoid } from "nanoid"; @@ -60,12 +60,16 @@ export default function PostsPage(props: PostsPageProps) { {"ALL POSTS"} - -
- {props.tagList.map((item) => ( - - ))} -
+ {!isEmptyArray(props.tagList) && ( + <> + +
+ {props.tagList.map((item) => ( + + ))} +
+ + )}