feat: Implement shimmer loading for profile and avatar images across various components.
This commit is contained in:
@@ -124,19 +124,13 @@ export function ChatHeader({
|
||||
<div className="relative flex-shrink-0">
|
||||
<div className="w-[50px] h-[50px] rounded-full overflow-hidden border border-[#00293D]/20 relative">
|
||||
{(!avatar || !avatarLoaded || isPlaceholderAvatar) && (
|
||||
<Image
|
||||
src={placeholder}
|
||||
alt={name}
|
||||
width={50}
|
||||
height={50}
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
/>
|
||||
<div className="absolute inset-0 rounded-full shimmer-loading" />
|
||||
)}
|
||||
{avatar && !isPlaceholderAvatar && (
|
||||
<img
|
||||
src={avatar}
|
||||
alt={name}
|
||||
className={`absolute inset-0 w-full h-full object-cover transition-opacity duration-200 ${avatarLoaded ? 'opacity-100' : 'opacity-0'}`}
|
||||
className={`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${avatarLoaded ? 'opacity-100' : 'opacity-0'}`}
|
||||
onLoad={() => setAvatarLoaded(true)}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user