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", "message": "Replying to You",
"description": "Shown in iOS theme when someone else quotes a message from 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": { "replyingTo": {
"message": "Replying to $name$", "message": "Replying to $name$",
"description": "Shown in iOS theme when you or someone quotes to a message which is not from you", "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() { public render() {
const { const {
authorTitle,
authorProfileName,
authorColor, authorColor,
onClick, onClick,
isFromMe, isFromMe,
@ -189,9 +211,6 @@ export class Quote extends React.Component<Props, {}> {
return null; return null;
} }
const authorProfileElement = authorProfileName
? <span className="profile-name">~{authorProfileName}</span>
: null;
const classes = classnames( const classes = classnames(
authorColor, authorColor,
'quoted-message', 'quoted-message',
@ -203,9 +222,7 @@ export class Quote extends React.Component<Props, {}> {
<div onClick={onClick} className={classes}> <div onClick={onClick} className={classes}>
<div className="primary"> <div className="primary">
{this.renderIOSLabel()} {this.renderIOSLabel()}
<div className={classnames(authorColor, 'author')}> {this.renderAuthor()}
{authorTitle}{' '}{authorProfileElement}
</div>
{this.renderText()} {this.renderText()}
</div> </div>
{this.renderIconContainer()} {this.renderIconContainer()}