Skip to content

Commit

Permalink
fix: text truncate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
eshankvaish committed Jan 10, 2025
1 parent b5db2e7 commit 68e62d4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Shared/Components/ShowMoreText/ShowMoreText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,13 @@ const ShowMoreText = ({ text, textClass }: ShowMoreTextProps) => {
const toggleShowText = () => {
setShowAllText(!showAllText)
}
const getTextClassName = () => {
if (showAllText) {
return textClass || ''
}

return `${textClass || ''} dc__truncate`
}

return (
<div className="min-w-385 pr-20">
<span ref={ellipsisText} className={getTextClassName()}>
<span
ref={ellipsisText}
className={`${textClass || ''} ${!showAllText ? 'dc__truncate' : ''} dc__word-break`}
>
{text}
</span>
{showToggle && (
Expand Down

0 comments on commit 68e62d4

Please sign in to comment.