Add Arjmand Pharmacy Next.js homepage.
Initial RTL storefront with header, slider, product sections, and local image assets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import Link from "next/link";
|
||||
import { Instagram, MapPin, Phone, Send } from "lucide-react";
|
||||
import { Container } from "@/components/Container";
|
||||
import { Placeholder } from "@/components/Placeholder";
|
||||
import { footerLinks, site } from "@/lib/data";
|
||||
|
||||
export function Footer({ logoSrc }: { logoSrc: string }) {
|
||||
return (
|
||||
<footer id="contact" className="mt-6 bg-navy-deep text-white">
|
||||
<Container className="grid gap-10 py-12 sm:grid-cols-2 lg:grid-cols-4">
|
||||
<div>
|
||||
<Placeholder src={logoSrc} alt={site.name} className="h-10 w-auto object-contain" />
|
||||
<p className="mt-4 text-[13px] leading-7 text-white/75">{site.tagline}. مشاوره دارویی، اصالت کالا و ارسال سریع از سالاریه قم.</p>
|
||||
<div className="mt-5 flex gap-2">
|
||||
<a href={site.instagram} className="grid size-9 place-items-center rounded-lg bg-white/10" aria-label="اینستاگرام">
|
||||
<Instagram className="size-4" />
|
||||
</a>
|
||||
<a href={site.eitaa} className="grid size-9 place-items-center rounded-lg bg-white/10" aria-label="ایتا">
|
||||
<Send className="size-4" />
|
||||
</a>
|
||||
<a href={site.whatsapp} className="grid size-9 place-items-center rounded-lg bg-white/10" aria-label="واتساپ">
|
||||
<Phone className="size-4" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 className="mb-4 text-[14px] font-bold">فروشگاه</h3>
|
||||
<ul className="space-y-2.5 text-[13px] text-white/75">
|
||||
{footerLinks.shop.map((item) => (
|
||||
<li key={item.title}>
|
||||
<Link href={item.href} className="hover:text-white">
|
||||
{item.title}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 className="mb-4 text-[14px] font-bold">صفحات</h3>
|
||||
<ul className="space-y-2.5 text-[13px] text-white/75">
|
||||
{footerLinks.pages.map((item) => (
|
||||
<li key={item.title}>
|
||||
<Link href={item.href} className="hover:text-white">
|
||||
{item.title}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 className="mb-4 text-[14px] font-bold">تماس با ما</h3>
|
||||
<p className="flex items-start gap-2 text-[13px] leading-7 text-white/75">
|
||||
<MapPin className="mt-1 size-4 shrink-0" />
|
||||
{site.address}
|
||||
</p>
|
||||
<a href={site.phoneHref} className="font-latin mt-3 flex items-center gap-2 text-[13px] text-white/90" dir="ltr">
|
||||
<Phone className="size-4" />
|
||||
{site.phone}
|
||||
</a>
|
||||
<div className="mt-5 flex gap-3">
|
||||
<span className="overflow-hidden rounded-lg bg-white">
|
||||
<Placeholder src="/placeholders/enamad.svg" className="size-16 object-cover" />
|
||||
</span>
|
||||
<span className="overflow-hidden rounded-lg bg-white">
|
||||
<Placeholder src="/placeholders/samandehi.svg" className="size-16 object-cover" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
<div className="border-t border-white/10">
|
||||
<Container className="flex h-12 items-center justify-center text-[12px] text-white/55">
|
||||
کلیه حقوق این فروشگاه متعلق به {site.name} است.
|
||||
</Container>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import {
|
||||
ChevronDown,
|
||||
Heart,
|
||||
Menu,
|
||||
Search,
|
||||
ShoppingBag,
|
||||
UserRound,
|
||||
X,
|
||||
} from "lucide-react";
|
||||
import { Container } from "@/components/Container";
|
||||
import { Placeholder } from "@/components/Placeholder";
|
||||
import { MegaMenu } from "@/components/layout/MegaMenu";
|
||||
import { categories, navLinks, site } from "@/lib/data";
|
||||
|
||||
export function Header({ logoSrc }: { logoSrc: string }) {
|
||||
const [megaOpen, setMegaOpen] = useState(false);
|
||||
const [mobileOpen, setMobileOpen] = useState(false);
|
||||
const [mobileCats, setMobileCats] = useState(false);
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-40 border-b border-line bg-white">
|
||||
<Container className="flex h-[72px] items-center gap-4">
|
||||
<button
|
||||
type="button"
|
||||
className="grid size-10 place-items-center rounded-xl text-navy lg:hidden"
|
||||
onClick={() => setMobileOpen(true)}
|
||||
aria-label="منو"
|
||||
>
|
||||
<Menu className="size-5" />
|
||||
</button>
|
||||
|
||||
<Link href="/" className="flex h-11 shrink-0 items-center">
|
||||
<Placeholder src={logoSrc} alt={site.name} className="h-11 w-auto object-contain" />
|
||||
</Link>
|
||||
|
||||
<form className="relative hidden min-w-0 flex-1 md:block">
|
||||
<input
|
||||
type="search"
|
||||
placeholder="جستجوی دارو، مکمل و محصولات بهداشتی..."
|
||||
className="h-11 w-full rounded-xl border border-line bg-mist pr-4 pl-11 text-[13px] outline-none transition focus:border-primary focus:bg-white"
|
||||
/>
|
||||
<Search className="pointer-events-none absolute top-1/2 left-3.5 size-4 -translate-y-1/2 text-muted" />
|
||||
</form>
|
||||
|
||||
<div className="ms-auto flex items-center gap-1">
|
||||
<Link
|
||||
href="#"
|
||||
className="hidden items-center gap-2 rounded-xl px-3 py-2 text-[13px] text-ink hover:bg-mist lg:flex"
|
||||
>
|
||||
<UserRound className="size-5 text-navy" />
|
||||
ورود / ثبتنام
|
||||
</Link>
|
||||
<Link href="#" className="grid size-10 place-items-center rounded-xl hover:bg-mist" aria-label="علاقهمندی">
|
||||
<Heart className="size-5 text-navy" />
|
||||
</Link>
|
||||
<Link href="#" className="relative grid size-10 place-items-center rounded-xl hover:bg-mist" aria-label="سبد خرید">
|
||||
<ShoppingBag className="size-5 text-navy" />
|
||||
<span className="absolute top-1.5 left-1.5 grid size-4 place-items-center rounded-full bg-primary text-[10px] text-white">
|
||||
۰
|
||||
</span>
|
||||
</Link>
|
||||
</div>
|
||||
</Container>
|
||||
|
||||
<div className="hidden border-t border-line lg:block">
|
||||
<Container className="flex h-12 items-center gap-1">
|
||||
<div
|
||||
className="relative"
|
||||
onMouseEnter={() => setMegaOpen(true)}
|
||||
onMouseLeave={() => setMegaOpen(false)}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
className="flex h-9 items-center gap-2 rounded-lg bg-navy px-3.5 text-[13px] font-medium text-white"
|
||||
>
|
||||
<Menu className="size-4" />
|
||||
دستهبندیها
|
||||
<ChevronDown className={`size-4 transition ${megaOpen ? "rotate-180" : ""}`} />
|
||||
</button>
|
||||
<MegaMenu open={megaOpen} />
|
||||
</div>
|
||||
|
||||
{navLinks.map((link) => (
|
||||
<Link
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
className="rounded-lg px-3 py-2 text-[13px] text-ink transition hover:bg-sky hover:text-primary"
|
||||
>
|
||||
{link.title}
|
||||
</Link>
|
||||
))}
|
||||
</Container>
|
||||
</div>
|
||||
|
||||
{mobileOpen && (
|
||||
<div className="fixed inset-0 z-50 lg:hidden">
|
||||
<button
|
||||
type="button"
|
||||
className="absolute inset-0 bg-navy/40"
|
||||
aria-label="بستن"
|
||||
onClick={() => setMobileOpen(false)}
|
||||
/>
|
||||
<aside className="absolute inset-y-0 right-0 flex w-[86%] max-w-sm flex-col bg-white">
|
||||
<div className="flex items-center justify-between border-b border-line px-4 py-3">
|
||||
<Placeholder src={logoSrc} alt={site.name} className="h-9 w-auto object-contain" />
|
||||
<button type="button" onClick={() => setMobileOpen(false)} aria-label="بستن">
|
||||
<X className="size-5" />
|
||||
</button>
|
||||
</div>
|
||||
<form className="px-4 pt-4">
|
||||
<input
|
||||
type="search"
|
||||
placeholder="جستجو..."
|
||||
className="h-11 w-full rounded-xl border border-line bg-mist px-3 text-[13px] outline-none"
|
||||
/>
|
||||
</form>
|
||||
<nav className="flex-1 overflow-y-auto px-2 py-3">
|
||||
<button
|
||||
type="button"
|
||||
className="flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-right text-[14px] font-medium text-navy"
|
||||
onClick={() => setMobileCats((v) => !v)}
|
||||
>
|
||||
دستهبندیها
|
||||
<ChevronDown className={`size-4 ${mobileCats ? "rotate-180" : ""}`} />
|
||||
</button>
|
||||
{mobileCats && (
|
||||
<ul className="mb-2 space-y-1 pr-3">
|
||||
{categories.map((cat) => (
|
||||
<li key={cat.id}>
|
||||
<Link href={cat.href} className="block rounded-lg px-3 py-1.5 text-[13px] text-muted">
|
||||
{cat.title}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
{navLinks.map((link) => (
|
||||
<Link
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
className="block rounded-xl px-3 py-2.5 text-[14px]"
|
||||
onClick={() => setMobileOpen(false)}
|
||||
>
|
||||
{link.title}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
</aside>
|
||||
</div>
|
||||
)}
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { categories } from "@/lib/data";
|
||||
import { Placeholder } from "@/components/Placeholder";
|
||||
|
||||
export function MegaMenu({ open }: { open: boolean }) {
|
||||
if (!open) return null;
|
||||
|
||||
return (
|
||||
<div className="absolute top-full right-0 z-50 mt-2 w-[min(920px,calc(100vw-2rem))] rounded-2xl border border-line bg-white p-5 shadow-[0_16px_40px_rgba(0,38,133,0.12)]">
|
||||
<div className="grid grid-cols-2 gap-5 md:grid-cols-4">
|
||||
{categories.map((category) => (
|
||||
<div key={category.id}>
|
||||
<Link
|
||||
href={category.href}
|
||||
className="mb-3 flex items-center gap-2 text-[13.5px] font-semibold text-navy"
|
||||
>
|
||||
<span className="grid size-9 place-items-center overflow-hidden rounded-xl bg-sky">
|
||||
<Placeholder src={category.image} className="size-full object-cover" />
|
||||
</span>
|
||||
{category.title}
|
||||
</Link>
|
||||
<ul className="space-y-1.5 pr-1">
|
||||
{category.children.map((child) => (
|
||||
<li key={child.title}>
|
||||
<Link
|
||||
href={child.href}
|
||||
className="block rounded-lg px-2 py-1 text-[12.5px] text-muted transition hover:bg-sky hover:text-primary"
|
||||
>
|
||||
{child.title}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Headphones, MapPin, Truck } from "lucide-react";
|
||||
import { Container } from "@/components/Container";
|
||||
import { site } from "@/lib/data";
|
||||
|
||||
export function TopBar() {
|
||||
return (
|
||||
<div className="bg-navy text-white">
|
||||
<Container className="flex h-10 items-center justify-between gap-4 text-[12px]">
|
||||
<div className="flex min-w-0 items-center gap-4">
|
||||
<span className="hidden items-center gap-1.5 sm:flex">
|
||||
<Truck className="size-3.5 shrink-0" />
|
||||
ارسال رایگان سفارشهای بالای ۵۰۰ هزار تومان
|
||||
</span>
|
||||
<span className="flex items-center gap-1.5">
|
||||
<Headphones className="size-3.5 shrink-0" />
|
||||
{site.hours}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-4">
|
||||
<span className="hidden items-center gap-1.5 md:flex">
|
||||
<MapPin className="size-3.5" />
|
||||
قم، سالاریه
|
||||
</span>
|
||||
<a href={site.phoneHref} className="font-latin tracking-wide" dir="ltr">
|
||||
{site.phone}
|
||||
</a>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user