feat: enhance doctor and clinic components with doctorTitle helper and improve rendering logic
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { doctorTitle } from "@/helper";
|
||||
|
||||
// Icons
|
||||
import CopyBlueD from "@/components/icons/CopyBlueD";
|
||||
import DownloadBlue from "@/components/icons/DownloadBlue";
|
||||
@@ -121,7 +123,7 @@ function List({ hiddenRef, data, qrReady }) {
|
||||
typeof window !== "undefined" ? window.location.href : "";
|
||||
|
||||
const getShareText = () =>
|
||||
data?.name ? `معرفی ${data.name} در نوبت 724` : "معرفی پزشک در نوبت 724";
|
||||
data?.name ? `معرفی ${doctorTitle(data.name)} در نوبت 724` : "معرفی پزشک در نوبت 724";
|
||||
|
||||
const openShareWindow = (url) => {
|
||||
if (typeof window !== "undefined") {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { doctorTitle } from "@/helper";
|
||||
import CircularLoading from "@/app/component/loading/Circular";
|
||||
import CustomLoading from "@/app/component/loading/Custom";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
@@ -35,7 +36,7 @@ function Title({ doctor }) {
|
||||
<TextLoading width={90} height={20}>
|
||||
<div className="flex items-center gap-2">
|
||||
<h1 className="text-[#3B3B3B] text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">
|
||||
{doctor?.name}
|
||||
{doctorTitle(doctor?.name)}
|
||||
</h1>
|
||||
{isUnclaimed && (
|
||||
<span className="text-[#737373] bg-[#F5F5F5] border border-[#E5E5E5] rounded-full px-2 py-0.5 text-[10px] md:text-[12px] font-medium whitespace-nowrap">
|
||||
|
||||
@@ -6,6 +6,7 @@ import Share from "./detailDoctor/Share";
|
||||
import CustomLoading from "@/app/component/loading/Custom";
|
||||
import Faq from "@/components/specialties/detail/Faq";
|
||||
import specialtiesData from "@/data/specialties.json";
|
||||
import { doctorTitle } from "@/helper";
|
||||
|
||||
// مقصد تمیز صفحهٔ فرود تخصص؛ اگر تخصص slug نداشت، لیست پزشکان با کوئری قدیمی.
|
||||
const specialtyHref = (name) => {
|
||||
@@ -31,7 +32,7 @@ function DoctorPage({ doctor, comments, rateAggregate, addresses, bookableAddres
|
||||
</span>
|
||||
))}
|
||||
</h2>
|
||||
<p className="text-[#525252] text-nowrap mr-1">{doctor?.name}</p>
|
||||
<p className="text-[#525252] text-nowrap mr-1">{doctorTitle(doctor?.name)}</p>
|
||||
</div>
|
||||
</CustomLoading>
|
||||
<div className="flex lg:hidden">
|
||||
|
||||
@@ -4,6 +4,7 @@ import DoctorAvatar from "@/app/component/DoctorAvatar";
|
||||
import QrImg from "./QrImg";
|
||||
import SiteLogo from "./SiteLogo";
|
||||
import { getStateInfoClient } from "@/lib/getStateInfoClient";
|
||||
import { doctorTitle } from "@/helper";
|
||||
|
||||
import StarDI from "@/components/icons/StarDI";
|
||||
|
||||
@@ -83,7 +84,7 @@ function PosterLight({ data, onQrReady }) {
|
||||
</div>
|
||||
|
||||
<h1 className="mt-[28px] text-[#12365C] text-[48px] font-extrabold leading-tight">
|
||||
{data?.name}
|
||||
{doctorTitle(data?.name)}
|
||||
</h1>
|
||||
|
||||
<div className="w-full flex flex-wrap justify-center gap-[10px] mt-[16px]">
|
||||
|
||||
@@ -4,6 +4,7 @@ import DoctorAvatar from "@/app/component/DoctorAvatar";
|
||||
import QrImg from "./QrImg";
|
||||
import SiteLogoBase from "./SiteLogo";
|
||||
import { getStateInfoClient } from "@/lib/getStateInfoClient";
|
||||
import { doctorTitle } from "@/helper";
|
||||
|
||||
import StarDI from "@/components/icons/StarDI";
|
||||
import ClipBoard from "@/components/icons/ClipBoard";
|
||||
@@ -124,7 +125,7 @@ function Poster({ data, onQrReady }) {
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<h1 className="text-white text-[46px] font-extrabold leading-tight">
|
||||
{data?.name}
|
||||
{doctorTitle(data?.name)}
|
||||
</h1>
|
||||
<div className="flex flex-wrap gap-[10px] mt-[16px]">
|
||||
{specialties.map((s, i) => (
|
||||
|
||||
Reference in New Issue
Block a user