fix: project images not loading - use getCleanImgSrc for grid cards + fix URL path extraction
This commit is contained in:
1 parent
056f838172
commit
4ed83bbecf
2 files changed
+4
-3
No files matched your search
@@ -5,7 +5,8 @@ export const getCleanImgSrc = (src: string): string => {
|
||||
if (!src) return '/images/placeholder.jpg';
|
||||
if (src.startsWith('http://') || src.startsWith('https://')) {
|
||||
const urlPath = new URL(src).pathname;
|
||||
return urlPath.startsWith('/storage') ? urlPath : `/images${urlPath}`;
|
||||
return urlPath;
|
||||
}
|
||||
return src;
|
||||
if (src.startsWith('/')) return src;
|
||||
return `/images/projects/${src}`;
|
||||
};
|
||||
Reference in new issue
Block a user