Skip to content

Commit 2ec1c15

Browse files
committed
change avatar layout
1 parent 19b4521 commit 2ec1c15

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

src/components/avatar-card/index.tsx

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ interface AvatarCardProps {
1111
}
1212

1313
/**
14-
* Renders an AvatarCard component.
15-
* @param profile - The profile object.
16-
* @param loading - A boolean indicating if the profile is loading.
17-
* @param avatarRing - A boolean indicating if the avatar should have a ring.
18-
* @param resumeFileUrl - The URL of the resume file.
19-
* @returns JSX element representing the AvatarCard.
14+
* Renders an AvatarCard component with avatar on the left,
15+
* name and bio on the right, and resume button centered below.
2016
*/
2117
const AvatarCard: React.FC<AvatarCardProps> = ({
2218
profile,
@@ -25,11 +21,13 @@ const AvatarCard: React.FC<AvatarCardProps> = ({
2521
resumeFileUrl,
2622
}): React.JSX.Element => {
2723
return (
28-
<div className="card shadow-lg card-sm bg-base-100">
29-
<div className="grid place-items-center py-8">
24+
<div className="card shadow-lg card-sm bg-base-100 p-8">
25+
{/* Top section: avatar left, text right */}
26+
<div className="flex flex-col md:flex-row items-center md:items-start gap-8">
27+
{/* Avatar */}
3028
{loading || !profile ? (
3129
<div className="avatar opacity-90">
32-
<div className="mb-8 rounded-full w-32 h-32">
30+
<div className="rounded-full w-32 h-32">
3331
{skeleton({
3432
widthCls: 'w-full',
3533
heightCls: 'h-full',
@@ -40,27 +38,27 @@ const AvatarCard: React.FC<AvatarCardProps> = ({
4038
) : (
4139
<div className="avatar opacity-90">
4240
<div
43-
className={`mb-8 rounded-full w-32 h-32 ${
41+
className={`rounded-full w-32 h-32 ${
4442
avatarRing
4543
? 'ring-3 ring-primary ring-offset-base-100 ring-offset-2'
4644
: ''
4745
}`}
4846
>
49-
{
50-
<LazyImage
51-
src={profile.avatar ? profile.avatar : FALLBACK_IMAGE}
52-
alt={profile.name}
53-
placeholder={skeleton({
54-
widthCls: 'w-full',
55-
heightCls: 'h-full',
56-
shape: '',
57-
})}
58-
/>
59-
}
47+
<LazyImage
48+
src={profile.avatar ? profile.avatar : FALLBACK_IMAGE}
49+
alt={profile.name}
50+
placeholder={skeleton({
51+
widthCls: 'w-full',
52+
heightCls: 'h-full',
53+
shape: '',
54+
})}
55+
/>
6056
</div>
6157
</div>
6258
)}
63-
<div className="text-center mx-auto px-8">
59+
60+
{/* Name + Bio */}
61+
<div className="flex-1 text-center md:text-left">
6462
<h5 className="font-bold text-2xl">
6563
{loading || !profile ? (
6664
skeleton({ widthCls: 'w-48', heightCls: 'h-8' })
@@ -76,25 +74,29 @@ const AvatarCard: React.FC<AvatarCardProps> = ({
7674
: profile.bio}
7775
</div>
7876
</div>
79-
{resumeFileUrl &&
80-
(loading ? (
81-
<div className="mt-6">
82-
{skeleton({ widthCls: 'w-40', heightCls: 'h-8' })}
83-
</div>
84-
) : (
77+
</div>
78+
79+
{/* Resume button centered below */}
80+
{resumeFileUrl &&
81+
(loading ? (
82+
<div className="mt-6 flex justify-center">
83+
{skeleton({ widthCls: 'w-40', heightCls: 'h-8' })}
84+
</div>
85+
) : (
86+
<div className="mt-6 flex justify-center">
8587
<a
8688
href={resumeFileUrl}
8789
target="_blank"
88-
className="btn btn-outline btn-sm text-xs mt-6 opacity-50"
90+
className="btn btn-outline btn-sm text-xs opacity-50"
8991
download
9092
rel="noreferrer"
9193
>
9294
Download Resume
9395
</a>
94-
))}
95-
</div>
96+
</div>
97+
))}
9698
</div>
9799
);
98100
};
99101

100-
export default AvatarCard;
102+
export default AvatarCard;

0 commit comments

Comments
 (0)