diff --git a/src/components/dev-card.jsx b/src/components/dev-card.jsx index ea3db0d..1aacd79 100644 --- a/src/components/dev-card.jsx +++ b/src/components/dev-card.jsx @@ -18,6 +18,7 @@ const enabledLink = { }; export default function DevCard({ profile }) { + const [isValidImg, setIsValidImg] = React.useState(true) const location = useLocation(); return ( @@ -28,9 +29,11 @@ export default function DevCard({ profile }) { > { + if (e) setIsValidImg(false); + }} image={ - profile.photo ?? - "https://avatars.githubusercontent.com/u/9919?s=200&v=4" + profile.photo && isValidImg ? profile.photo : "https://avatars.githubusercontent.com/u/9919?s=200&v=4" } alt={`${profile.github} GitHub headshot`} />