From d2342a05b5af112177a933346d187345a59d1b9c Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Thu, 11 Nov 2021 09:38:18 -0800 Subject: [PATCH] Show user badges in contact modal Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> --- ts/components/conversation/ContactModal.stories.tsx | 2 ++ ts/components/conversation/ContactModal.tsx | 5 ++++- ts/state/smart/ContactModal.tsx | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ts/components/conversation/ContactModal.stories.tsx b/ts/components/conversation/ContactModal.stories.tsx index a48deeeeaef..bb7f6461404 100644 --- a/ts/components/conversation/ContactModal.stories.tsx +++ b/ts/components/conversation/ContactModal.stories.tsx @@ -14,6 +14,7 @@ import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import type { ConversationType } from '../../state/ducks/conversations'; import { getFakeBadges } from '../../test-both/helpers/getFakeBadge'; +import { ThemeType } from '../../types/Util'; const i18n = setupI18n('en', enMessages); @@ -37,6 +38,7 @@ const createProps = (overrideProps: Partial = {}): PropsType => ({ isMember: boolean('isMember', overrideProps.isMember || true), openConversationInternal: action('openConversationInternal'), removeMemberFromGroup: action('removeMemberFromGroup'), + theme: ThemeType.light, toggleSafetyNumberModal: action('toggleSafetyNumberModal'), toggleAdmin: action('toggleAdmin'), updateConversationModelSharedGroups: action( diff --git a/ts/components/conversation/ContactModal.tsx b/ts/components/conversation/ContactModal.tsx index 29f746b35a8..db6eca697a7 100644 --- a/ts/components/conversation/ContactModal.tsx +++ b/ts/components/conversation/ContactModal.tsx @@ -9,7 +9,7 @@ import { Avatar } from '../Avatar'; import { AvatarLightbox } from '../AvatarLightbox'; import type { ConversationType } from '../../state/ducks/conversations'; import { Modal } from '../Modal'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType, ThemeType } from '../../types/Util'; import { BadgeDialog } from '../BadgeDialog'; import type { BadgeType } from '../../badges/types'; import { SharedGroupNames } from '../SharedGroupNames'; @@ -24,6 +24,7 @@ export type PropsDataType = { readonly i18n: LocalizerType; isAdmin: boolean; isMember: boolean; + theme: ThemeType; }; type PropsActionType = { @@ -60,6 +61,7 @@ export const ContactModal = ({ isMember, openConversationInternal, removeMemberFromGroup, + theme, toggleAdmin, toggleSafetyNumberModal, updateConversationModelSharedGroups, @@ -102,6 +104,7 @@ export const ContactModal = ({ profileName={contact.profileName} sharedGroupNames={contact.sharedGroupNames} size={96} + theme={theme} title={contact.title} unblurredAvatarPath={contact.unblurredAvatarPath} onClick={() => { diff --git a/ts/state/smart/ContactModal.tsx b/ts/state/smart/ContactModal.tsx index 23f9bce960e..4f76f31bc03 100644 --- a/ts/state/smart/ContactModal.tsx +++ b/ts/state/smart/ContactModal.tsx @@ -7,7 +7,7 @@ import type { PropsDataType } from '../../components/conversation/ContactModal'; import { ContactModal } from '../../components/conversation/ContactModal'; import type { StateType } from '../reducer'; -import { getIntl } from '../selectors/user'; +import { getIntl, getTheme } from '../selectors/user'; import { getBadgesSelector } from '../selectors/badges'; import { getConversationSelector } from '../selectors/conversations'; @@ -42,6 +42,7 @@ const mapStateToProps = (state: StateType): PropsDataType => { i18n: getIntl(state), isAdmin, isMember, + theme: getTheme(state), }; };