From e63d74d4147e66ec79c287b7c3fda0dadc139275 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 16 Jan 2022 14:15:27 +0100 Subject: chore(meta): add a link to comments on single post pages --- src/components/PostMeta/PostMeta.tsx | 9 ++++++++- src/pages/article/[slug].tsx | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/components/PostMeta/PostMeta.tsx b/src/components/PostMeta/PostMeta.tsx index ece355a..0b68d70 100644 --- a/src/components/PostMeta/PostMeta.tsx +++ b/src/components/PostMeta/PostMeta.tsx @@ -16,6 +16,7 @@ const PostMeta = ({ const { author, commentCount, dates, subjects, thematics, website } = meta; const { asPath, locale } = useRouter(); const isThematic = () => asPath.includes('/thematique/'); + const isArticle = () => asPath.includes('/article/'); const dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', @@ -120,7 +121,13 @@ const PostMeta = ({ {commentCount !== undefined && (
{t`Comments`}
- {getCommentsCount()} +
+ {isArticle() ? ( + {getCommentsCount()} + ) : ( + getCommentsCount() + )} +
)} diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index 477503e..e519c27 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -71,7 +71,7 @@ const SingleArticle: NextPageWithLayout = ({ post }) => { -
+
-- cgit v1.2.3