diff --git a/package.json b/package.json index 528c967..d05b126 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", + "dev": "cross-env NODE_OPTIONS='--inspect' next dev", "build": "next build", "start": "next start", "lint": "next lint", @@ -26,6 +26,7 @@ }, "devDependencies": { "@eslint/eslintrc": "^3", + "cross-env": "^7.0.3", "eslint": "^9", "eslint-config-next": "15.1.6", "postcss": "^8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adac5d0..5342bda 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,9 @@ devDependencies: '@eslint/eslintrc': specifier: ^3 version: 3.2.0 + cross-env: + specifier: ^7.0.3 + version: 7.0.3 eslint: specifier: ^9 version: 9.20.1 @@ -1049,6 +1052,14 @@ packages: resolution: {integrity: sha512-f7xEhX0awl4NOElHulrl4XRfKoNH3rB+qfNSZZyjSZhaAoUk6elvhH+MNxMmlmuUJ2/QNTWPSA7U4mNtIAKljQ==} 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: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} diff --git a/src/app/[locale]/layout.jsx b/src/app/[locale]/layout.jsx index eed937f..69d99f4 100644 --- a/src/app/[locale]/layout.jsx +++ b/src/app/[locale]/layout.jsx @@ -48,7 +48,7 @@ const fetchNavbarItems = async () => { // app/[locale]/page.js export const generateMetadata = async ({ params }) => { - const { locale } = params; + const { locale } = await params const t = await getMessages(locale) // Define titles and descriptions for each locale diff --git a/src/app/[locale]/products/[category]/[slug]/page.jsx b/src/app/[locale]/products/[category]/[slug]/page.jsx index 9bd600b..6b23e63 100644 --- a/src/app/[locale]/products/[category]/[slug]/page.jsx +++ b/src/app/[locale]/products/[category]/[slug]/page.jsx @@ -89,7 +89,8 @@ const getProduct = async (slug) => { }; export default async function ProductPage({ params }) { - const product = await getProduct(params.slug); + const { slug } = await params + const product = await getProduct(slug); if (!product) { notFound(); @@ -110,15 +111,26 @@ export default async function ProductPage({ params }) { - - - {product.category.title} - - - - {product.brand.title} - + { + product?.category?.slug && + <> + + + + {product.category.title} + + + } + { + product?.brand?.slug && + <> + + + {product.brand.title} + + + } {product.title} @@ -132,7 +144,11 @@ export default async function ProductPage({ params }) { category={product.category} summery={product.summery} /> - + { + product.brand && ( + + ) + } diff --git a/src/components/Carousel/ProductCarousel.jsx b/src/components/Carousel/ProductCarousel.jsx index 7c264bd..a0fba7c 100644 --- a/src/components/Carousel/ProductCarousel.jsx +++ b/src/components/Carousel/ProductCarousel.jsx @@ -30,7 +30,7 @@ export default function ProductCarousel({ title, subtitle, products, showMoreLin }, [emblaApi]) return ( -
+
@@ -45,13 +45,13 @@ export default function ProductCarousel({ title, subtitle, products, showMoreLin
-
+
{products.map((product) => (
@@ -61,18 +61,18 @@ export default function ProductCarousel({ title, subtitle, products, showMoreLin
diff --git a/src/components/NavBar/index.jsx b/src/components/NavBar/index.jsx index 7ae08c0..78f3d5f 100644 --- a/src/components/NavBar/index.jsx +++ b/src/components/NavBar/index.jsx @@ -125,6 +125,7 @@ const Navbar = ({ items }) => { > diff --git a/src/i18n/routing.js b/src/i18n/routing.js index 1eca3ac..1adc6b2 100644 --- a/src/i18n/routing.js +++ b/src/i18n/routing.js @@ -6,7 +6,7 @@ export const routing = defineRouting({ locales: ["en", "ar-OM"], defaultLocale: "en", localePrefix: "as-needed", - localeDetection: false, + localeDetection: true, }); // Lightweight wrappers around Next.js' navigation APIs diff --git a/src/view/Landing/components/Footer.jsx b/src/view/Landing/components/Footer.jsx index 879c41e..c1d6347 100644 --- a/src/view/Landing/components/Footer.jsx +++ b/src/view/Landing/components/Footer.jsx @@ -28,7 +28,7 @@ const Footer = () => {
*/} -
+

@@ -37,7 +37,7 @@ const Footer = () => {

- +

@@ -45,7 +45,7 @@ const Footer = () => {

- +

@@ -59,7 +59,7 @@ const Footer = () => {

-

+

© 2025. All rights reserved.
Advanced Horizon Services LLC

diff --git a/src/view/Landing/components/Sides.jsx b/src/view/Landing/components/Sides.jsx index ffe561a..4896e9c 100644 --- a/src/view/Landing/components/Sides.jsx +++ b/src/view/Landing/components/Sides.jsx @@ -21,7 +21,7 @@ const Sides = () => {

{t("fmcg.subtitle")}

-

+

{t("fmcg.description")}

@@ -35,7 +35,7 @@ const Sides = () => {

{t("construction.subtitle")}

-

+

{t("construction.description")}