feat: remove unused intro prop and related rendering in DoctorsPage component
This commit is contained in:
@@ -5,8 +5,6 @@ import { getStateInfo } from "@/lib/getStateInfo";
|
|||||||
import { fetchReq } from "@/lib/req";
|
import { fetchReq } from "@/lib/req";
|
||||||
import { isNextRedirectError } from "@/lib/maintenance";
|
import { isNextRedirectError } from "@/lib/maintenance";
|
||||||
import { listingRobots } from "@/lib/listingRobots";
|
import { listingRobots } from "@/lib/listingRobots";
|
||||||
import { buildDoctorsIntro } from "@/lib/listingIntro";
|
|
||||||
import { resolveCityDisplayName } from "@/lib/domainHelpers";
|
|
||||||
|
|
||||||
export async function generateMetadata({ searchParams }) {
|
export async function generateMetadata({ searchParams }) {
|
||||||
const awaitedParams = await searchParams;
|
const awaitedParams = await searchParams;
|
||||||
@@ -77,13 +75,6 @@ async function Doctors({ searchParams }) {
|
|||||||
params={searchParams}
|
params={searchParams}
|
||||||
matchedCity={matchedCity}
|
matchedCity={matchedCity}
|
||||||
matchedState={matchedState}
|
matchedState={matchedState}
|
||||||
// متن مقدمه سمت سرور ساخته میشود تا در HTML اولیه باشد و خزنده ببیندش.
|
|
||||||
// buildDoctorsIntro از قبل نوشته و تست شده بود اما هیچجا رندر نمیشد، پس
|
|
||||||
// این صفحه روی هر ۳۵ دامنه محتوای یکسان داشت.
|
|
||||||
intro={buildDoctorsIntro(
|
|
||||||
resolveCityDisplayName(isRoot ? null : matchedCity),
|
|
||||||
doctors?.meta?.totalRecords
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import states from "@/data/state.json";
|
|||||||
import cities from "@/data/city.json";
|
import cities from "@/data/city.json";
|
||||||
import { isRootCity } from "@/lib/rootCity";
|
import { isRootCity } from "@/lib/rootCity";
|
||||||
|
|
||||||
function DoctorsPage({ matchedCity, matchedState, list, intro }) {
|
function DoctorsPage({ matchedCity, matchedState, list }) {
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const [page, setPage] = useState(list?.meta?.currentPage || 1);
|
const [page, setPage] = useState(list?.meta?.currentPage || 1);
|
||||||
const [doctors, setDoctors] = useState(list?.data);
|
const [doctors, setDoctors] = useState(list?.data);
|
||||||
@@ -60,11 +60,6 @@ function DoctorsPage({ matchedCity, matchedState, list, intro }) {
|
|||||||
matchedCity={matchedCity}
|
matchedCity={matchedCity}
|
||||||
matchedState={matchedState}
|
matchedState={matchedState}
|
||||||
/>
|
/>
|
||||||
{intro && (
|
|
||||||
<p className="text-[#525252] text-[14px] md:text-[16px] font-normal leading-8 mt-[24px] text-justify">
|
|
||||||
{intro}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
<ListDoctors
|
<ListDoctors
|
||||||
limit={12}
|
limit={12}
|
||||||
data={list}
|
data={list}
|
||||||
|
|||||||
Reference in New Issue
Block a user