From fc8afb9000b34a8d6a987bd5c9076dfa00e3bf6c Mon Sep 17 00:00:00 2001 From: Travis Kohlbeck Date: Wed, 18 Dec 2019 13:03:16 -0500 Subject: [PATCH] updates appearance of post/retoot authors --- src/components/Post/Post.styles.tsx | 9 ++++++ src/components/Post/Post.tsx | 43 +++++++++++++++++------------ 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/components/Post/Post.styles.tsx b/src/components/Post/Post.styles.tsx index 362d55a..1fa5377 100644 --- a/src/components/Post/Post.styles.tsx +++ b/src/components/Post/Post.styles.tsx @@ -81,6 +81,15 @@ export const styles = (theme: Theme) => paddingTop: theme.spacing.unit, paddingBottom: theme.spacing.unit }, + postAuthorAccount: { + color: theme.palette.grey[500], + marginLeft: theme.spacing.unit * 0.5, + }, + postReblogIcon: { + marginBottom: theme.spacing.unit * -0.5, + marginLeft: theme.spacing.unit * 0.5, + marginRight: theme.spacing.unit * 0.5, + }, postAuthorEmoji: { height: theme.typography.fontSize, verticalAlign: "middle" diff --git a/src/components/Post/Post.tsx b/src/components/Post/Post.tsx index a6d2621..cc8fc5b 100644 --- a/src/components/Post/Post.tsx +++ b/src/components/Post/Post.tsx @@ -398,21 +398,34 @@ export class Post extends React.Component { const { classes } = this.props; if (post.reblog) { let author = post.reblog.account; - let origString = `${author.display_name || - author.username} (@${author.acct}) 🔄 ${post.account - .display_name || post.account.username}`; let emojis = author.emojis; emojis.concat(post.account.emojis); - return emojifyString(origString, emojis, classes.postAuthorEmoji); + return ( + <> + + {emojifyString(author.display_name || author.username, author.emojis, classes.postAuthorEmoji)} + + + @{emojifyString(author.acct, author.emojis, classes.postAuthorEmoji)} + + + + {emojifyString(post.account.display_name || post.account.username, emojis, classes.postAuthorEmoji)} + + + ) } else { let author = post.account; - let origString = `${author.display_name || - author.username} (@${author.acct})`; - return emojifyString( - origString, - author.emojis, - classes.postAuthorEmoji - ); + return ( + <> + + {emojifyString(author.display_name || author.username, author.emojis, classes.postAuthorEmoji)} + + + @{emojifyString(author.acct, author.emojis, classes.postAuthorEmoji)} + + + ) } } @@ -656,13 +669,7 @@ export class Post extends React.Component { } - title={ - - } + title={{this.getReblogAuthors(post)}} subheader={moment(post.created_at).format( "MMMM Do YYYY [at] h:mm A" )}