Amir Hossein Moghiseh 2025-02-22 22:59:55 +03:30
parent c7f9024cef
commit 6c954f5336
9 changed files with 55 additions and 26 deletions

View File

@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "cross-env NODE_OPTIONS='--inspect' next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
@ -26,6 +26,7 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3", "@eslint/eslintrc": "^3",
"cross-env": "^7.0.3",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "15.1.6", "eslint-config-next": "15.1.6",
"postcss": "^8", "postcss": "^8",

View File

@ -49,6 +49,9 @@ devDependencies:
'@eslint/eslintrc': '@eslint/eslintrc':
specifier: ^3 specifier: ^3
version: 3.2.0 version: 3.2.0
cross-env:
specifier: ^7.0.3
version: 7.0.3
eslint: eslint:
specifier: ^9 specifier: ^9
version: 9.20.1 version: 9.20.1
@ -1049,6 +1052,14 @@ packages:
resolution: {integrity: sha512-f7xEhX0awl4NOElHulrl4XRfKoNH3rB+qfNSZZyjSZhaAoUk6elvhH+MNxMmlmuUJ2/QNTWPSA7U4mNtIAKljQ==} resolution: {integrity: sha512-f7xEhX0awl4NOElHulrl4XRfKoNH3rB+qfNSZZyjSZhaAoUk6elvhH+MNxMmlmuUJ2/QNTWPSA7U4mNtIAKljQ==}
dev: false dev: false
/cross-env@7.0.3:
resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==}
engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
hasBin: true
dependencies:
cross-spawn: 7.0.6
dev: true
/cross-spawn@7.0.6: /cross-spawn@7.0.6:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'} engines: {node: '>= 8'}

View File

@ -48,7 +48,7 @@ const fetchNavbarItems = async () => {
// app/[locale]/page.js // app/[locale]/page.js
export const generateMetadata = async ({ params }) => { export const generateMetadata = async ({ params }) => {
const { locale } = params; const { locale } = await params
const t = await getMessages(locale) const t = await getMessages(locale)
// Define titles and descriptions for each locale // Define titles and descriptions for each locale

View File

@ -89,7 +89,8 @@ const getProduct = async (slug) => {
}; };
export default async function ProductPage({ params }) { export default async function ProductPage({ params }) {
const product = await getProduct(params.slug); const { slug } = await params
const product = await getProduct(slug);
if (!product) { if (!product) {
notFound(); notFound();
@ -110,15 +111,26 @@ export default async function ProductPage({ params }) {
<Home /> <Home />
</Link> </Link>
<ChevronRight className={`size-4 ${locale !== "en" && "rotate-180"} `} />
<Link href={`/products/${product.category.slug}`} className=" underline">
{product.category.title} {
</Link> product?.category?.slug &&
<ChevronRight className={`size-4 ${locale !== "en" && "rotate-180"} `} /> <>
<Link href={`/products/${product.brand.slug}`} className=" underline"> <ChevronRight className={`size-4 ${locale !== "en" && "rotate-180"} `} />
{product.brand.title} <Link href={`/products/${product.category.slug}`} className=" underline">
</Link>
{product.category.title}
</Link>
</>
}
{
product?.brand?.slug &&
<>
<ChevronRight className={`size-4 ${locale !== "en" && "rotate-180"} `} />
<Link href={`/products/${product.brand.slug}`} className=" underline">
{product.brand.title}
</Link>
</>
}
<ChevronRight className={`size-4 ${locale !== "en" && "rotate-180"} `} /> <ChevronRight className={`size-4 ${locale !== "en" && "rotate-180"} `} />
<span>{product.title}</span> <span>{product.title}</span>
</div> </div>
@ -132,7 +144,11 @@ export default async function ProductPage({ params }) {
category={product.category} category={product.category}
summery={product.summery} summery={product.summery}
/> />
<BrandInfo brand={product.brand} /> {
product.brand && (
<BrandInfo brand={product.brand} />
)
}
</div> </div>
</div> </div>

View File

@ -30,7 +30,7 @@ export default function ProductCarousel({ title, subtitle, products, showMoreLin
}, [emblaApi]) }, [emblaApi])
return ( return (
<section className="py-12 max-w-screen-xlmx-auto " > <section className="py-12 max-w-screen-xl mx-auto h-fit" >
<div className="flex sm:justify-between flex-col sm:flex-row pb-4 items-center"> <div className="flex sm:justify-between flex-col sm:flex-row pb-4 items-center">
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
@ -45,13 +45,13 @@ export default function ProductCarousel({ title, subtitle, products, showMoreLin
</Link> </Link>
</div> </div>
<div className="relative"> <div className="relative h-fit">
<div className="overflow-hidden" ref={emblaRef} > <div className="overflow-hidden" ref={emblaRef} >
<div className="flex"> <div className="flex">
{products.map((product) => ( {products.map((product) => (
<div <div
key={product.id} key={product.id}
className="flex-[0_0_100%] min-w-0 sm:flex-[0_0_50%] md:flex-[0_0_33.33%] lg:flex-[0_0_25%] pl-4" className="flex-[0_0_100%] min-w-0 sm:flex-[0_0_50%] md:flex-[0_0_33.33%] lg:flex-[0_0_25%] pl-4 my-2"
> >
<CardNormal product={product} priority={true} /> <CardNormal product={product} priority={true} />
</div> </div>
@ -61,18 +61,18 @@ export default function ProductCarousel({ title, subtitle, products, showMoreLin
<button <button
variant="outline" variant="outline"
size="icon" size="icon"
className="absolute top-1/2 left-4 transform -translate-y-1/2 bg-gray-200 rounded-full size-4" className="absolute top-1/2 left-4 transform -translate-y-1/2 bg-gray-200 rounded-full size-10 border border-white flex flex-col items-center justify-center"
onClick={scrollPrev} onClick={scrollPrev}
> >
<ChevronLeft className="h-4 w-4" /> <ChevronLeft className="size-10" />
</button> </button>
<button <button
variant="outline" variant="outline"
size="icon" size="icon"
className="absolute top-1/2 right-4 transform -translate-y-1/2 bg-gray-200 rounded-full size-4" className="absolute top-1/2 right-4 transform -translate-y-1/2 bg-gray-200 rounded-full size-10 border border-white flex flex-col items-center justify-center"
onClick={scrollNext} onClick={scrollNext}
> >
<ChevronRight className="h-4 w-4" /> <ChevronRight className="size-10" />
</button> </button>
</div> </div>

View File

@ -125,6 +125,7 @@ const Navbar = ({ items }) => {
> >
<Link <Link
href={`${item.link}`} href={`${item.link}`}
className={` whitespace-nowrap ${isScrolled ? "text-black" : "text-white"} ${theme == 1 ? "text-sm !text-black" : " " className={` whitespace-nowrap ${isScrolled ? "text-black" : "text-white"} ${theme == 1 ? "text-sm !text-black" : " "
}`} }`}
> >

View File

@ -6,7 +6,7 @@ export const routing = defineRouting({
locales: ["en", "ar-OM"], locales: ["en", "ar-OM"],
defaultLocale: "en", defaultLocale: "en",
localePrefix: "as-needed", localePrefix: "as-needed",
localeDetection: false, localeDetection: true,
}); });
// Lightweight wrappers around Next.js' navigation APIs // Lightweight wrappers around Next.js' navigation APIs

View File

@ -28,7 +28,7 @@ const Footer = () => {
</div> </div>
</div> </div>
</div> */} </div> */}
<div className="flex flex-col gap-4 items-center text-sm text-gray-200 justify-center pb-20"> <div className="flex flex-col gap-4 items-center text-sm text-gray-200 justify-center pb-20" >
<div className="flex gap-2"> <div className="flex gap-2">
<MapPinHouse size={20} /> <MapPinHouse size={20} />
<p> <p>
@ -37,7 +37,7 @@ const Footer = () => {
</p> </p>
</div> </div>
<Link href={"mailto:info@adhorizonintl.com"} target="_blank" className="flex gap-2"> <Link href={"mailto:info@adhorizonintl.com"} dir="ltr" target="_blank" className="flex gap-2">
<Mail size={20} /> <Mail size={20} />
<p> <p>
@ -45,7 +45,7 @@ const Footer = () => {
</p> </p>
</Link> </Link>
<Link href={"tel:+96824289888"} target="_blank" className="flex gap-2"> <Link href={"tel:+96824289888"} dir="ltr" target="_blank" className="flex gap-2">
<PhoneCall size={20} /> <PhoneCall size={20} />
<p> <p>
@ -59,7 +59,7 @@ const Footer = () => {
<div className="w-full mb-5"> <div className="w-full mb-5">
<Image src={logo} className="w-[90px] mx-auto" /> <Image src={logo} className="w-[90px] mx-auto" />
</div> </div>
<p className="mb-0 text-sm text-gray-200 w-full text-center opacity-30 "> <p className="mb-0 text-sm text-gray-200 w-full text-center opacity-30 " dir="ltr">
© 2025. All rights reserved. <br /> © 2025. All rights reserved. <br />
Advanced Horizon Services LLC Advanced Horizon Services LLC
</p> </p>

View File

@ -21,7 +21,7 @@ const Sides = () => {
<p className="text-muted-foreground">{t("fmcg.subtitle")}</p> <p className="text-muted-foreground">{t("fmcg.subtitle")}</p>
</div> </div>
<div className="mt-4"> <div className="mt-4">
<p className="text-muted-foreground text-base"> <p className="text-muted-foreground text-base text-justify">
{t("fmcg.description")} {t("fmcg.description")}
</p> </p>
</div> </div>
@ -35,7 +35,7 @@ const Sides = () => {
<p className="text-muted-foreground">{t("construction.subtitle")}</p> <p className="text-muted-foreground">{t("construction.subtitle")}</p>
</div> </div>
<div className="mt-4"> <div className="mt-4">
<p className="text-muted-foreground text-base"> <p className="text-muted-foreground text-base text-justify">
{t("construction.description")} {t("construction.description")}
</p> </p>
</div> </div>