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:
hamed
2026-08-08 21:06:48 +03:30
parent e8a073cae6
commit 9cfbd2e002
18 changed files with 704 additions and 145 deletions
+3 -1
View File
@@ -10,8 +10,10 @@ function Item({ data, idx, loading }) {
return (
<li className="flex w-full relative items-start justify-start gap-[8px] py-[12px]">
{/* CustomLoading ظرف نمی‌سازد، پس فرزند مستقیمِ فلکس همین لینک است؛
بدون shrink-0 تیتر بلند عرض عکس را می‌بلعد و ارتفاعش ثابت می‌ماند. */}
<CustomLoading width={80} height={72} loading={loading}>
<Link href={`/blog/${data.uuid}`}>
<Link href={`/blog/${data.uuid}`} className="block shrink-0">
<img
className=" w-[64px] sm:w-[73px] md:w-[85px] lg:w-[97px] h-[56px] sm:h-[64px] md:h-[75px] lg:h-[88px] rounded-[8px] overflow-hidden object-cover "
src={cover}
@@ -0,0 +1,26 @@
import { describe, expect, it } from "vitest";
import { render, screen } from "@testing-library/react";
import Item from "@/components/blog/relatedContent/Item";
const DATA = {
uuid: "8f1c0f2e-0000-4000-8000-000000000001",
title: "تیتری که بسیار بلند است و باید ستون متن را پر کند بدون آنکه عکس را باریک کند",
created: 1750000000,
};
describe("آیتم مطالب مرتبط", () => {
it("ظرف عکس در فلکس فشرده نمی‌شود", () => {
render(<Item data={DATA} idx={0} loading={false} />);
const image = screen.getByRole("img", { name: DATA.title });
// jsdom چیدمان را اندازه نمی‌گیرد؛ آنچه قابل تست است همین قرارداد کلاس است.
expect(image.closest("a")).toHaveClass("shrink-0");
});
it("ستون متن اجازهٔ کوچک شدن دارد تا سرریز نکند", () => {
const { container } = render(<Item data={DATA} idx={0} loading={false} />);
expect(container.querySelector("li > div")).toHaveClass("min-w-0");
});
});