mirror of
https://github.com/mosh-hamedani/game-hub.git
synced 2026-05-21 12:14:32 +02:00
Handle games with no image
This commit is contained in:
parent
e2941cfba3
commit
e54cdbab3e
BIN
src/assets/no-image-placeholder.webp
Normal file
BIN
src/assets/no-image-placeholder.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
|
|
@ -1,6 +1,7 @@
|
||||||
|
import noImage from '../assets/no-image-placeholder.webp';
|
||||||
|
|
||||||
const getCroppedImageUrl = (url: string) => {
|
const getCroppedImageUrl = (url: string) => {
|
||||||
if (!url) return '';
|
if (!url) return noImage;
|
||||||
|
|
||||||
const target = 'media/';
|
const target = 'media/';
|
||||||
const index = url.indexOf(target) + target.length;
|
const index = url.indexOf(target) + target.length;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue