From 0c3fe11ea3fbf21674145476f6a141a7f70fd149 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 12 May 2021 15:28:42 +0300 Subject: [PATCH] Profile: Allow pointer actions in bio (#1085) --- src/components/right/ChatExtra.tsx | 11 ++++------- src/components/ui/ListItem.scss | 4 ++-- src/components/ui/ListItem.tsx | 6 +++++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/right/ChatExtra.tsx b/src/components/right/ChatExtra.tsx index 81ca541ce..fe7464590 100644 --- a/src/components/right/ChatExtra.tsx +++ b/src/components/right/ChatExtra.tsx @@ -76,13 +76,11 @@ const ChatExtra: FC = ({ return undefined; } - const bio = fullInfo && fullInfo.bio; const formattedNumber = phoneNumber && formatPhoneNumberWithCode(phoneNumber); - const description = getChatDescription(chat); const link = getChatLink(chat); const url = link.indexOf('http') === 0 ? link : `http://${link}`; const printedUsername = username || chatUsername; - const printedDescription = bio || description; + const description = (fullInfo && fullInfo.bio) || getChatDescription(chat); return (
@@ -104,15 +102,14 @@ const ChatExtra: FC = ({ {lang('Username')} )} - {printedDescription && !!printedDescription.length && ( + {description && !!description.length && ( handleClick(printedDescription, lang(userId ? 'UserBio' : 'Info'))} + isStatic > - {renderText(printedDescription, ['br', 'links', 'emoji'])} + {renderText(description, ['br', 'links', 'emoji'])} {lang(userId ? 'UserBio' : 'Info')} )} diff --git a/src/components/ui/ListItem.scss b/src/components/ui/ListItem.scss index 07c09c64f..744e2d782 100644 --- a/src/components/ui/ListItem.scss +++ b/src/components/ui/ListItem.scss @@ -39,7 +39,7 @@ } } - &:not(.disabled) { + &:not(.disabled):not(.is-static) { .ListItem-button { cursor: pointer; @@ -50,7 +50,7 @@ } @media (min-width: 600px) { - &:not(.has-ripple), + &:not(.has-ripple):not(.is-static), body.animation-level-0 & { .ListItem-button:active { --background-color: var(--color-item-active) !important; diff --git a/src/components/ui/ListItem.tsx b/src/components/ui/ListItem.tsx index 15d36f05a..1b0294b04 100644 --- a/src/components/ui/ListItem.tsx +++ b/src/components/ui/ListItem.tsx @@ -34,6 +34,7 @@ type OwnProps = { focus?: boolean; destructive?: boolean; multiline?: boolean; + isStatic?: boolean; contextActions?: MenuItemContextAction[]; onClick?: OnClickHandler; }; @@ -52,6 +53,7 @@ const ListItem: FC = (props) => { focus, destructive, multiline, + isStatic, contextActions, onClick, } = props; @@ -111,8 +113,9 @@ const ListItem: FC = (props) => { }, [inactive, contextActions, onClick, handleBeforeContextMenu, handleContextMenu, handleClick]); const fullClassName = buildClassName( - 'ListItem no-selection', + 'ListItem', className, + !isStatic && 'no-selection', ripple && 'has-ripple', narrow && 'narrow', disabled && 'disabled', @@ -121,6 +124,7 @@ const ListItem: FC = (props) => { focus && 'focus', destructive && 'destructive', multiline && 'multiline', + isStatic && 'is-static', ); return (