diff --git a/components/layout/footer/index.js b/components/layout/footer/index.js index 412dcf3..cc9ba7c 100644 --- a/components/layout/footer/index.js +++ b/components/layout/footer/index.js @@ -16,16 +16,28 @@ import LogoNamad from "./LogoNamad"; import HeadMenu from "./menu/HeadMenu"; import ListMenu from "./menu/ListMenu"; import { useState } from "react"; +import { isRootCity } from "@/lib/rootCity"; -const head = [ - { icon: , text: "جستجوی پزشک در شهر شما" }, - { icon: , text: "نوبت گیری سریع و آسان" }, - { - icon: , - text: "دشبورد اختصاصی برای پزشکان", - link: "https://clinic-pro.ir/", - }, -]; +// روی دامنهٔ ریشه (nobat724.com) شهری در کار نیست، پس همان «شهر شما» می‌ماند؛ +// روی دامنهٔ هر شهر، نام همان شهر می‌نشیند. لینک نسبی است تا هر دامنه به ریشهٔ +// خودش برود و کاربر بین دامنه‌ها پرت نشود. +const buildHead = (matchedCity) => { + const cityName = isRootCity(matchedCity) ? null : matchedCity?.name; + + return [ + { + icon: , + text: cityName ? `جستجوی پزشک در شهر ${cityName}` : "جستجوی پزشک در شهر شما", + link: "/", + }, + { icon: , text: "نوبت گیری سریع و آسان", link: "/" }, + { + icon: , + text: "مدیریت کلینیک با کلینیک پرو", + link: "https://clinic-pro.ir/", + }, + ]; +}; function buildSocialUrl(name, value) { if (!value) return null; @@ -70,12 +82,8 @@ function Footer({ matchedCity }) { return (
- {head.map((item, idx) => ( - !item.link && e.preventDefault} - > + {buildHead(matchedCity).map((item, idx) => ( +