diff --git a/src/components/middle/message/Contact.module.scss b/src/components/middle/message/Contact.module.scss index e3c67136a..420ad9979 100644 --- a/src/components/middle/message/Contact.module.scss +++ b/src/components/middle/message/Contact.module.scss @@ -33,18 +33,17 @@ .name { font-size: 1rem; - margin-bottom: 0.25rem; font-weight: 500; max-width: 12.5rem; } .phone { color: var(--color-text); + line-height: 1rem; } .name, .phone { - line-height: 1rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/src/components/middle/message/Contact.tsx b/src/components/middle/message/Contact.tsx index cdd617af4..d8fe5a46a 100644 --- a/src/components/middle/message/Contact.tsx +++ b/src/components/middle/message/Contact.tsx @@ -20,6 +20,7 @@ import styles from './Contact.module.scss'; type OwnProps = { contact: ApiContact; + noUserColors?: boolean; }; type StateProps = { @@ -30,17 +31,14 @@ type StateProps = { const UNREGISTERED_CONTACT_ID = '0'; const Contact: FC = ({ - contact, user, phoneCodeList, + contact, user, phoneCodeList, noUserColors, }) => { const lang = useLang(); const { openChat, openAddContactDialog, showNotification, openChatWithInfo, } = getActions(); - const { - phoneNumber, - userId, - } = contact; + const { phoneNumber, userId } = contact; const isRegistered = userId !== UNREGISTERED_CONTACT_ID; const canAddContact = isRegistered && user && getCanAddContact(user); @@ -62,25 +60,44 @@ const Contact: FC = ({ }); return ( - +
{user ? getUserFullName(user) : getContactName(contact)}
-
{formatPhoneNumberWithCode(phoneCodeList, phoneNumber)}
+
+ {formatPhoneNumberWithCode(phoneCodeList, phoneNumber)} +
{isRegistered && ( <>
- {canAddContact && ( - )} @@ -107,14 +124,14 @@ function getContactName(contact: ApiContact) { return ''; } -export default withGlobal( - (global, { contact }): StateProps => { - const { countryList: { phoneCodes: phoneCodeList } } = global; - const user = selectUser(global, contact.userId); +export default withGlobal((global, { contact }): StateProps => { + const { + countryList: { phoneCodes: phoneCodeList }, + } = global; + const user = selectUser(global, contact.userId); - return { - user, - phoneCodeList, - }; - }, -)(Contact); + return { + user, + phoneCodeList, + }; +})(Contact); diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index 6e9776f35..8a139ee4a 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -1163,7 +1163,7 @@ const Message: FC = ({ )} {isStoryMention && } {contact && ( - + )} {poll && (