Set Fallback Image for broken Thumbnails (#50)

* Set Fallback Image for broken Thumbnails

* Transparent placeholder

* Added some comments
This commit is contained in:
Sascha Hahne
2021-10-26 22:41:28 +02:00
committed by GitHub
parent a1c84df0d5
commit 9875cbdc70
2 changed files with 6 additions and 1 deletions

4
public/notFound.svg Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Transparent placeholder as fallback for unsuccessful image loads -->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="12" height="12">
</svg>

After

Width:  |  Height:  |  Size: 199 B

View File

@@ -36,7 +36,8 @@ export default function SpinnerImage(props: IProps) {
}; };
img.onerror = () => { img.onerror = () => {
setImagsrc('Not Found'); // Setting to an actual image so CSS styling works consistently
setImagsrc('/notFound.svg');
}; };
return () => { return () => {