Reactions: Go directly to all tab, show 'You' for current user

This commit is contained in:
Ken Powers 2020-03-03 17:33:54 -05:00 committed by GitHub
parent 4d6dafccfb
commit faa2b13026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 25 deletions

View File

@ -805,7 +805,7 @@
},
"you": {
"message": "You",
"description": "In Android theme, shown in quote if you or someone else replies to you"
"description": "Shown when the user represented is the current user."
},
"replyingTo": {
"message": "Replying to $name$",

View File

@ -163,7 +163,6 @@ interface State {
isSelected?: boolean;
prevSelectedCounter?: number;
pickedReaction?: string;
reactionViewerRoot: HTMLDivElement | null;
reactionPickerRoot: HTMLDivElement | null;
@ -1426,10 +1425,7 @@ export class Message extends React.PureComponent<Props, State> {
);
}
public toggleReactionViewer = (
onlyRemove = false,
pickedReaction?: string
) => {
public toggleReactionViewer = (onlyRemove = false) => {
this.setState(({ reactionViewerRoot }) => {
if (reactionViewerRoot) {
document.body.removeChild(reactionViewerRoot);
@ -1439,7 +1435,7 @@ export class Message extends React.PureComponent<Props, State> {
true
);
return { reactionViewerRoot: null, pickedReaction };
return { reactionViewerRoot: null };
}
if (!onlyRemove) {
@ -1453,11 +1449,10 @@ export class Message extends React.PureComponent<Props, State> {
return {
reactionViewerRoot: root,
pickedReaction,
};
}
return { reactionViewerRoot: null, pickedReaction };
return { reactionViewerRoot: null };
});
};
@ -1550,7 +1545,7 @@ export class Message extends React.PureComponent<Props, State> {
someNotRendered &&
maybeNotRendered.some(res => res.some(re => Boolean(re.from.isMe)));
const { reactionViewerRoot, containerWidth, pickedReaction } = this.state;
const { reactionViewerRoot, containerWidth } = this.state;
// Calculate the width of the reactions container
const reactionsWidth = toRender.reduce((sum, res, i, arr) => {
@ -1611,10 +1606,7 @@ export class Message extends React.PureComponent<Props, State> {
onClick={e => {
e.stopPropagation();
e.preventDefault();
this.toggleReactionViewer(
false,
isMore ? 'all' : re.emoji
);
this.toggleReactionViewer(false);
}}
onKeyDown={e => {
// Prevent enter key from opening stickers/attachments
@ -1669,7 +1661,6 @@ export class Message extends React.PureComponent<Props, State> {
zIndex: 2,
}}
reactions={reactions}
pickedReaction={pickedReaction}
i18n={i18n}
onClose={this.toggleReactionViewer}
/>

View File

@ -158,12 +158,16 @@ export const ReactionViewer = React.forwardRef<HTMLDivElement, Props>(
/>
</div>
<div className="module-reaction-viewer__body__row__name">
<ContactName
module="module-reaction-viewer__body__row__name__contact-name"
name={from.name}
profileName={from.profileName}
phoneNumber={from.phoneNumber}
/>
{from.isMe ? (
i18n('you')
) : (
<ContactName
module="module-reaction-viewer__body__row__name__contact-name"
name={from.name}
profileName={from.profileName}
phoneNumber={from.phoneNumber}
/>
)}
</div>
<div className="module-reaction-viewer__body__row__emoji">
<Emoji size={18} emoji={emoji} />

View File

@ -11751,17 +11751,17 @@
"rule": "React-createRef",
"path": "ts/components/conversation/Message.tsx",
"line": " public audioRef: React.RefObject<HTMLAudioElement> = React.createRef();",
"lineNumber": 180,
"lineNumber": 179,
"reasonCategory": "usageTrusted",
"updated": "2020-02-07T22:17:41.885Z"
"updated": "2020-03-03T22:30:27.594Z"
},
{
"rule": "React-createRef",
"path": "ts/components/conversation/Message.tsx",
"line": " > = React.createRef();",
"lineNumber": 184,
"lineNumber": 183,
"reasonCategory": "usageTrusted",
"updated": "2020-02-07T22:17:41.885Z"
"updated": "2020-03-03T22:30:27.594Z"
},
{
"rule": "React-createRef",