Skip to content

Commit 68e62d4

Browse files
committed
fix: text truncate issue
1 parent b5db2e7 commit 68e62d4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Shared/Components/ShowMoreText/ShowMoreText.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,13 @@ const ShowMoreText = ({ text, textClass }: ShowMoreTextProps) => {
4040
const toggleShowText = () => {
4141
setShowAllText(!showAllText)
4242
}
43-
const getTextClassName = () => {
44-
if (showAllText) {
45-
return textClass || ''
46-
}
47-
48-
return `${textClass || ''} dc__truncate`
49-
}
5043

5144
return (
5245
<div className="min-w-385 pr-20">
53-
<span ref={ellipsisText} className={getTextClassName()}>
46+
<span
47+
ref={ellipsisText}
48+
className={`${textClass || ''} ${!showAllText ? 'dc__truncate' : ''} dc__word-break`}
49+
>
5450
{text}
5551
</span>
5652
{showToggle && (

0 commit comments

Comments
 (0)