diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index de3f210a0..e0258fffd 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -1028,7 +1028,7 @@ } .module-conversation-header__title { - margin-inline-start: 6px; + margin: 0px 20px; min-width: 0; font-size: 16px; @@ -1046,6 +1046,12 @@ align-items: center; -webkit-user-select: text; + + .module-contact-name__profile-name { + width: 100%; + overflow: hidden !important; + text-overflow: ellipsis; + } } .module-conversation-header__title__profile-name { diff --git a/ts/components/ConversationListItem.tsx b/ts/components/ConversationListItem.tsx index 0d2c62451..993ce5792 100644 --- a/ts/components/ConversationListItem.tsx +++ b/ts/components/ConversationListItem.tsx @@ -348,6 +348,11 @@ class ConversationListItem extends React.PureComponent { const displayedPubkey = profileName ? shortenedPubkey : phoneNumber; const displayName = isMe ? i18n('noteToSelf') : profileName; + let shouldShowPubkey = false; + if (!name || name.length === 0) { + shouldShowPubkey = true; + } + return (
{ module="module-conversation__user" i18n={window.i18n} boldProfileName={true} + shouldShowPubkey={shouldShowPubkey} />
); diff --git a/ts/components/MessageSearchResult.tsx b/ts/components/MessageSearchResult.tsx index 0a56b0aff..936aa2211 100644 --- a/ts/components/MessageSearchResult.tsx +++ b/ts/components/MessageSearchResult.tsx @@ -68,6 +68,7 @@ export class MessageSearchResult extends React.PureComponent { profileName={from.profileName} i18n={i18n} module="module-message-search-result__header__name" + shouldShowPubkey={false} /> ); } @@ -86,6 +87,7 @@ export class MessageSearchResult extends React.PureComponent { name={to.name} profileName={to.profileName} i18n={i18n} + shouldShowPubkey={false} /> diff --git a/ts/components/conversation/ContactName.tsx b/ts/components/conversation/ContactName.tsx index 39f69d4c9..02252f909 100644 --- a/ts/components/conversation/ContactName.tsx +++ b/ts/components/conversation/ContactName.tsx @@ -12,6 +12,7 @@ interface Props { module?: string; boldProfileName?: Boolean; compact?: Boolean; + shouldShowPubkey: Boolean; } export class ContactName extends React.Component { @@ -24,19 +25,27 @@ export class ContactName extends React.Component { module, boldProfileName, compact, + shouldShowPubkey, } = this.props; const prefix = module ? module : 'module-contact-name'; const title = name ? name : phoneNumber; - const shouldShowProfile = Boolean(profileName && !name); + const shouldShowProfile = Boolean(profileName || name); const styles = (boldProfileName ? { fontWeight: 'bold', } : {}) as React.CSSProperties; + const textProfile = profileName || name || i18n('anonymous'); const profileElement = shouldShowProfile ? ( - + + + ) : null; + + const pubKeyElement = shouldShowPubkey ? ( + + ) : null; @@ -44,14 +53,7 @@ export class ContactName extends React.Component { {profileElement} {shouldShowProfile ? ' ' : null} - - - + {pubKeyElement} ); } diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index 82151ed7f..ba56d7fcf 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -179,16 +179,7 @@ class ConversationHeader extends React.Component { {text} ); - let title; - if (profileName) { - title = `${profileName} ${window.shortenPubkey(phoneNumber)}`; - } else { - if (name) { - title = `${name}`; - } else { - title = `User ${window.shortenPubkey(phoneNumber)}`; - } - } + const title = profileName || name || phoneNumber; return (
diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index f6bf8c93e..8e92ae035 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -1074,6 +1074,7 @@ export class Message extends React.PureComponent { conversationType, direction, i18n, + isPublic, } = this.props; const title = authorName ? authorName : authorPhoneNumber; @@ -1097,6 +1098,7 @@ export class Message extends React.PureComponent { module="module-message__author" i18n={i18n} boldProfileName={true} + shouldShowPubkey={Boolean(isPublic)} />
); diff --git a/ts/components/conversation/MessageDetail.tsx b/ts/components/conversation/MessageDetail.tsx index 235deb18b..1b432c432 100644 --- a/ts/components/conversation/MessageDetail.tsx +++ b/ts/components/conversation/MessageDetail.tsx @@ -107,6 +107,7 @@ export class MessageDetail extends React.Component { name={contact.name} profileName={contact.profileName} i18n={i18n} + shouldShowPubkey={true} /> {errors.map((error, index) => ( diff --git a/ts/components/conversation/Quote.tsx b/ts/components/conversation/Quote.tsx index 3737817b9..3856064d0 100644 --- a/ts/components/conversation/Quote.tsx +++ b/ts/components/conversation/Quote.tsx @@ -302,6 +302,7 @@ export class Quote extends React.Component { i18n, isFromMe, isIncoming, + isPublic, } = this.props; return ( @@ -320,6 +321,7 @@ export class Quote extends React.Component { profileName={authorProfileName} i18n={i18n} compact={true} + shouldShowPubkey={Boolean(isPublic)} /> )} diff --git a/ts/components/conversation/SafetyNumberNotification.tsx b/ts/components/conversation/SafetyNumberNotification.tsx index 47e633994..e31a90b09 100644 --- a/ts/components/conversation/SafetyNumberNotification.tsx +++ b/ts/components/conversation/SafetyNumberNotification.tsx @@ -42,6 +42,7 @@ export class SafetyNumberNotification extends React.Component { profileName={contact.profileName} phoneNumber={contact.phoneNumber} module="module-verification-notification__contact" + shouldShowPubkey={true} /> , ]} diff --git a/ts/components/conversation/TimerNotification.tsx b/ts/components/conversation/TimerNotification.tsx index 2d08c4497..a38a8cf23 100644 --- a/ts/components/conversation/TimerNotification.tsx +++ b/ts/components/conversation/TimerNotification.tsx @@ -51,6 +51,7 @@ export class TimerNotification extends React.Component { name={name} module="module-message__author" boldProfileName={true} + shouldShowPubkey={false} />, timespan, ]} diff --git a/ts/components/conversation/VerificationNotification.tsx b/ts/components/conversation/VerificationNotification.tsx index 0d9fca24e..43a67f797 100644 --- a/ts/components/conversation/VerificationNotification.tsx +++ b/ts/components/conversation/VerificationNotification.tsx @@ -53,6 +53,7 @@ export class VerificationNotification extends React.Component { profileName={contact.profileName} phoneNumber={contact.phoneNumber} module="module-verification-notification__contact" + shouldShowPubkey={true} />, ]} i18n={i18n} diff --git a/ts/components/session/SessionMemberListItem.tsx b/ts/components/session/SessionMemberListItem.tsx index 7497800b5..0cd21a1c7 100644 --- a/ts/components/session/SessionMemberListItem.tsx +++ b/ts/components/session/SessionMemberListItem.tsx @@ -49,8 +49,6 @@ export class SessionMemberListItem extends React.Component { const { isSelected } = this.state; const name = this.props.member.authorProfileName; - const pubkey = this.props.member.authorPhoneNumber; - const shortPubkey = window.shortenPubkey(pubkey); return (
{ {this.renderAvatar()} {name} - {shortPubkey}
{ title = window.i18n('anonymous'); } - title = `${title} ${window.shortenPubkey(blockedNumber)}`; - results.push({ id: blockedNumber, title,