Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ba4fbef8b | |||
| a6c066bba9 | |||
| 797dcf6033 | |||
| e1268c5f19 | |||
| b4632da12a | |||
| 31cee5b509 | |||
| e87fa9931d | |||
| ea0e6e79ad | |||
| 5033027a36 | |||
| 72ca4644ca | |||
| 2d84e9113e | |||
| 8d9f3e9f26 | |||
| 52e9668372 | |||
| 9db58c8fa9 | |||
| 8e91479fff | |||
| 5afa8f0023 | |||
| 01c19393f0 | |||
| 9399ea26d9 | |||
| 022e94b543 | |||
| 651de53fad | |||
| 3884f4597f | |||
| 10e33b9c34 | |||
| 906cb350ed | |||
| e677d8740a | |||
| 8b2f01f710 |
@@ -1,20 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import ReactLenis from "lenis/react";
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import { useBlogPosts } from "@/hooks/useBlogPosts";
|
import { useBlogPosts } from "@/hooks/useBlogPosts";
|
||||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||||
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
|
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
|
||||||
|
|
||||||
// Define common navigation items for sub-pages to maintain consistency
|
const standardNavItems = [
|
||||||
const ALL_NAV_ITEMS_SUB_PAGES = [
|
|
||||||
{ name: "Home", id: "/" },
|
{ name: "Home", id: "/" },
|
||||||
{ name: "Products", id: "/products" },
|
{ name: "Products", id: "/products" },
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "Blog", id: "/blog" },
|
|
||||||
{ name: "About", id: "/#about" },
|
{ name: "About", id: "/#about" },
|
||||||
{ name: "Testimonials", id: "/#testimonials" },
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
{ name: "FAQs", id: "/#faqs" }
|
{ name: "FAQs", id: "/#faqs" },
|
||||||
|
{ name: "Contact", id: "/#contact" }
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function BlogPage() {
|
export default function BlogPage() {
|
||||||
@@ -33,36 +30,33 @@ export default function BlogPage() {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="nav" data-section="nav">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={standardNavItems}
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
button={{ text: "Shop Now", href: "/shop" }}
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
buttonClassName="shadow-lg"
|
||||||
buttonClassName="shadow-lg"
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
className="backdrop-blur-sm bg-card/70"
|
||||||
className="backdrop-blur-sm bg-card/70"
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{isLoading ? (
|
||||||
|
<div className="w-full mx-auto py-40 text-center">
|
||||||
|
<p className="text-foreground">Loading posts...</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div id="blog" data-section="blog">
|
||||||
|
<BlogCardThree
|
||||||
|
blogs={posts.map(post => ({ ...post, onBlogClick: () => {} }))}
|
||||||
|
title="Latest Articles"
|
||||||
|
description="Insights and updates from our team"
|
||||||
|
animationType="slide-up"
|
||||||
|
textboxLayout="default"
|
||||||
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
{isLoading ? (
|
|
||||||
<div className="w-content-width mx-auto py-20 text-center">
|
|
||||||
<p className="text-foreground">Loading posts...</p>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div id="blog" data-section="blog">
|
|
||||||
<BlogCardTwo
|
|
||||||
blogs={posts}
|
|
||||||
title="Latest Articles"
|
|
||||||
description="Insights and updates from our team"
|
|
||||||
animationType="slide-up"
|
|
||||||
textboxLayout="default"
|
|
||||||
useInvertedBackground={false}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
1382
src/app/layout.tsx
1382
src/app/layout.tsx
File diff suppressed because it is too large
Load Diff
@@ -10,25 +10,13 @@ import FaqDouble from '@/components/sections/faq/FaqDouble';
|
|||||||
import ContactFaq from '@/components/sections/contact/ContactFaq';
|
import ContactFaq from '@/components/sections/contact/ContactFaq';
|
||||||
import { Handshake, HeartHandshake, MessageSquareText, Sparkles } from "lucide-react";
|
import { Handshake, HeartHandshake, MessageSquareText, Sparkles } from "lucide-react";
|
||||||
|
|
||||||
// Define common navigation items for sub-pages to maintain consistency
|
const standardNavItems = [
|
||||||
const ALL_NAV_ITEMS_SUB_PAGES = [
|
|
||||||
{ name: "Home", id: "/" },
|
{ name: "Home", id: "/" },
|
||||||
{ name: "Products", id: "/products" },
|
{ name: "Products", id: "/products" },
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "Blog", id: "/blog" },
|
|
||||||
{ name: "About", id: "/#about" },
|
{ name: "About", id: "/#about" },
|
||||||
{ name: "Testimonials", id: "/#testimonials" },
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
{ name: "FAQs", id: "/#faqs" }
|
{ name: "FAQs", id: "/#faqs" },
|
||||||
];
|
{ name: "Contact", id: "/#contact" }
|
||||||
|
|
||||||
// Define navigation items specifically for the homepage (no 'Home' link here)
|
|
||||||
const navItemsForHomePage = [
|
|
||||||
{ name: "Products", id: "/products" },
|
|
||||||
{ name: "About", id: "about" },
|
|
||||||
{ name: "Testimonials", id: "testimonials" },
|
|
||||||
{ name: "FAQs", id: "faqs" },
|
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "Blog", id: "/blog" }
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function SitePage() {
|
export default function SitePage() {
|
||||||
@@ -48,8 +36,8 @@ export default function SitePage() {
|
|||||||
<div id="nav" data-section="nav">
|
<div id="nav" data-section="nav">
|
||||||
<NavbarLayoutFloatingInline
|
<NavbarLayoutFloatingInline
|
||||||
brandName="Nano Mango"
|
brandName="Nano Mango"
|
||||||
navItems={navItemsForHomePage}
|
navItems={standardNavItems}
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
button={{ text: "Shop Now", href: "/shop" }}
|
||||||
buttonClassName="shadow-lg"
|
buttonClassName="shadow-lg"
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
className="backdrop-blur-sm bg-card/70"
|
className="backdrop-blur-sm bg-card/70"
|
||||||
@@ -81,8 +69,6 @@ export default function SitePage() {
|
|||||||
titleClassName="font-light text-foreground"
|
titleClassName="font-light text-foreground"
|
||||||
descriptionClassName="text-foreground/70"
|
descriptionClassName="text-foreground/70"
|
||||||
kpiClassName="bg-card/70 backdrop-blur-md border border-accent/20"
|
kpiClassName="bg-card/70 backdrop-blur-md border border-accent/20"
|
||||||
buttonClassName="shadow-md"
|
|
||||||
buttonContainerClassName="flex-col sm:flex-row"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="about" data-section="about">
|
<div id="about" data-section="about">
|
||||||
@@ -93,7 +79,7 @@ export default function SitePage() {
|
|||||||
description="At Nano Mango, we believe every sip tells a story. We're passionate about creating beautiful, functional, and sustainable cups that enhance your daily rituals."
|
description="At Nano Mango, we believe every sip tells a story. We're passionate about creating beautiful, functional, and sustainable cups that enhance your daily rituals."
|
||||||
subdescription="Founded with love, built on quality."
|
subdescription="Founded with love, built on quality."
|
||||||
icon={Handshake}
|
icon={Handshake}
|
||||||
imageSrc="https://img.b2bpic.net/free-photo/medium-shot-smiley-man-doing-pottery_23-2149480255.jpg"
|
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_34my1kGeblbsCcwUUCcjBY9WFkg/uploaded-1766067222836-0qcsw02v.jpg"
|
||||||
imageAlt="Nano Mango store owner smiling and holding a unique cup"
|
imageAlt="Nano Mango store owner smiling and holding a unique cup"
|
||||||
mediaAnimation="opacity"
|
mediaAnimation="opacity"
|
||||||
useInvertedBackground={true}
|
useInvertedBackground={true}
|
||||||
@@ -187,7 +173,6 @@ export default function SitePage() {
|
|||||||
ctaPanelClassName="bg-card shadow-lg"
|
ctaPanelClassName="bg-card shadow-lg"
|
||||||
ctaTitleClassName="font-light"
|
ctaTitleClassName="font-light"
|
||||||
ctaDescriptionClassName="text-foreground/80"
|
ctaDescriptionClassName="text-foreground/80"
|
||||||
ctaButtonClassName="shadow-md"
|
|
||||||
faqsPanelClassName="bg-card shadow-lg"
|
faqsPanelClassName="bg-card shadow-lg"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,66 +1,31 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import ReactLenis from "lenis/react";
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||||
import ProductCatalog from "@/components/ecommerce/productCatalog/ProductCatalog";
|
import ProductCardFour from '@/components/sections/product/ProductCardFour';
|
||||||
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
||||||
|
|
||||||
// Define common navigation items for sub-pages to maintain consistency
|
const standardNavItems = [
|
||||||
const ALL_NAV_ITEMS_SUB_PAGES = [
|
|
||||||
{ name: "Home", id: "/" },
|
{ name: "Home", id: "/" },
|
||||||
{ name: "Products", id: "/products" },
|
{ name: "Products", id: "/products" },
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "Blog", id: "/blog" },
|
|
||||||
{ name: "About", id: "/#about" },
|
{ name: "About", id: "/#about" },
|
||||||
{ name: "Testimonials", id: "/#testimonials" },
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
{ name: "FAQs", id: "/#faqs" }
|
{ name: "FAQs", id: "/#faqs" },
|
||||||
|
{ name: "Contact", id: "/#contact" }
|
||||||
];
|
];
|
||||||
|
|
||||||
function ProductsPageContent() {
|
function ProductsPageContent() {
|
||||||
const {
|
const { products, isLoading } = useProductCatalog({ basePath: "/products" });
|
||||||
products,
|
|
||||||
isLoading,
|
|
||||||
search,
|
|
||||||
setSearch,
|
|
||||||
filters,
|
|
||||||
} = useProductCatalog({ basePath: "/products" });
|
|
||||||
|
|
||||||
if (isLoading) {
|
const mappedProducts = products.map(p => ({
|
||||||
return (
|
id: p.id,
|
||||||
<ThemeProvider
|
name: p.name,
|
||||||
defaultButtonVariant="hover-bubble"
|
price: p.price,
|
||||||
defaultTextAnimation="background-highlight"
|
imageSrc: p.imageSrc,
|
||||||
borderRadius="pill"
|
imageAlt: p.imageAlt || p.name,
|
||||||
contentWidth="mediumSmall"
|
variant: p.category || 'Standard',
|
||||||
sizing="largeSmallSizeMediumTitles"
|
}));
|
||||||
background="circleGradient"
|
|
||||||
cardStyle="solid"
|
|
||||||
primaryButtonStyle="diagonal-gradient"
|
|
||||||
secondaryButtonStyle="solid"
|
|
||||||
headingFontWeight="light"
|
|
||||||
>
|
|
||||||
<ReactLenis root>
|
|
||||||
<div id="nav" data-section="nav">
|
|
||||||
<NavbarLayoutFloatingInline
|
|
||||||
brandName="Nano Mango"
|
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
|
||||||
buttonClassName="shadow-lg"
|
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
|
||||||
className="backdrop-blur-sm bg-card/70"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div id="loading-section" data-section="loading-section">
|
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
|
||||||
<p className="text-foreground">Loading products...</p>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
@@ -75,29 +40,33 @@ function ProductsPageContent() {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="nav" data-section="nav">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={standardNavItems}
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
button={{ text: "Go to Shop", href: "/shop" }}
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
buttonClassName="shadow-lg"
|
||||||
buttonClassName="shadow-lg"
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
className="backdrop-blur-sm bg-card/70"
|
||||||
className="backdrop-blur-sm bg-card/70"
|
/>
|
||||||
/>
|
</div>
|
||||||
|
{isLoading ? (
|
||||||
|
<div className="w-full mx-auto py-40 text-center">
|
||||||
|
<p className="text-foreground">Loading products...</p>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
<div id="product-catalog" data-section="product-catalog">
|
<div id="product-catalog" data-section="product-catalog">
|
||||||
<ProductCatalog
|
<ProductCardFour
|
||||||
layout="page"
|
title="Our Products"
|
||||||
products={products}
|
description="Browse our hand-picked selection of high-quality cups."
|
||||||
searchValue={search}
|
products={mappedProducts}
|
||||||
onSearchChange={setSearch}
|
gridVariant="four-items-2x2-equal-grid"
|
||||||
searchPlaceholder="Search products..."
|
animationType="slide-up"
|
||||||
filters={filters}
|
textboxLayout="default"
|
||||||
emptyMessage="No products found"
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ReactLenis>
|
)}
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,88 +1,30 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Suspense, use, useCallback } from "react";
|
import { Suspense, use } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import ReactLenis from "lenis/react";
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||||
import ProductDetailCard from "@/components/ecommerce/productDetail/ProductDetailCard";
|
import SplitAbout from '@/components/sections/about/SplitAbout';
|
||||||
import ProductCart from "@/components/ecommerce/cart/ProductCart";
|
|
||||||
import { useProductDetail } from "@/hooks/useProductDetail";
|
import { useProductDetail } from "@/hooks/useProductDetail";
|
||||||
import { useCart } from "@/hooks/useCart";
|
import { DollarSign, Package, CheckCircle } from 'lucide-react';
|
||||||
import { useCheckout } from "@/hooks/useCheckout";
|
|
||||||
|
|
||||||
// Define common navigation items for sub-pages to maintain consistency
|
const standardNavItems = [
|
||||||
const ALL_NAV_ITEMS_SUB_PAGES = [
|
|
||||||
{ name: "Home", id: "/" },
|
{ name: "Home", id: "/" },
|
||||||
{ name: "Products", id: "/products" },
|
{ name: "Products", id: "/products" }, { name: "About", id: "/#about" },
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "Blog", id: "/blog" },
|
|
||||||
{ name: "About", id: "/#about" },
|
|
||||||
{ name: "Testimonials", id: "/#testimonials" },
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
{ name: "FAQs", id: "/#faqs" }
|
{ name: "FAQs", id: "/#faqs" },
|
||||||
|
{ name: "Contact", id: "/#contact" }
|
||||||
];
|
];
|
||||||
|
|
||||||
interface ProductPageProps {
|
interface ProductPageProps {
|
||||||
params: Promise<{ id: string }>;
|
params: Promise<{ id: string }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ProductPage({ params }: ProductPageProps) {
|
|
||||||
return (
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<ProductPageContent params={params} />
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ProductPageContent({ params }: ProductPageProps) {
|
function ProductPageContent({ params }: ProductPageProps) {
|
||||||
const { id } = use(params);
|
const { id } = use(params);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const {
|
const { product, isLoading, images, meta } = useProductDetail(id);
|
||||||
product,
|
|
||||||
isLoading,
|
|
||||||
images,
|
|
||||||
meta,
|
|
||||||
variants,
|
|
||||||
quantityVariant,
|
|
||||||
selectedQuantity,
|
|
||||||
createCartItem,
|
|
||||||
} = useProductDetail(id);
|
|
||||||
|
|
||||||
const {
|
|
||||||
items: cartItems,
|
|
||||||
isOpen: cartOpen,
|
|
||||||
setIsOpen: setCartOpen,
|
|
||||||
addItem,
|
|
||||||
updateQuantity,
|
|
||||||
removeItem,
|
|
||||||
total: cartTotal,
|
|
||||||
getCheckoutItems,
|
|
||||||
} = useCart();
|
|
||||||
|
|
||||||
const { buyNow, checkout, isLoading: isCheckoutLoading } = useCheckout();
|
|
||||||
|
|
||||||
const handleAddToCart = useCallback(() => {
|
|
||||||
const item = createCartItem();
|
|
||||||
if (item) {
|
|
||||||
addItem(item);
|
|
||||||
}
|
|
||||||
}, [createCartItem, addItem]);
|
|
||||||
|
|
||||||
const handleBuyNow = useCallback(() => {
|
|
||||||
if (product) {
|
|
||||||
buyNow(product, selectedQuantity);
|
|
||||||
}
|
|
||||||
}, [product, selectedQuantity, buyNow]);
|
|
||||||
|
|
||||||
const handleCheckout = useCallback(async () => {
|
|
||||||
if (cartItems.length === 0) return;
|
|
||||||
|
|
||||||
const currentUrl = new URL(window.location.href);
|
|
||||||
currentUrl.searchParams.set("success", "true");
|
|
||||||
|
|
||||||
await checkout(getCheckoutItems(), { successUrl: currentUrl.toString() });
|
|
||||||
}, [cartItems, checkout, getCheckoutItems]);
|
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
@@ -98,23 +40,19 @@ function ProductPageContent({ params }: ProductPageProps) {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="nav" data-section="nav">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={standardNavItems}
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
button={{ text: "Back to Shop", href: "/shop" }}
|
||||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
buttonClassName="shadow-lg"
|
||||||
buttonClassName="shadow-lg"
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
className="backdrop-blur-sm bg-card/70"
|
||||||
className="backdrop-blur-sm bg-card/70"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||||
<div id="loading-section" data-section="loading-section">
|
<p className="text-foreground">Loading product...</p>
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
</main>
|
||||||
<p className="text-foreground">Loading product...</p>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -133,31 +71,27 @@ function ProductPageContent({ params }: ProductPageProps) {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="nav" data-section="nav">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={standardNavItems}
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
button={{ text: "Back to Shop", href: "/shop" }}
|
||||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
buttonClassName="shadow-lg"
|
||||||
buttonClassName="shadow-lg"
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
className="backdrop-blur-sm bg-card/70"
|
||||||
className="backdrop-blur-sm bg-card/70"
|
/>
|
||||||
/>
|
</div>
|
||||||
|
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="text-foreground mb-4">Product not found</p>
|
||||||
|
<button
|
||||||
|
onClick={() => router.push("/shop")}
|
||||||
|
className="px-6 py-2 rounded-lg bg-primary text-primary-foreground"
|
||||||
|
>
|
||||||
|
Back to Shop
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="not-found-section" data-section="not-found-section">
|
</main>
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
|
||||||
<div className="text-center">
|
|
||||||
<p className="text-foreground mb-4">Product not found</p>
|
|
||||||
<button
|
|
||||||
onClick={() => router.push("/shop")}
|
|
||||||
className="primary-button px-6 py-2 rounded-theme text-primary-cta-text"
|
|
||||||
>
|
|
||||||
Back to Shop
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -173,56 +107,48 @@ function ProductPageContent({ params }: ProductPageProps) {
|
|||||||
cardStyle="solid"
|
cardStyle="solid"
|
||||||
primaryButtonStyle="diagonal-gradient"
|
primaryButtonStyle="diagonal-gradient"
|
||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="nav" data-section="nav">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={standardNavItems}
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
button={{ text: "Back to Shop", href: "/shop" }}
|
||||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
buttonClassName="shadow-lg"
|
||||||
buttonClassName="shadow-lg"
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
className="backdrop-blur-sm bg-card/70"
|
||||||
className="backdrop-blur-sm bg-card/70"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div id="product-detail" data-section="product-detail">
|
||||||
<div id="product-detail-card" data-section="product-detail-card">
|
<SplitAbout
|
||||||
<ProductDetailCard
|
title={product.name}
|
||||||
layout="page"
|
description={product.description || 'No description available.'}
|
||||||
name={product.name}
|
imageSrc={images[0]?.src || '/placeholder.webp'}
|
||||||
price={product.price}
|
imageAlt={images[0]?.alt || product.name}
|
||||||
salePrice={meta.salePrice}
|
textboxLayout="default"
|
||||||
rating={product.rating || 0}
|
useInvertedBackground={false}
|
||||||
description={product.description}
|
mediaAnimation="opacity"
|
||||||
images={images}
|
bulletPoints={[
|
||||||
variants={variants.length > 0 ? variants : undefined}
|
{ title: "Price", description: product.price, icon: DollarSign },
|
||||||
quantity={quantityVariant}
|
{ title: "SKU", description: meta.sku || 'N/A', icon: Package },
|
||||||
ribbon={meta.ribbon}
|
{ title: "Status", description: meta.inventoryStatus || 'Available', icon: CheckCircle },
|
||||||
inventoryStatus={meta.inventoryStatus}
|
]}
|
||||||
inventoryQuantity={meta.inventoryQuantity}
|
buttons={[{ text: "Explore More Products", href: "/shop" }]
|
||||||
sku={meta.sku}
|
}
|
||||||
buttons={[
|
/>
|
||||||
{ text: "Add To Cart", onClick: handleAddToCart },
|
</div>
|
||||||
{ text: "Buy Now", onClick: handleBuyNow },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div id="product-cart" data-section="product-cart">
|
|
||||||
<ProductCart
|
|
||||||
isOpen={cartOpen}
|
|
||||||
onClose={() => setCartOpen(false)}
|
|
||||||
items={cartItems}
|
|
||||||
onQuantityChange={updateQuantity}
|
|
||||||
onRemove={removeItem}
|
|
||||||
total={`$${cartTotal}`}
|
|
||||||
buttons={[
|
|
||||||
{
|
|
||||||
text: isCheckoutLoading ? "Processing..." : "Check Out", onClick: handleCheckout,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function ProductPage({ params }: ProductPageProps) {
|
||||||
|
return (
|
||||||
|
<Suspense fallback={
|
||||||
|
<div className="w-full h-screen flex items-center justify-center bg-background text-foreground">
|
||||||
|
Loading product details...
|
||||||
|
</div>
|
||||||
|
}>
|
||||||
|
<ProductPageContent params={params} />
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,66 +1,31 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import ReactLenis from "lenis/react";
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||||
import ProductCatalog from "@/components/ecommerce/productCatalog/ProductCatalog";
|
import ProductCardFour from '@/components/sections/product/ProductCardFour';
|
||||||
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
||||||
|
|
||||||
// Define common navigation items for sub-pages to maintain consistency
|
const standardNavItems = [
|
||||||
const ALL_NAV_ITEMS_SUB_PAGES = [
|
|
||||||
{ name: "Home", id: "/" },
|
{ name: "Home", id: "/" },
|
||||||
{ name: "Products", id: "/products" },
|
{ name: "Products", id: "/products" },
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "Blog", id: "/blog" },
|
|
||||||
{ name: "About", id: "/#about" },
|
{ name: "About", id: "/#about" },
|
||||||
{ name: "Testimonials", id: "/#testimonials" },
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
{ name: "FAQs", id: "/#faqs" }
|
{ name: "FAQs", id: "/#faqs" },
|
||||||
|
{ name: "Contact", id: "/#contact" }
|
||||||
];
|
];
|
||||||
|
|
||||||
function ShopPageContent() {
|
function ShopPageContent() {
|
||||||
const {
|
const { products, isLoading } = useProductCatalog({ basePath: "/shop" });
|
||||||
products,
|
|
||||||
isLoading,
|
|
||||||
search,
|
|
||||||
setSearch,
|
|
||||||
filters,
|
|
||||||
} = useProductCatalog({ basePath: "/shop" });
|
|
||||||
|
|
||||||
if (isLoading) {
|
const mappedProducts = products.map(p => ({
|
||||||
return (
|
id: p.id,
|
||||||
<ThemeProvider
|
name: p.name,
|
||||||
defaultButtonVariant="hover-bubble"
|
price: p.price,
|
||||||
defaultTextAnimation="background-highlight"
|
imageSrc: p.imageSrc,
|
||||||
borderRadius="pill"
|
imageAlt: p.imageAlt || p.name,
|
||||||
contentWidth="mediumSmall"
|
variant: p.category || 'Standard',
|
||||||
sizing="largeSmallSizeMediumTitles"
|
}));
|
||||||
background="circleGradient"
|
|
||||||
cardStyle="solid"
|
|
||||||
primaryButtonStyle="diagonal-gradient"
|
|
||||||
secondaryButtonStyle="solid"
|
|
||||||
headingFontWeight="light"
|
|
||||||
>
|
|
||||||
<ReactLenis root>
|
|
||||||
<div id="nav" data-section="nav">
|
|
||||||
<NavbarLayoutFloatingInline
|
|
||||||
brandName="Nano Mango"
|
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
|
||||||
buttonClassName="shadow-lg"
|
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
|
||||||
className="backdrop-blur-sm bg-card/70"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div id="loading-section" data-section="loading-section">
|
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
|
||||||
<p className="text-foreground">Loading products...</p>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
@@ -75,29 +40,33 @@ function ShopPageContent() {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="nav" data-section="nav">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={standardNavItems}
|
||||||
navItems={ALL_NAV_ITEMS_SUB_PAGES}
|
button={{ text: "Contact Us", href: "/#contact" }}
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
buttonClassName="shadow-lg"
|
||||||
buttonClassName="shadow-lg"
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
className="backdrop-blur-sm bg-card/70"
|
||||||
className="backdrop-blur-sm bg-card/70"
|
/>
|
||||||
/>
|
</div>
|
||||||
|
{isLoading ? (
|
||||||
|
<div className="w-full mx-auto py-40 text-center">
|
||||||
|
<p className="text-foreground">Loading products...</p>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
<div id="product-catalog" data-section="product-catalog">
|
<div id="product-catalog" data-section="product-catalog">
|
||||||
<ProductCatalog
|
<ProductCardFour
|
||||||
layout="page"
|
title="Shop Our Collection"
|
||||||
products={products}
|
description="Find your perfect companion for coffee, tea, or any beverage."
|
||||||
searchValue={search}
|
products={mappedProducts}
|
||||||
onSearchChange={setSearch}
|
gridVariant="four-items-2x2-equal-grid"
|
||||||
searchPlaceholder="Search products..."
|
animationType="slide-up"
|
||||||
filters={filters}
|
textboxLayout="default"
|
||||||
emptyMessage="No products found"
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ReactLenis>
|
)}
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,23 +2,23 @@
|
|||||||
/* Base units */
|
/* Base units */
|
||||||
/* --vw is set by ThemeProvider */
|
/* --vw is set by ThemeProvider */
|
||||||
|
|
||||||
/* --background: #f6f0e9;;
|
/* --background: #f7f6f7;;
|
||||||
--card: #efe7dd;;
|
--card: #ffffff;;
|
||||||
--foreground: #2b180a;;
|
--foreground: #1c1c1c;;
|
||||||
--primary-cta: #2b180a;;
|
--primary-cta: #e63946;;
|
||||||
--secondary-cta: #efe7dd;;
|
--secondary-cta: #8b5cf6;;
|
||||||
--accent: #94877c;;
|
--accent: #c4a8f9;;
|
||||||
--background-accent: #afa094;; */
|
--background-accent: #f5c4c7;; */
|
||||||
|
|
||||||
--background: #f6f0e9;;
|
--background: #f7f6f7;;
|
||||||
--card: #efe7dd;;
|
--card: #ffffff;;
|
||||||
--foreground: #2b180a;;
|
--foreground: #1c1c1c;;
|
||||||
--primary-cta: #2b180a;;
|
--primary-cta: #e63946;;
|
||||||
--primary-cta-text: #f6f0e9;;
|
--primary-cta-text: #ffffff;;
|
||||||
--secondary-cta: #efe7dd;;
|
--secondary-cta: #8b5cf6;;
|
||||||
--secondary-cta-text: #2b180a;;
|
--secondary-cta-text: #ffffff;;
|
||||||
--accent: #94877c;;
|
--accent: #c4a8f9;;
|
||||||
--background-accent: #afa094;;
|
--background-accent: #f5c4c7;;
|
||||||
|
|
||||||
/* text sizing - set by ThemeProvider */
|
/* text sizing - set by ThemeProvider */
|
||||||
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);
|
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);
|
||||||
|
|||||||
Reference in New Issue
Block a user