Skip to content

Commit

Permalink
Implement truncation for sidebar user card username to handle overflow
Browse files Browse the repository at this point in the history
vinutv committed Oct 16, 2024
1 parent bb7e66f commit 82966c3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Components/Common/Sidebar/SidebarUserCard.tsx
Original file line number Diff line number Diff line change
@@ -43,11 +43,13 @@ const SidebarUserCard: React.FC<SidebarUserCardProps> = ({ shrinked }) => {
className="w-8 text-sm font-medium"
/>
</div>
{!shrinked && (
<span className="flex w-full grow items-center pl-1 text-xs font-medium tracking-wide">
{formatName(user)}
</span>
)}
<div className="max-w-32">
{!shrinked && (
<p className="truncate pl-1 text-xs font-medium tracking-wide">
{formatName(user)}
</p>
)}
</div>
</div>
<div className="flex shrink-0 items-center justify-center rounded-full bg-gray-300/50">
<CareIcon

0 comments on commit 82966c3

Please sign in to comment.