diff --git a/stylesheets/components/ContactListItem.scss b/stylesheets/components/ContactListItem.scss index 87e1ae85005f..6f0aaf9b17b1 100644 --- a/stylesheets/components/ContactListItem.scss +++ b/stylesheets/components/ContactListItem.scss @@ -121,3 +121,9 @@ } } } + +.ContactListItem__contact-icon { + width: 14px; + height: 14px; + color: currentColor; +} diff --git a/stylesheets/components/ContactModal.scss b/stylesheets/components/ContactModal.scss index 9aec8074ff16..44ed2700f089 100644 --- a/stylesheets/components/ContactModal.scss +++ b/stylesheets/components/ContactModal.scss @@ -29,6 +29,14 @@ white-space: nowrap; } + &__name__contact-icon { + height: 22px; + width: 22px; + @include any-theme { + background-color: currentColor; + } + } + &__name__chevron { flex-shrink: 0; diff --git a/stylesheets/components/ConversationDetailsHeader.scss b/stylesheets/components/ConversationDetailsHeader.scss index 282c6ea85037..55beee476a7c 100644 --- a/stylesheets/components/ConversationDetailsHeader.scss +++ b/stylesheets/components/ConversationDetailsHeader.scss @@ -21,14 +21,17 @@ &__title { @include font-title-1; font-weight: 400; - align-items: baseline; - display: flex; - justify-content: center; padding-bottom: 8px; padding-top: 12px; user-select: text; } + &__title-contact-icon { + width: 22px; + height: 22px; + background-color: currentColor; + } + &__subtitle { @include font-body-1; color: $color-gray-60; diff --git a/ts/components/ConversationList.stories.tsx b/ts/components/ConversationList.stories.tsx index 2f131450bfe3..84ba517863d1 100644 --- a/ts/components/ConversationList.stories.tsx +++ b/ts/components/ConversationList.stories.tsx @@ -140,6 +140,20 @@ export function ContactDirect(): JSX.Element { ); } +export function ContactInSystemContacts(): JSX.Element { + const contact = defaultConversations[0]; + return ( + + ); +} + export function ContactDirectWithContextMenu(): JSX.Element { return ( )} - - {({ arrowProps, placement, ref, style }) => - showTooltip && ( - - {content} - {!hideArrow ? ( - - ) : null} - - ) - } - + {createPortal( + + {({ arrowProps, placement, ref, style }) => + showTooltip && ( + + {content} + {!hideArrow ? ( + + ) : null} + + ) + } + , + document.body + )} ); } diff --git a/ts/components/conversation/ContactModal.stories.tsx b/ts/components/conversation/ContactModal.stories.tsx index 4350efd4a384..437c4b77e6e8 100644 --- a/ts/components/conversation/ContactModal.stories.tsx +++ b/ts/components/conversation/ContactModal.stories.tsx @@ -119,3 +119,11 @@ WithUnreadStories.args = { hasStories: HasStories.Unread, }; WithUnreadStories.storyName = 'Unread Stories'; + +export const InSystemContacts = Template.bind({}); +InSystemContacts.args = { + contact: { + ...defaultContact, + systemGivenName: defaultContact.title, + }, +}; diff --git a/ts/components/conversation/ContactModal.tsx b/ts/components/conversation/ContactModal.tsx index 9d552cc886a2..e2943d25470d 100644 --- a/ts/components/conversation/ContactModal.tsx +++ b/ts/components/conversation/ContactModal.tsx @@ -23,6 +23,8 @@ import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirma import { missingCaseError } from '../../util/missingCaseError'; import { UserText } from '../UserText'; import { Button, ButtonIconType, ButtonVariant } from '../Button'; +import { isInSystemContacts } from '../../util/isInSystemContacts'; +import { InContactsIcon } from '../InContactsIcon'; export type PropsDataType = { areWeASubscriber: boolean; @@ -200,7 +202,6 @@ export function ContactModal({ switch (view) { case ContactModalView.Default: { const preferredBadge: undefined | BadgeType = badges[0]; - return ( + {isInSystemContacts(contact) && ( + + {' '} + + + )} diff --git a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx index d0d3f2bf4980..1968fba2669c 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx @@ -142,6 +142,22 @@ export function Basic(): JSX.Element { return ; } +export function SystemContact(): JSX.Element { + const props = createProps(); + const contact = getDefaultConversation(); + + return ( + + ); +} + export function AsAdmin(): JSX.Element { const props = createProps(); diff --git a/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx b/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx index 450e61dc6538..5e8c89ac3406 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx @@ -15,6 +15,8 @@ import { assertDev } from '../../../util/assert'; import { BadgeDialog } from '../../BadgeDialog'; import type { BadgeType } from '../../../badges/types'; import { UserText } from '../../UserText'; +import { isInSystemContacts } from '../../../util/isInSystemContacts'; +import { InContactsIcon } from '../../InContactsIcon'; export type Props = { areWeASubscriber: boolean; @@ -211,7 +213,15 @@ export function ConversationDetailsHeader({ > - + {isInSystemContacts(conversation) && ( + + {' '} + + + )} diff --git a/ts/components/conversationList/ContactListItem.tsx b/ts/components/conversationList/ContactListItem.tsx index 9702c83c43ac..17c96d73b999 100644 --- a/ts/components/conversationList/ContactListItem.tsx +++ b/ts/components/conversationList/ContactListItem.tsx @@ -17,6 +17,7 @@ import { Intl } from '../Intl'; import { ConfirmationDialog } from '../ConfirmationDialog'; import { isSignalConversation } from '../../util/isSignalConversation'; import { isInSystemContacts } from '../../util/isInSystemContacts'; +import { InContactsIcon } from '../InContactsIcon'; export type ContactListItemConversationType = Pick< ConversationType, @@ -281,7 +282,25 @@ export const ContactListItem: FunctionComponent = React.memo( /> } trailing={trailing} - title={headerName} + title={ + <> + {headerName} + {isInSystemContacts({ + type, + name, + systemGivenName, + systemFamilyName, + }) && ( + + {' '} + + + )} + > + } subtitle={messageText} subtitleMaxLines={1} onClick={onClick ? () => onClick(id) : undefined}