Remove "you" qualifier from ReactionViewer and ContactName

This commit is contained in:
Ken Powers 2020-02-05 17:28:54 -05:00 committed by GitHub
parent b714a6817b
commit c6a23ff4f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 29 deletions

View File

@ -2190,15 +2190,5 @@
"Reactions--error": {
"message": "Failed to send reaction. Please try again.",
"description": "Shown when a reaction fails to send"
},
"ContactName--you": {
"message": "$name$ (you)",
"descriptions": "Indicates that a name represents the current user",
"placeholders": {
"name": {
"content": "$1",
"example": "Captain Jack Sparrow"
}
}
}
}

View File

@ -1,21 +1,17 @@
import React from 'react';
import { Emojify } from './Emojify';
import { Intl } from '../Intl';
import { LocalizerType } from '../../types/Util';
interface Props {
phoneNumber?: string;
name?: string;
profileName?: string;
module?: string;
isMe?: boolean;
i18n?: LocalizerType;
}
export class ContactName extends React.Component<Props> {
public render() {
const { phoneNumber, name, profileName, module, isMe, i18n } = this.props;
const { phoneNumber, name, profileName, module } = this.props;
const prefix = module ? module : 'module-contact-name';
const title = name ? name : phoneNumber;
@ -26,21 +22,11 @@ export class ContactName extends React.Component<Props> {
</span>
) : null;
const fragment = (
<>
return (
<span className={prefix} dir="auto">
<Emojify text={title} />
{shouldShowProfile ? ' ' : null}
{profileElement}
</>
);
return (
<span className={prefix} dir="auto">
{isMe ? (
<Intl i18n={i18n} id="ContactName--you" components={[fragment]} />
) : (
fragment
)}
</span>
);
}

View File

@ -143,11 +143,9 @@ export const ReactionViewer = React.forwardRef<HTMLDivElement, Props>(
</div>
<ContactName
module="module-reaction-viewer__body__row__name"
i18n={i18n}
name={from.name}
profileName={from.profileName}
phoneNumber={from.phoneNumber}
isMe={from.isMe}
/>
</div>
))}