Skip to content

Commit 71f3ba1

Browse files
committed
fix: remove unused UserCardPortal and refactor FriendItem component for improved performance
1 parent 67053ce commit 71f3ba1

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/layouts/navbar/friends-list/friend.item.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { useRef } from 'react'
21
import { AvatarComponent } from '@/components/avatar.component'
32
import Tooltip from '@/components/toolTip'
4-
import { UserCardPortal } from '@/components/user/user-card-portal'
53
import type { FriendUser } from '@/services/hooks/friends/friendService.hook'
64

75
interface FriendItemProps {
@@ -15,7 +13,6 @@ export function FriendItem({
1513
activeProfileId,
1614
setActiveProfileId,
1715
}: FriendItemProps) {
18-
const containerRef = useRef<HTMLDivElement>(null)
1916
const isActive = activeProfileId === user.userId
2017

2118
const handleClick = () => {
@@ -50,7 +47,6 @@ export function FriendItem({
5047
}
5148
>
5249
<div
53-
ref={containerRef}
5450
className="flex flex-col items-center justify-center overflow-hidden transition-all cursor-pointer hover:scale-105 group"
5551
onClick={handleClick}
5652
>
@@ -71,20 +67,6 @@ export function FriendItem({
7167
</span>
7268
</div>
7369
</Tooltip>
74-
75-
<UserCardPortal
76-
user={{
77-
avatar: user.avatar,
78-
name: user.name,
79-
username: user.username,
80-
friendshipStatus: 'ACCEPTED',
81-
isSelf: false,
82-
extras: user.extras,
83-
}}
84-
isOpen={isActive}
85-
onClose={() => setActiveProfileId(null)}
86-
triggerRef={containerRef as React.RefObject<HTMLElement>}
87-
/>
8870
</div>
8971
)
9072
}

0 commit comments

Comments
 (0)