From 37c01fc1507537603fd0b07194d37979848f14db Mon Sep 17 00:00:00 2001 From: Travis Kohlbeck Date: Tue, 18 Feb 2020 17:15:47 -0500 Subject: [PATCH 1/5] prevents line breaks for author names, reblog-icon-reblogger --- src/components/Post/Post.styles.tsx | 3 +++ src/components/Post/Post.tsx | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Post/Post.styles.tsx b/src/components/Post/Post.styles.tsx index 1fa5377..cc38a3a 100644 --- a/src/components/Post/Post.styles.tsx +++ b/src/components/Post/Post.styles.tsx @@ -6,6 +6,9 @@ export const styles = (theme: Theme) => marginTop: theme.spacing.unit, marginBottom: theme.spacing.unit }, + postAuthorName: { + whiteSpace: 'nowrap', + }, postReblogChip: { color: theme.palette.common.white, "&:hover": { diff --git a/src/components/Post/Post.tsx b/src/components/Post/Post.tsx index ac49442..e8c2d73 100644 --- a/src/components/Post/Post.tsx +++ b/src/components/Post/Post.tsx @@ -410,11 +410,10 @@ export class Post extends React.Component { emojis.concat(reblogger.emojis); } - // console.log(post); - return ( <> { }} > {reblogger ? ( - <> +
{ ) }} > - +
) : null} ); From a168b614b295062898d6eb499e9b160154f46cb6 Mon Sep 17 00:00:00 2001 From: Travis Kohlbeck Date: Tue, 18 Feb 2020 17:23:42 -0500 Subject: [PATCH 2/5] hides account name with ellipsis instead of line break, fixes colors --- src/components/Post/Post.styles.tsx | 18 ++++++++++++++---- src/components/Post/Post.tsx | 6 +++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/Post/Post.styles.tsx b/src/components/Post/Post.styles.tsx index cc38a3a..cf0c1b1 100644 --- a/src/components/Post/Post.styles.tsx +++ b/src/components/Post/Post.styles.tsx @@ -6,8 +6,21 @@ export const styles = (theme: Theme) => marginTop: theme.spacing.unit, marginBottom: theme.spacing.unit }, + postHeaderContent: { + overflow: 'hidden', + whiteSpace: 'nowrap', + }, + postHeaderTitle: { + overflow: 'hidden', + textOverflow: 'ellipsis', + color: theme.palette.text.secondary, + }, postAuthorName: { whiteSpace: 'nowrap', + color: theme.palette.text.primary, + }, + postAuthorAccount: { + marginLeft: theme.spacing.unit * 0.5, }, postReblogChip: { color: theme.palette.common.white, @@ -84,14 +97,11 @@ 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, + color: theme.palette.text.primary, }, postAuthorEmoji: { height: theme.typography.fontSize, diff --git a/src/components/Post/Post.tsx b/src/components/Post/Post.tsx index e8c2d73..0574d3f 100644 --- a/src/components/Post/Post.tsx +++ b/src/components/Post/Post.tsx @@ -647,6 +647,10 @@ export class Post extends React.Component { elevation={this.props.threadHeader ? 0 : 1} > { } title={ - {this.getReblogAuthors(post)} + this.getReblogAuthors(post) } subheader={moment(post.created_at).format( "MMMM Do YYYY [at] h:mm A" From 78d7b02085869bc4e37030b7bf462ff197ed14ef Mon Sep 17 00:00:00 2001 From: Travis Kohlbeck Date: Tue, 18 Feb 2020 17:34:20 -0500 Subject: [PATCH 3/5] prettifies files, I need to format on save... --- src/components/Post/Post.styles.tsx | 18 +++++++++--------- src/components/Post/Post.tsx | 6 ++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/components/Post/Post.styles.tsx b/src/components/Post/Post.styles.tsx index cf0c1b1..5d32b88 100644 --- a/src/components/Post/Post.styles.tsx +++ b/src/components/Post/Post.styles.tsx @@ -7,20 +7,20 @@ export const styles = (theme: Theme) => marginBottom: theme.spacing.unit }, postHeaderContent: { - overflow: 'hidden', - whiteSpace: 'nowrap', + overflow: "hidden", + whiteSpace: "nowrap" }, postHeaderTitle: { - overflow: 'hidden', - textOverflow: 'ellipsis', - color: theme.palette.text.secondary, + overflow: "hidden", + textOverflow: "ellipsis", + color: theme.palette.text.secondary }, postAuthorName: { - whiteSpace: 'nowrap', - color: theme.palette.text.primary, + whiteSpace: "nowrap", + color: theme.palette.text.primary }, postAuthorAccount: { - marginLeft: theme.spacing.unit * 0.5, + marginLeft: theme.spacing.unit * 0.5 }, postReblogChip: { color: theme.palette.common.white, @@ -101,7 +101,7 @@ export const styles = (theme: Theme) => marginBottom: theme.spacing.unit * -0.5, marginLeft: theme.spacing.unit * 0.5, marginRight: theme.spacing.unit * 0.5, - color: theme.palette.text.primary, + color: theme.palette.text.primary }, postAuthorEmoji: { height: theme.typography.fontSize, diff --git a/src/components/Post/Post.tsx b/src/components/Post/Post.tsx index 0574d3f..3f657ab 100644 --- a/src/components/Post/Post.tsx +++ b/src/components/Post/Post.tsx @@ -649,7 +649,7 @@ export class Post extends React.Component { { } - title={ - this.getReblogAuthors(post) - } + title={this.getReblogAuthors(post)} subheader={moment(post.created_at).format( "MMMM Do YYYY [at] h:mm A" )} From f908e8656a6a1a3582ac1afe8f13a40799d5c496 Mon Sep 17 00:00:00 2001 From: Travis Kohlbeck Date: Wed, 19 Feb 2020 09:10:09 -0500 Subject: [PATCH 4/5] keeps reblogger on same line as author when there is enough room --- src/components/Post/Post.styles.tsx | 10 ++++++-- src/components/Post/Post.tsx | 40 +++++++++++++++-------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/components/Post/Post.styles.tsx b/src/components/Post/Post.styles.tsx index 5d32b88..309a7d1 100644 --- a/src/components/Post/Post.styles.tsx +++ b/src/components/Post/Post.styles.tsx @@ -11,15 +11,21 @@ export const styles = (theme: Theme) => whiteSpace: "nowrap" }, postHeaderTitle: { - overflow: "hidden", - textOverflow: "ellipsis", + display: 'flex', + flexWrap: 'wrap', color: theme.palette.text.secondary }, + postAuthorNameAndAccount: { + overflow: 'hidden', + textOverflow: 'ellipsis', + }, postAuthorName: { whiteSpace: "nowrap", color: theme.palette.text.primary }, postAuthorAccount: { + overflow: 'hidden', + textOverflow: 'ellipsis', marginLeft: theme.spacing.unit * 0.5 }, postReblogChip: { diff --git a/src/components/Post/Post.tsx b/src/components/Post/Post.tsx index 3f657ab..56cae52 100644 --- a/src/components/Post/Post.tsx +++ b/src/components/Post/Post.tsx @@ -412,28 +412,30 @@ export class Post extends React.Component { return ( <> - - + + }} + > + + {reblogger ? (
Date: Wed, 19 Feb 2020 09:11:19 -0500 Subject: [PATCH 5/5] prettifies post styles --- src/components/Post/Post.styles.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Post/Post.styles.tsx b/src/components/Post/Post.styles.tsx index 309a7d1..328c15e 100644 --- a/src/components/Post/Post.styles.tsx +++ b/src/components/Post/Post.styles.tsx @@ -11,21 +11,21 @@ export const styles = (theme: Theme) => whiteSpace: "nowrap" }, postHeaderTitle: { - display: 'flex', - flexWrap: 'wrap', + display: "flex", + flexWrap: "wrap", color: theme.palette.text.secondary }, postAuthorNameAndAccount: { - overflow: 'hidden', - textOverflow: 'ellipsis', + overflow: "hidden", + textOverflow: "ellipsis" }, postAuthorName: { whiteSpace: "nowrap", color: theme.palette.text.primary }, postAuthorAccount: { - overflow: 'hidden', - textOverflow: 'ellipsis', + overflow: "hidden", + textOverflow: "ellipsis", marginLeft: theme.spacing.unit * 0.5 }, postReblogChip: {