From 96fd07e4bcaaf79d65c59a7bcf13b5aa4079a4cc Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Mon, 18 Dec 2023 11:40:30 +0100 Subject: [PATCH] fix(post): displayName should link to user, using full address --- src/components/post/post.tsx | 8 +++++--- src/components/reply/reply.tsx | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index 598b9e0f..f82540e6 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -18,6 +18,7 @@ import useStateString from '../../hooks/use-state-string'; import useUpvote from '../../hooks/use-upvote'; interface PostAuthorProps { + authorAddress: string; authorRole: string; cid: string; displayName: string; @@ -26,7 +27,7 @@ interface PostAuthorProps { authorAddressChanged: boolean; } -const PostAuthor = ({ authorRole, cid, displayName, shortAddress, shortAuthorAddress, authorAddressChanged }: PostAuthorProps) => { +const PostAuthor = ({ authorAddress, authorRole, cid, displayName, shortAddress, shortAuthorAddress, authorAddressChanged }: PostAuthorProps) => { const isAuthorOwner = authorRole === 'owner'; const isAuthorAdmin = authorRole === 'admin'; const isAuthorModerator = authorRole === 'moderator'; @@ -35,8 +36,8 @@ const PostAuthor = ({ authorRole, cid, displayName, shortAddress, shortAuthorAdd return ( <> - {displayName && {displayName} } - + {displayName && {displayName} } + u/{shortAddress || shortAuthorAddress} u/{shortAuthorAddress} @@ -166,6 +167,7 @@ const Post = ({ post = {}, index }: PostProps) => {

{t('post_submitted')} {getFormattedTimeAgo(timestamp)} {t('post_by')}{' '} - {displayName && {displayName} } + {displayName && {displayName} } {displayName ? `u/${shortAuthorAddress}` : shortAuthorAddress} {authorRole && ( - [ + {' '}[ {authorRoleInitial} ] - )}{' '} + )} ); };