Show badges in reaction viewer

This commit is contained in:
Evan Hahn 2021-11-17 15:11:46 -06:00 committed by GitHub
parent 2cbcd59609
commit c63bf11a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 44 additions and 53 deletions

View file

@ -63,7 +63,6 @@ import type {
} from '../ducks/conversations';
import type { AccountSelectorType } from './accounts';
import type { PreferredBadgeSelectorType } from './badges';
import type { CallSelectorType, CallStateType } from './calling';
import type {
GetConversationByIdType,
@ -82,7 +81,6 @@ import {
someSendStatus,
} from '../../messages/MessageSendState';
import * as log from '../../logging/log';
import type { BadgeType } from '../../badges/types';
const THREE_HOURS = 3 * 60 * 60 * 1000;
@ -108,7 +106,6 @@ export type GetPropsForBubbleOptions = Readonly<{
ourConversationId: string;
ourNumber?: string;
ourUuid: UUIDStringType;
preferredBadgeSelector: PreferredBadgeSelectorType;
selectedMessageId?: string;
selectedMessageCounter?: number;
regionCode: string;
@ -350,19 +347,6 @@ const getCachedAuthorForMessage = createSelectorCreator(memoizeByRoot, isEqual)(
(_, author): PropsData['author'] => author
);
const getAuthorBadgeForMessage: (
message: MessageWithUIFieldsType,
options: {
preferredBadgeSelector: PreferredBadgeSelectorType;
}
) => undefined | BadgeType = createSelectorCreator(memoizeByRoot, isEqual)(
// `memoizeByRoot` requirement
identity,
(_, { preferredBadgeSelector }) => preferredBadgeSelector,
getAuthorForMessage,
(_, preferredBadgeSelector, author) => preferredBadgeSelector(author.badges)
);
export const getPreviewsForMessage = createSelectorCreator(memoizeByRoot)(
// `memoizeByRoot` requirement
identity,
@ -412,6 +396,7 @@ export const getReactionsForMessage = createSelectorCreator(
const unsafe = pick(c, [
'acceptedMessageRequest',
'avatarPath',
'badges',
'color',
'id',
'isMe',
@ -514,7 +499,6 @@ export type GetPropsForMessageOptions = Pick<
| 'ourConversationId'
| 'ourUuid'
| 'ourNumber'
| 'preferredBadgeSelector'
| 'selectedMessageId'
| 'selectedMessageCounter'
| 'regionCode'
@ -656,7 +640,6 @@ export const getPropsForMessage: (
getAttachmentsForMessage,
processBodyRanges,
getCachedAuthorForMessage,
getAuthorBadgeForMessage,
getPreviewsForMessage,
getReactionsForMessage,
getPropsForQuote,
@ -666,7 +649,6 @@ export const getPropsForMessage: (
attachments: Array<AttachmentType>,
bodyRanges: BodyRangesType | undefined,
author: PropsData['author'],
authorBadge: undefined | BadgeType,
previews: Array<LinkPreviewType>,
reactions: PropsData['reactions'],
quote: PropsData['quote'],
@ -675,7 +657,6 @@ export const getPropsForMessage: (
return {
attachments,
author,
authorBadge,
bodyRanges,
previews,
quote,