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} ] - )}{' '} + )} ); };