Skip to content

Commit

Permalink
Update Profile.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamtawli authored Sep 4, 2024
1 parent d55e9f7 commit 6992d9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Profile/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ function Profile({ data }) {

function Card({ data }) {
const cardRef = React.useRef();
const [imageSrc, setImageSrc] = useState(data.avatar || defaultAvatar);
const handleImageError = () => {
setImageSrc(defaultAvatar); // Fallback to default image
};
// const [imageSrc, setImageSrc] = useState(data.avatar);
// const handleImageError = () => {
// setImageSrc(defaultAvatar); // Fallback to default image
// };

const handleWheel = (event) => {
event.stopPropagation();
Expand All @@ -36,7 +36,7 @@ function Card({ data }) {
<div className="mb-6 h-auto rounded-lg bg-white p-4 shadow dark:bg-textPrimary">
<div className="relative flex gap-4">
<div className="h-24 w-24 flex-shrink-0">
<img src={imageSrc} alt="User logo" className="h-full w-full rounded-full" onError={handleImageError} />
<img src={data.avatar} alt="User logo" className="h-full w-full rounded-full" />
</div>
<div className="w-[55%] sm:w-[75%]">
<h3>
Expand Down

0 comments on commit 6992d9a

Please sign in to comment.