Skip to content

Commit 40f25e9

Browse files
committed
feat: hide prev/next navigation on about page
1 parent 84832b7 commit 40f25e9

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

web/src/pages/ArticleDetail.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export default function ArticleDetail() {
4646

4747
const siteName = settings?.kv?.site_name || "無處告別";
4848
const pageTitle = `${article?.title ? article?.title + " - " : ""}${siteName}`;
49+
const isAboutPage = article?.url === "about";
4950

5051
// Show skeleton during initial load
5152
if (!article?.id) {
@@ -60,24 +61,26 @@ export default function ArticleDetail() {
6061
<PageTransition loading={loading}>
6162
<div className="mb-[10px]">
6263
<CArticle article={article} />
63-
<div className="my-5 flex justify-between">
64-
<div className="w-[400px] overflow-hidden text-ellipsis whitespace-nowrap">
65-
<strong>上一篇:</strong>
66-
{data.prev?.id ? (
67-
<Link to={articleLink(data.prev)}>{data.prev.title}</Link>
68-
) : (
69-
<span>嘿,这已经是最新的文章啦</span>
70-
)}
64+
{!isAboutPage && (
65+
<div className="my-5 flex justify-between">
66+
<div className="w-[400px] overflow-hidden text-ellipsis whitespace-nowrap">
67+
<strong>上一篇:</strong>
68+
{data.prev?.id ? (
69+
<Link to={articleLink(data.prev)}>{data.prev.title}</Link>
70+
) : (
71+
<span>嘿,这已经是最新的文章啦</span>
72+
)}
73+
</div>
74+
<div className="w-[400px] overflow-hidden text-ellipsis whitespace-nowrap text-right">
75+
<strong>下一篇:</strong>
76+
{data.next?.id ? (
77+
<Link to={articleLink(data.next)}>{data.next.title}</Link>
78+
) : (
79+
<span>嘿,这已经是最后的文章啦</span>
80+
)}
81+
</div>
7182
</div>
72-
<div className="w-[400px] overflow-hidden text-ellipsis whitespace-nowrap text-right">
73-
<strong>下一篇:</strong>
74-
{data.next?.id ? (
75-
<Link to={articleLink(data.next)}>{data.next.title}</Link>
76-
) : (
77-
<span>嘿,这已经是最后的文章啦</span>
78-
)}
79-
</div>
80-
</div>
83+
)}
8184
</div>
8285
<Comment />
8386
</PageTransition>

0 commit comments

Comments
 (0)