From 4ed83bbecf6dff4edbd02d84ef8f1cfeb71b510d Mon Sep 17 00:00:00 2001
From: parsa aghaei
Date: Mon, 29 Jun 2026 14:00:22 +0330
Subject: [PATCH] fix: project images not loading - use getCleanImgSrc for grid
cards + fix URL path extraction
---
src/app/(routes)/(website)/components/projects/projects.tsx | 2 +-
src/app/lib/functions/client-utils.ts | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/app/(routes)/(website)/components/projects/projects.tsx b/src/app/(routes)/(website)/components/projects/projects.tsx
index 78bb49a..f2cdb79 100644
--- a/src/app/(routes)/(website)/components/projects/projects.tsx
+++ b/src/app/(routes)/(website)/components/projects/projects.tsx
@@ -203,7 +203,7 @@ export default function Projects({ dict }: MyProjectsProps) {
{project.images.map((image, idx) => (
{
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}`;
};