mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
Merge pull request #1564 from Hacksore/feat/add-fallback-image
Add fallback image
This commit is contained in:
commit
e765f9f22c
3 changed files with 4 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -56,7 +56,6 @@ typings/
|
||||||
.env*
|
.env*
|
||||||
|
|
||||||
.cache/
|
.cache/
|
||||||
public
|
|
||||||
|
|
||||||
# Mac files
|
# Mac files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
||||||
BIN
public/default.png
Normal file
BIN
public/default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 755 B |
|
|
@ -20,6 +20,10 @@ export default function Person({ person }) {
|
||||||
height="50"
|
height="50"
|
||||||
src={img}
|
src={img}
|
||||||
alt={person.name}
|
alt={person.name}
|
||||||
|
onError={({ currentTarget }) => {
|
||||||
|
currentTarget.onerror = null; // prevents looping
|
||||||
|
currentTarget.src = "/default.png";
|
||||||
|
}}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
<h3>
|
<h3>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue