Skip to content

Commit 4a23f2a

Browse files
committed
fix: show display_name in post head
1 parent 0b111ce commit 4a23f2a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/post/PostHead.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export interface PostHeadProps {
127127
title: string;
128128
tags: string[];
129129
username: string;
130+
displayName?: string;
130131
date: string;
131132
thumbnail: string | null;
132133
hideThumbnail: boolean;
@@ -151,6 +152,7 @@ export interface PostHeadProps {
151152
const PostHead: React.FC<PostHeadProps> = ({
152153
title,
153154
username,
155+
displayName,
154156
date,
155157
tags,
156158
hideThumbnail,
@@ -187,7 +189,9 @@ const PostHead: React.FC<PostHeadProps> = ({
187189
<SubInfo>
188190
<div className="information">
189191
<span className="username">
190-
<VLink to={`/@${username}/posts`}>{username}</VLink>
192+
<VLink to={`/@${username}/posts`}>
193+
{displayName || username}
194+
</VLink>
191195
</span>
192196
<span className="separator">&middot;</span>
193197
<span>{formatDate(date)}</span>

src/containers/post/PostViewer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ const PostViewer: React.FC<PostViewerProps> = ({
415415
title={post.title}
416416
tags={post.tags}
417417
username={username}
418+
displayName={post.user.profile.display_name}
418419
date={post.released_at}
419420
thumbnail={
420421
post.thumbnail &&

0 commit comments

Comments
 (0)