Skip to content

Commit d8ba333

Browse files
committed
fix: post related
Signed-off-by: Innei <[email protected]>
1 parent fe234f4 commit d8ba333

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/app/(app)/posts/(post-detail)/[category]/[slug]/pageImpl.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const PostPage = (props: PostModel) => {
4848
<SummarySwitcher data={props} />
4949
<PostOutdate />
5050

51-
<PostRelated />
51+
<PostRelated infoText="阅读此文章之前,你可能需要首先阅读以下的文章才能更好的理解上下文。" />
5252
</header>
5353
<WrappedElementProvider eoaDetect>
5454
<ReadIndicatorForMobile />
@@ -67,6 +67,7 @@ const PostPage = (props: PostModel) => {
6767
</WrappedElementProvider>
6868
</article>
6969
<ClientOnly>
70+
<PostRelated infoText="关联阅读" />
7071
<PostCopyright />
7172
{/* <SubscribeBell defaultType="post_c" /> */}
7273
<XLogInfoForPost />

src/components/modules/post/PostRelated.tsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
'use client'
22

3+
import type { FC } from 'react'
4+
35
import { useCurrentPostDataSelector } from '~/providers/post/CurrentPostDataProvider'
46

57
import { PeekLink } from '../peek/PeekLink'
68

7-
export const PostRelated = () => {
9+
export const PostRelated: FC<{
10+
infoText: string
11+
}> = ({ infoText }) => {
812
const related = useCurrentPostDataSelector((s) => s?.related)
913
if (!related) {
1014
return null
@@ -16,9 +20,7 @@ export const PostRelated = () => {
1620
return (
1721
<div data-hide-print className="mb-5 mt-8">
1822
<h3 className="text-lg font-medium">
19-
<span>
20-
阅读此文章之前,你可能需要首先阅读以下的文章才能更好的理解上下文。
21-
</span>
23+
<span>{infoText}</span>
2224
</h3>
2325
<ul className="list-inside list-disc">
2426
{related.map((post) => {

0 commit comments

Comments
 (0)