mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 20:00:25 +00:00
Fix flicking while loading
This commit is contained in:
@@ -9,31 +9,39 @@ const AvatarCard = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="card shadow-lg compact bg-base-100">
|
<div className="card shadow-lg compact bg-base-100">
|
||||||
<div className="grid place-items-center py-8">
|
<div className="grid place-items-center py-8">
|
||||||
<div className="avatar opacity-90 fade-in">
|
{
|
||||||
<div className={`mb-8 rounded-full w-32 h-32${!loading ? ' ring ring-primary ring-offset-base-100 ring-offset-2' : ''}`}>
|
loading ? (
|
||||||
{
|
<div className="avatar opacity-90">
|
||||||
loading ? (
|
<div className="mb-8 rounded-full w-32 h-32">
|
||||||
skeleton({
|
{
|
||||||
width: 'w-full',
|
skeleton({
|
||||||
height: 'h-full',
|
width: 'w-full',
|
||||||
shape: '',
|
height: 'h-full',
|
||||||
})
|
shape: '',
|
||||||
) : (
|
})
|
||||||
<LazyImage
|
}
|
||||||
src={profile.avatar ? profile.avatar : fallbackImage}
|
</div>
|
||||||
alt={profile.name}
|
</div>
|
||||||
placeholder={
|
) : (
|
||||||
skeleton({
|
<div className="avatar opacity-90">
|
||||||
width: 'w-full',
|
<div className="mb-8 rounded-full w-32 h-32 ring ring-primary ring-offset-base-100 ring-offset-2">
|
||||||
height: 'h-full',
|
{
|
||||||
shape: '',
|
<LazyImage
|
||||||
})
|
src={profile.avatar ? profile.avatar : fallbackImage}
|
||||||
}
|
alt={profile.name}
|
||||||
/>
|
placeholder={
|
||||||
)
|
skeleton({
|
||||||
}
|
width: 'w-full',
|
||||||
</div>
|
height: 'h-full',
|
||||||
</div>
|
shape: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
<div className="text-center mx-auto md:mx-8">
|
<div className="text-center mx-auto md:mx-8">
|
||||||
<h5 className="font-bold text-2xl">
|
<h5 className="font-bold text-2xl">
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user