Show 'You' in Android theme quotes instead of contact name

This commit is contained in:
Scott Nonnenberg 2018-04-30 12:28:14 -07:00
parent 45bf1d5bfc
commit c5935eef5d
2 changed files with 29 additions and 8 deletions

View file

@ -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",

View file

@ -176,10 +176,32 @@ export class Quote extends React.Component<Props, {}> {
);
}
public renderAuthor() {
const {
authorColor,
authorProfileName,
authorTitle,
i18n,
isFromMe,
} = this.props;
const authorProfileElement = authorProfileName
? <span className="profile-name">~{authorProfileName}</span>
: null;
return (
<div className={classnames(authorColor, 'author')}>
{ isFromMe
? i18n('you')
: <span>{authorTitle}{' '}{authorProfileElement}</span>
}
</div>
);
}
public render() {
const {
authorTitle,
authorProfileName,
authorColor,
onClick,
isFromMe,
@ -189,9 +211,6 @@ export class Quote extends React.Component<Props, {}> {
return null;
}
const authorProfileElement = authorProfileName
? <span className="profile-name">~{authorProfileName}</span>
: null;
const classes = classnames(
authorColor,
'quoted-message',
@ -203,9 +222,7 @@ export class Quote extends React.Component<Props, {}> {
<div onClick={onClick} className={classes}>
<div className="primary">
{this.renderIOSLabel()}
<div className={classnames(authorColor, 'author')}>
{authorTitle}{' '}{authorProfileElement}
</div>
{this.renderAuthor()}
{this.renderText()}
</div>
{this.renderIconContainer()}