feat(projects): نقشهٔ مختصات پروژه زیر هیرو در صفحهٔ هر پروژه — سنجاق دقیق با پاپآپ تصاویر و پیوند نشان
This commit is contained in:
@@ -10,6 +10,8 @@ import { useEffect } from 'react';
|
|||||||
import { useSite, useStatusLabel } from '../api';
|
import { useSite, useStatusLabel } from '../api';
|
||||||
import { useLang } from '../i18n/lang';
|
import { useLang } from '../i18n/lang';
|
||||||
import { useAdmin } from '../admin/AdminContext';
|
import { useAdmin } from '../admin/AdminContext';
|
||||||
|
import { LazyProjectsMapSingle } from '../map/LazyMaps';
|
||||||
|
import { createPlaceholderProject, findMapProjectByName } from '../data/mapProjects';
|
||||||
import { applySeo } from '../seo';
|
import { applySeo } from '../seo';
|
||||||
|
|
||||||
export function ProjectDetail() {
|
export function ProjectDetail() {
|
||||||
@@ -21,6 +23,12 @@ export function ProjectDetail() {
|
|||||||
const statusLabel = useStatusLabel(project?.status ?? '')
|
const statusLabel = useStatusLabel(project?.status ?? '')
|
||||||
const [lightbox, setLightbox] = useState<number | null>(null)
|
const [lightbox, setLightbox] = useState<number | null>(null)
|
||||||
|
|
||||||
|
// مختصات پروژه از فهرست سنجاقهای شیت؛ نبودش → محل جایگزین تا نقشه خالی نماند
|
||||||
|
const mapLocation = project
|
||||||
|
? (findMapProjectByName(project.title) ?? createPlaceholderProject(project.title, project.summary))
|
||||||
|
: null
|
||||||
|
const mapImages = project ? [project.image, ...(Array.isArray(project.gallery) ? project.gallery : [])].filter(Boolean) : []
|
||||||
|
|
||||||
// عنوان تب، توضیح متا، OG و JSON-LD از خود پروژه — همارز نسخهٔ سمت سرور (seo_pages.py)
|
// عنوان تب، توضیح متا، OG و JSON-LD از خود پروژه — همارز نسخهٔ سمت سرور (seo_pages.py)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!project) return;
|
if (!project) return;
|
||||||
@@ -127,6 +135,21 @@ export function ProjectDetail() {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
{/* نقشهٔ مختصات پروژه — بلافاصله زیر هیرو */}
|
||||||
|
{mapLocation && (
|
||||||
|
<section className="bg-char py-10 lg:py-14" aria-label={t('mapAria')}>
|
||||||
|
<div className="mx-auto max-w-site px-6 lg:px-10">
|
||||||
|
<div className="w-full max-w-full overflow-hidden rounded-2xl border border-white/10">
|
||||||
|
<LazyProjectsMapSingle
|
||||||
|
location={mapLocation}
|
||||||
|
images={mapImages}
|
||||||
|
className="h-[320px] md:h-[420px] w-full"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
|
||||||
<section className="bg-char py-20 lg:py-28" aria-label={t('projectDetailsAria')}>
|
<section className="bg-char py-20 lg:py-28" aria-label={t('projectDetailsAria')}>
|
||||||
<div className="mx-auto grid max-w-site items-start gap-12 px-6 lg:grid-cols-2 lg:gap-16 lg:px-10">
|
<div className="mx-auto grid max-w-site items-start gap-12 px-6 lg:grid-cols-2 lg:gap-16 lg:px-10">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user