From c5935eef5d88aa98083cfb58af3fc8b0c2a46317 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Mon, 30 Apr 2018 12:28:14 -0700 Subject: [PATCH] Show 'You' in Android theme quotes instead of contact name --- _locales/en/messages.json | 4 ++++ ts/components/conversation/Quote.tsx | 33 +++++++++++++++++++++------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 7bbe41990..08fd3eb40 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -468,6 +468,10 @@ "message": "Replying to You", "description": "Shown in iOS theme when someone else quotes a message from you" }, + "you": { + "message": "You", + "description": "In Android theme, shown in quote if you or someone else replies to you" + }, "replyingTo": { "message": "Replying to $name$", "description": "Shown in iOS theme when you or someone quotes to a message which is not from you", diff --git a/ts/components/conversation/Quote.tsx b/ts/components/conversation/Quote.tsx index d71f6f36d..54365c4f5 100644 --- a/ts/components/conversation/Quote.tsx +++ b/ts/components/conversation/Quote.tsx @@ -176,10 +176,32 @@ export class Quote extends React.Component { ); } + public renderAuthor() { + const { + authorColor, + authorProfileName, + authorTitle, + i18n, + isFromMe, + } = this.props; + + + const authorProfileElement = authorProfileName + ? ~{authorProfileName} + : null; + + return ( +
+ { isFromMe + ? i18n('you') + : {authorTitle}{' '}{authorProfileElement} + } +
+ ); + } + public render() { const { - authorTitle, - authorProfileName, authorColor, onClick, isFromMe, @@ -189,9 +211,6 @@ export class Quote extends React.Component { return null; } - const authorProfileElement = authorProfileName - ? ~{authorProfileName} - : null; const classes = classnames( authorColor, 'quoted-message', @@ -203,9 +222,7 @@ export class Quote extends React.Component {
{this.renderIOSLabel()} -
- {authorTitle}{' '}{authorProfileElement} -
+ {this.renderAuthor()} {this.renderText()}
{this.renderIconContainer()}