Skip to content

Commit 12dc3bb

Browse files
committed
Fix ProfileCard component with loading state handling and avatar fallback
1 parent fc48c73 commit 12dc3bb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/components/ProfileCard/ProfileCard.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ interface ProfileCardProps {
1919

2020
export default function ProfileCard({ userData, isLoading, error }: ProfileCardProps) {
2121
const [isModalOpen, setModalIsOpen] = useState<boolean | undefined>(false)
22+
console.log(userData)
2223

2324
const openModal = () => {
2425
setModalIsOpen(true)
@@ -49,17 +50,17 @@ export default function ProfileCard({ userData, isLoading, error }: ProfileCardP
4950
]
5051
}}
5152
>
52-
<Card isPressable isHoverable className="w-full mb-4" onPress={openModal}>
53-
<div className="flex items-center justify-center justify-col mt-2">
54-
<Avatar
55-
isBordered
56-
color="success"
57-
radius="full"
58-
className="w-32 h-32 mb-4 text-large "
59-
src={userData?.avatar_url}
60-
/>
61-
</div>
53+
<Card isPressable isHoverable className="flex w-full mb-4" onPress={openModal}>
6254
<Skeleton isLoaded={!isLoading} className="w-full h-full">
55+
<div className="flex items-center justify-center justify-col mt-2">
56+
<Avatar
57+
isBordered
58+
color="success"
59+
radius="full"
60+
className="w-32 h-32 mb-4"
61+
src={userData?.avatar_url || ''}
62+
/>
63+
</div>
6364
<CardHeader className="items-center justify-center justify-col">
6465
<div className="flex flex-col items-center justify-center gap-1">
6566
<h4 className="text-2xl font-semibold leading-none text-default-600">

0 commit comments

Comments
 (0)