User Note: Fix calc isCollapsible (#6443)
This commit is contained in:
parent
8bff844a5f
commit
258bdae6e1
@ -165,11 +165,18 @@ const ChatExtra = ({
|
|||||||
|
|
||||||
const noteTextRef = useRef<HTMLDivElement>();
|
const noteTextRef = useRef<HTMLDivElement>();
|
||||||
|
|
||||||
|
const shouldRenderNote = Boolean(note);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isCollapsed: isNoteCollapsed,
|
isCollapsed: isNoteCollapsed,
|
||||||
isCollapsible: isNoteCollapsible,
|
isCollapsible: isNoteCollapsible,
|
||||||
setIsCollapsed: setIsNoteCollapsed,
|
setIsCollapsed: setIsNoteCollapsed,
|
||||||
} = useCollapsibleLines(noteTextRef, MAX_LINES, undefined);
|
} = useCollapsibleLines(
|
||||||
|
noteTextRef,
|
||||||
|
MAX_LINES,
|
||||||
|
undefined,
|
||||||
|
!shouldRenderNote,
|
||||||
|
);
|
||||||
|
|
||||||
useEffectWithPrevDeps(([prevPeerId]) => {
|
useEffectWithPrevDeps(([prevPeerId]) => {
|
||||||
if (!peerId || prevPeerId === peerId) return;
|
if (!peerId || prevPeerId === peerId) return;
|
||||||
@ -481,7 +488,7 @@ const ChatExtra = ({
|
|||||||
<span className="subtitle">{oldLang('BusinessProfileLocation')}</span>
|
<span className="subtitle">{oldLang('BusinessProfileLocation')}</span>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
)}
|
)}
|
||||||
{note && (
|
{shouldRenderNote && (
|
||||||
<ListItem
|
<ListItem
|
||||||
icon="note"
|
icon="note"
|
||||||
iconClassName={styles.noteListItemIcon}
|
iconClassName={styles.noteListItemIcon}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user