From d56dff2a2f936432fe9a7ab5b990897eafe52887 Mon Sep 17 00:00:00 2001 From: aramesh-site deploy Date: Thu, 1 Oct 2026 16:01:54 +0000 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=D8=AF=DA=A9=D9=85=D9=87=D9=94=20?= =?UTF-8?q?=C2=AB=D9=88=DB=8C=D8=B1=D8=A7=DB=8C=D8=B4=20=D8=A7=DB=8C=D9=86?= =?UTF-8?q?=20=D9=BE=D8=B1=D9=88=DA=98=D9=87=C2=BB=20=D8=AF=D8=B1=20=D8=B5?= =?UTF-8?q?=D9=81=D8=AD=D9=87=D9=94=20=D8=B9=D9=85=D9=88=D9=85=DB=8C=20?= =?UTF-8?q?=D9=BE=D8=B1=D9=88=DA=98=D9=87=20=D8=A8=D8=B1=D8=A7=DB=8C=20?= =?UTF-8?q?=D9=87=D9=85=D9=87=20=D8=B1=D9=86=D8=AF=D8=B1=20=D9=85=DB=8C?= =?UTF-8?q?=E2=80=8C=D8=B4=D8=AF=20=E2=80=94=20=D9=81=D9=82=D8=B7=20=D8=A8?= =?UTF-8?q?=D8=B1=D8=A7=DB=8C=20=D8=A7=D8=AF=D9=85=DB=8C=D9=86=20=D9=88?= =?UTF-8?q?=D8=A7=D8=B1=D8=AF=D8=B4=D8=AF=D9=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/ProjectDetail.tsx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/src/pages/ProjectDetail.tsx b/frontend/src/pages/ProjectDetail.tsx index 97d89ac..aaf7bae 100644 --- a/frontend/src/pages/ProjectDetail.tsx +++ b/frontend/src/pages/ProjectDetail.tsx @@ -9,12 +9,14 @@ import { Lightbox } from '../components/Lightbox' import { useEffect } from 'react'; import { useSite, useStatusLabel } from '../api'; import { useLang } from '../i18n/lang'; +import { useAdmin } from '../admin/AdminContext'; import { applySeo } from '../seo'; export function ProjectDetail() { const { slug } = useParams<{ slug: string }>() const { projects, brand } = useSite() const { t, href, lang } = useLang() + const { canManageSite } = useAdmin() const project = projects.find((p) => p.slug === slug) const statusLabel = useStatusLabel(project?.status ?? '') const [lightbox, setLightbox] = useState(null) @@ -88,16 +90,18 @@ export function ProjectDetail() {

{project.title}

{project.summary}

- {/* ویرایش این پروژه — صفحهٔ اختصاصی ویرایش */} -
- - ویرایش این پروژه (عنوان، مشخصات، گالری، متن) - -
+ {/* ویرایش این پروژه — فقط برای ادمین واردشده؛ هرگز برای بازدیدکننده رندر نشود */} + {canManageSite && ( +
+ + ویرایش این پروژه (عنوان، مشخصات، گالری، متن) + +
+ )}