From faa2b130264ebec21fbaa92939e00a04d5046634 Mon Sep 17 00:00:00 2001 From: Ken Powers Date: Tue, 3 Mar 2020 17:33:54 -0500 Subject: [PATCH] Reactions: Go directly to all tab, show 'You' for current user --- _locales/en/messages.json | 2 +- ts/components/conversation/Message.tsx | 19 +++++-------------- ts/components/conversation/ReactionViewer.tsx | 16 ++++++++++------ ts/util/lint/exceptions.json | 8 ++++---- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1bf651a4c0..1a3cc802e7 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -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$", diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index a7ff41577d..1ae954ca10 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -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 { ); } - 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 { true ); - return { reactionViewerRoot: null, pickedReaction }; + return { reactionViewerRoot: null }; } if (!onlyRemove) { @@ -1453,11 +1449,10 @@ export class Message extends React.PureComponent { return { reactionViewerRoot: root, - pickedReaction, }; } - return { reactionViewerRoot: null, pickedReaction }; + return { reactionViewerRoot: null }; }); }; @@ -1550,7 +1545,7 @@ export class Message extends React.PureComponent { 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 { 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 { zIndex: 2, }} reactions={reactions} - pickedReaction={pickedReaction} i18n={i18n} onClose={this.toggleReactionViewer} /> diff --git a/ts/components/conversation/ReactionViewer.tsx b/ts/components/conversation/ReactionViewer.tsx index 52c61b01b3..220b146dbb 100644 --- a/ts/components/conversation/ReactionViewer.tsx +++ b/ts/components/conversation/ReactionViewer.tsx @@ -158,12 +158,16 @@ export const ReactionViewer = React.forwardRef( />
- + {from.isMe ? ( + i18n('you') + ) : ( + + )}
diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index 55b55150c5..d28474ebc4 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -11751,17 +11751,17 @@ "rule": "React-createRef", "path": "ts/components/conversation/Message.tsx", "line": " public audioRef: React.RefObject = 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",