@@ -74,108 +85,52 @@ function ProductPageContent({ params }: ProductPageProps) {
await checkout(getCheckoutItems(), { successUrl: currentUrl.toString() });
}, [cartItems, checkout, getCheckoutItems]);
- if (isLoading) {
+ const MainContent = () => {
+ if (isLoading) {
+ return (
+
+ Loading product...
+
+ )
+ }
+ if (!product) {
+ return (
+
+
+
Product not found
+
+
+
+ );
+ }
return (
-
-
-
- setCartOpen(true) }}
- />
-
-
- Loading product...
-
-
-
-
- );
- }
-
- if (!product) {
- return (
-
-
-
- setCartOpen(true) }}
- />
-
-
-
-
Product not found
-
-
-
-
-
-
- );
+
+
0 ? variants : undefined}
+ quantity={quantityVariant}
+ ribbon={meta.ribbon}
+ inventoryStatus={meta.inventoryStatus}
+ inventoryQuantity={meta.inventoryQuantity}
+ sku={meta.sku}
+ buttons={[
+ { text: "Add To Cart", onClick: handleAddToCart },
+ { text: "Buy Now", onClick: handleBuyNow },
+ ]}
+ />
+
+ )
}
return (
@@ -191,69 +146,46 @@ function ProductPageContent({ params }: ProductPageProps) {
secondaryButtonStyle="layered"
headingFontWeight="extrabold"
>
-
-
- setCartOpen(true) }}
- />
-
-
-
0 ? variants : undefined}
- quantity={quantityVariant}
- ribbon={meta.ribbon}
- inventoryStatus={meta.inventoryStatus}
- inventoryQuantity={meta.inventoryQuantity}
- sku={meta.sku}
- buttons={[
- { text: "Add To Cart", onClick: handleAddToCart },
- { text: "Buy Now", onClick: handleBuyNow },
- ]}
- />
-
-
-
setCartOpen(false)}
- items={cartItems}
- onQuantityChange={updateQuantity}
- onRemove={removeItem}
- total={`$${cartTotal}`}
- buttons={[
- {
- text: isCheckoutLoading ? "Processing..." : "Check Out", onClick: handleCheckout,
- },
- ]}
- />
-
-
-
+
+ setCartOpen(true) }}
+ />
+
+
+
+
setCartOpen(false)}
+ items={cartItems}
+ onQuantityChange={updateQuantity}
+ onRemove={removeItem}
+ total={`$${cartTotal}`}
+ buttons={[
+ {
+ text: isCheckoutLoading ? "Processing..." : "Check Out", onClick: handleCheckout,
+ },
+ ]}
+ />
+
+
);
}
diff --git a/src/app/shop/page.tsx b/src/app/shop/page.tsx
index 6e07b07..7170f3b 100644
--- a/src/app/shop/page.tsx
+++ b/src/app/shop/page.tsx
@@ -1,13 +1,22 @@
"use client";
import { Suspense } from "react";
-import ReactLenis from "lenis/react";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
+import Link from 'next/link';
import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay';
import FooterMedia from '@/components/sections/footer/FooterMedia';
import ProductCatalog from "@/components/ecommerce/productCatalog/ProductCatalog";
import { useProductCatalog } from "@/hooks/useProductCatalog";
+const navItems = [
+ { name: "Home", id: "/" },
+ { name: "About", id: "/#about" },
+ { name: "Features", id: "/#features" },
+ { name: "Testimonials", id: "/#testimonials" },
+ { name: "FAQ", id: "/#faq" },
+ { name: "Contact", id: "/#contact" },
+];
+
function ShopPageContent() {
const {
products,
@@ -17,54 +26,6 @@ function ShopPageContent() {
filters,
} = useProductCatalog({ basePath: "/shop" });
- if (isLoading) {
- return (
-
-
-
- { } }}
- />
-
-
- Loading products...
-
-
-
-
- );
- }
-
return (
-
-
- { } }}
- />
-
+
+ { } }}
+ />
+
+ {isLoading ? (
+
+ Loading products...
+
+ ) : (
-
-
+ )}
+
);
}