diff --git a/.gitignore b/.gitignore index c1df6902..0ae3e696 100644 --- a/.gitignore +++ b/.gitignore @@ -56,7 +56,6 @@ typings/ .env* .cache/ -public # Mac files .DS_Store diff --git a/public/default.png b/public/default.png new file mode 100644 index 00000000..d0cafecd Binary files /dev/null and b/public/default.png differ diff --git a/src/components/Person.js b/src/components/Person.js index 9b9d0e8b..fa8a5d82 100644 --- a/src/components/Person.js +++ b/src/components/Person.js @@ -20,6 +20,10 @@ export default function Person({ person }) { height="50" src={img} alt={person.name} + onError={({ currentTarget }) => { + currentTarget.onerror = null; // prevents looping + currentTarget.src = "/default.png"; + }} loading="lazy" />