fix truncate function to handle Chinese characters (#677)

* fix truncate function to handle Chinese characters

* revert changes to truncate function and cut off title using css

* add CSS ellipse on long file name

* fix uploaded middleTruncation as well as directory

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
This commit is contained in:
Sean Hatfield 2024-02-06 11:30:49 -08:00 committed by GitHub
parent 608f28d745
commit b94da205a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ export default function FileRow({
onMouseEnter={handleMouseEnter} onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave} onMouseLeave={handleMouseLeave}
> >
<p className="whitespace-nowrap overflow-hidden"> <p className="whitespace-nowrap overflow-hidden max-w-[165px] text-ellipsis">
{middleTruncate(item.title, 17)} {middleTruncate(item.title, 17)}
</p> </p>
{showTooltip && ( {showTooltip && (

View File

@ -64,7 +64,7 @@ export default function WorkspaceFileRow({
onMouseEnter={handleMouseEnter} onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave} onMouseLeave={handleMouseLeave}
> >
<p className="whitespace-nowrap overflow-hidden"> <p className="whitespace-nowrap overflow-hidden max-w-[165px] text-ellipsis">
{middleTruncate(item.title, 17)} {middleTruncate(item.title, 17)}
</p> </p>
{showTooltip && ( {showTooltip && (