Fix product links, equalize card heights, and switch to IRANYekan

- Resolve product cards from group endpoints (store-specials,
  brand-groups) that only return a productId, not a slug, via a new
  /products/id/[id] route backed by GET /products/by-id/{id} — clicking
  these was previously falling back to a name search instead of the
  detail page.
- Derive discount price/percent generically in normalizeProduct so any
  source with real old/new prices shows it, even without an explicit
  discount field from the API.
- Product cards and the detail page buy-box: show the discount badge
  beside the old (struck-through) price, current price alone on its
  own line, matching the reference design.
- Equalize product card heights within a carousel row (Swiper's own
  CSS doesn't stretch slides to the tallest sibling in slidesPerView:
  "auto" + freeMode mode) so the add-to-cart button lines up across
  cards regardless of whether a card has a discount line.
- Featured categories: 110px images with no border/radius, matching
  the site's other category card treatment.
- Replace Vazirmatn with the client's IRANYekan font files — light
  weight for body text, bold weight for headings only.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
amirhosein.ashourloo
2026-08-23 09:50:56 +03:30
co-authored by Claude Sonnet 5
parent 83809815c1
commit c2552af079
11 changed files with 158 additions and 52 deletions
+14 -6
View File
@@ -1,15 +1,23 @@
import type { Metadata } from "next";
import { Vazirmatn, Syne } from "next/font/google";
import { Syne } from "next/font/google";
import localFont from "next/font/local";
import "./globals.css";
import { TopBar } from "@/components/home/TopBar";
import { Header } from "@/components/home/Header";
import { Footer } from "@/components/home/Footer";
import { getBusinessInfo, getCategories, getCategoryTree } from "@/lib/meshkee";
const vazirmatn = Vazirmatn({
variable: "--font-vazirmatn",
subsets: ["arabic", "latin"],
weight: ["400", "500", "600", "700"],
// Body text — headings use the bold weight instead, see globals.css.
const iranyekan = localFont({
variable: "--font-iranyekan",
src: "../../public/fonts/iranyekanweblightfanum.woff",
weight: "400",
});
const iranyekanBold = localFont({
variable: "--font-iranyekan-bold",
src: "../../public/fonts/iranyekanwebboldfanum.woff",
weight: "700",
});
const syne = Syne({
@@ -34,7 +42,7 @@ export default async function RootLayout({ children }: LayoutProps<"/">) {
<html
lang="fa"
dir="rtl"
className={`${vazirmatn.variable} ${syne.variable} h-full antialiased`}
className={`${iranyekan.variable} ${iranyekanBold.variable} ${syne.variable} h-full antialiased`}
>
<body className="min-h-full flex flex-col">
<TopBar />