feat(footer): name the visitor's city in the search chip and link the chips
The first chip said "your city" on every domain even though each domain is already scoped to one; it now carries that city's name, falling back to the old wording on the root domain, which has no city. Both site chips link to "/" — relative, so each domain lands on its own home page rather than throwing the visitor onto another one — and the third is retitled to name the product it points at. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,16 +16,28 @@ import LogoNamad from "./LogoNamad";
|
|||||||
import HeadMenu from "./menu/HeadMenu";
|
import HeadMenu from "./menu/HeadMenu";
|
||||||
import ListMenu from "./menu/ListMenu";
|
import ListMenu from "./menu/ListMenu";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { isRootCity } from "@/lib/rootCity";
|
||||||
|
|
||||||
const head = [
|
// روی دامنهٔ ریشه (nobat724.com) شهری در کار نیست، پس همان «شهر شما» میماند؛
|
||||||
{ icon: <LocationF />, text: "جستجوی پزشک در شهر شما" },
|
// روی دامنهٔ هر شهر، نام همان شهر مینشیند. لینک نسبی است تا هر دامنه به ریشهٔ
|
||||||
{ icon: <CalendarAddF />, text: "نوبت گیری سریع و آسان" },
|
// خودش برود و کاربر بین دامنهها پرت نشود.
|
||||||
|
const buildHead = (matchedCity) => {
|
||||||
|
const cityName = isRootCity(matchedCity) ? null : matchedCity?.name;
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
icon: <LocationF />,
|
||||||
|
text: cityName ? `جستجوی پزشک در شهر ${cityName}` : "جستجوی پزشک در شهر شما",
|
||||||
|
link: "/",
|
||||||
|
},
|
||||||
|
{ icon: <CalendarAddF />, text: "نوبت گیری سریع و آسان", link: "/" },
|
||||||
{
|
{
|
||||||
icon: <StethoscopeF />,
|
icon: <StethoscopeF />,
|
||||||
text: "دشبورد اختصاصی برای پزشکان",
|
text: "مدیریت کلینیک با کلینیک پرو",
|
||||||
link: "https://clinic-pro.ir/",
|
link: "https://clinic-pro.ir/",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
|
||||||
function buildSocialUrl(name, value) {
|
function buildSocialUrl(name, value) {
|
||||||
if (!value) return null;
|
if (!value) return null;
|
||||||
@@ -70,12 +82,8 @@ function Footer({ matchedCity }) {
|
|||||||
return (
|
return (
|
||||||
<div className="pb-[11px]">
|
<div className="pb-[11px]">
|
||||||
<div className="flex items-center justify-evenly gap-[12px]">
|
<div className="flex items-center justify-evenly gap-[12px]">
|
||||||
{head.map((item, idx) => (
|
{buildHead(matchedCity).map((item, idx) => (
|
||||||
<Link
|
<Link key={idx} href={item.link}>
|
||||||
key={idx}
|
|
||||||
href={item.link || ""}
|
|
||||||
onClick={(e) => !item.link && e.preventDefault}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
className="flex flex-col lg:flex-row items-center cursor-pointer justify-start gap-1 p-[6px] hover:transition-all transition-all duration-300 hover:duration-300 rounded-[8px] border-solid border border-[#EFEFEF] bg-[#F7F7F7] hover:bg-none hover:border-[#FDBD9F]"
|
className="flex flex-col lg:flex-row items-center cursor-pointer justify-start gap-1 p-[6px] hover:transition-all transition-all duration-300 hover:duration-300 rounded-[8px] border-solid border border-[#EFEFEF] bg-[#F7F7F7] hover:bg-none hover:border-[#FDBD9F]"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user