feat: Revert homepage changes, fix Persian slug 404, and make various article and about us adjustments
- Removed the newly added city-focused section from the homepage. - Fixed 404 error for Persian slugs in specialties and blog pages by implementing a decode helper. - Removed the "مخصوص شهر" label from article headers. - Linked article tags to their respective filter pages. - Adjusted related content images to prevent distortion. - Added a section in the "About Us" page for physician registration guidance. - Updated the logo in the "About Us" header to the correct version. - Added tests for the new functionality and ensured existing tests are updated accordingly.
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import SiteLogo from "@/components/common/SiteLogo";
|
||||
|
||||
function Head({ siteName, slogan }) {
|
||||
function Head({ siteName, slogan, city }) {
|
||||
return (
|
||||
<div className="bg-[#5559C2] rounded-none md:rounded-lg w-full py-[24px] flex flex-col items-center justify-center gap-[13px] md:gap-[16px]">
|
||||
<Image
|
||||
src="/assets/images/logo-2.png"
|
||||
height={46}
|
||||
width={46}
|
||||
alt="logo"
|
||||
/>
|
||||
{/* رنگ پیشفرض لوگو #5559CE است و روی همین پسزمینه گم میشود؛ نسخهٔ روشن. */}
|
||||
<SiteLogo city={city} stroke="#FAFAFA" className="w-[46px] h-[46px]" />
|
||||
<h1 className="text-[#FAFAFA] text-[16px] sm:text-[18px] md:text-[22px] lg:text-[24px] font-bold">
|
||||
درباره {siteName}
|
||||
</h1>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import Head from "@/components/aboutUs/Head";
|
||||
|
||||
const CITY = { name: "یاسوج", site_name: "یاسوج نوبت", logo_url: null };
|
||||
|
||||
describe("سربرگ درباره ما", () => {
|
||||
it("شهر بدون logo_url لوگوی درونخطی با رنگ روشن میگیرد", () => {
|
||||
const { container } = render(
|
||||
<Head siteName={CITY.site_name} slogan="کنار شما" city={CITY} />
|
||||
);
|
||||
|
||||
const path = container.querySelector("svg path");
|
||||
|
||||
// پسزمینهٔ هدر #5559C2 است؛ رنگ پیشفرض لوگو روی آن دیده نمیشود.
|
||||
expect(path).toHaveAttribute("stroke", "#FAFAFA");
|
||||
});
|
||||
|
||||
it("شهر دارای logo_url همان تصویر را نشان میدهد", () => {
|
||||
render(
|
||||
<Head
|
||||
siteName={CITY.site_name}
|
||||
city={{ ...CITY, logo_url: "https://cdn.test/logo.png" }}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.getByRole("img", { name: "logo" })).toHaveAttribute(
|
||||
"src",
|
||||
"https://cdn.test/logo.png"
|
||||
);
|
||||
});
|
||||
|
||||
it("لوگوی قدیمی logo-2.png دیگر رندر نمیشود", () => {
|
||||
const { container } = render(<Head siteName={CITY.site_name} city={CITY} />);
|
||||
|
||||
expect(container.innerHTML).not.toContain("logo-2");
|
||||
});
|
||||
|
||||
it("شعار نداشتن، سربرگ را نمیشکند", () => {
|
||||
render(<Head siteName={CITY.site_name} city={CITY} />);
|
||||
|
||||
expect(
|
||||
screen.getByRole("heading", { name: `درباره ${CITY.site_name}` })
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -11,7 +11,7 @@ async function AboutUsPage() {
|
||||
<div
|
||||
className=" pt-[24px] sm:pt-[56px] md:pt-[88px] lg:pt-[120px] mt-[56px] px-0 md:px-[80px] lg:px-[108px] "
|
||||
>
|
||||
<Head siteName={siteName} slogan={slogan} />
|
||||
<Head siteName={siteName} slogan={slogan} city={matchedCity} />
|
||||
<div
|
||||
className=" text-[#525252] text-[16px] font-normal mt-[32px] leading-[28px] md:leading-[32px] lg:leading-[40px] px-[16px] sm:px-[52px] md:px-[15%] text-justify md:text-center flex flex-col gap-[16px] "
|
||||
>
|
||||
@@ -27,6 +27,22 @@ async function AboutUsPage() {
|
||||
نوبت خود را ثبت کنید. هدف ما کاهش زمان انتظار و ایجاد ارتباط مؤثر میان
|
||||
بیماران، پزشکان و کلینیکهاست.
|
||||
</p>
|
||||
<p>
|
||||
اگر پزشک هستید و میخواهید در {siteName} نوبتدهی آنلاین داشته باشید،
|
||||
ثبتنام از طریق سامانهی کلینیکپرو انجام میشود. حساب مطب خود را
|
||||
آنجا بسازید؛ پس از تأیید، پروفایل و برنامهی نوبتدهی شما روی{" "}
|
||||
{siteName} نمایش داده میشود.
|
||||
</p>
|
||||
<div className="flex justify-center mt-[8px]">
|
||||
<a
|
||||
href="https://clinic-pro.ir/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="px-[24px] py-[12px] rounded-lg bg-[#5559CE] border border-[#5559CE] text-[#FFF] text-[14px] md:text-[16px] font-medium hover:bg-[#FFF] hover:text-[#5559CE] transition-all duration-500"
|
||||
>
|
||||
ثبتنام پزشکان در کلینیکپرو
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<Services />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user