Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d84e9113e | |||
| 52e9668372 | |||
| 8e91479fff | |||
| 5afa8f0023 | |||
| 01c19393f0 | |||
| 9399ea26d9 | |||
| 022e94b543 | |||
| 651de53fad | |||
| 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 navItemsForSubPages = [
|
||||||
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,12 +30,11 @@ 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={ALL_NAV_ITEMS_SUB_PAGES}
|
navItems={navItemsForSubPages}
|
||||||
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"
|
||||||
@@ -46,13 +42,13 @@ export default function BlogPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<div className="w-content-width mx-auto py-20 text-center">
|
<div className="w-full mx-auto py-40 text-center">
|
||||||
<p className="text-foreground">Loading posts...</p>
|
<p className="text-foreground">Loading posts...</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div id="blog" data-section="blog">
|
<div id="blog" data-section="blog">
|
||||||
<BlogCardTwo
|
<BlogCardThree
|
||||||
blogs={posts}
|
blogs={posts.map(post => ({ ...post, onBlogClick: () => {} }))}
|
||||||
title="Latest Articles"
|
title="Latest Articles"
|
||||||
description="Insights and updates from our team"
|
description="Insights and updates from our team"
|
||||||
animationType="slide-up"
|
animationType="slide-up"
|
||||||
@@ -61,8 +57,6 @@ export default function BlogPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</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,12 @@ 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 ALL_NAV_ITEMS_SUB_PAGES = [
|
|
||||||
{ name: "Home", id: "/" },
|
|
||||||
{ name: "Products", id: "/products" },
|
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "Blog", id: "/blog" },
|
|
||||||
{ name: "About", id: "/#about" },
|
|
||||||
{ name: "Testimonials", id: "/#testimonials" },
|
|
||||||
{ name: "FAQs", id: "/#faqs" }
|
|
||||||
];
|
|
||||||
|
|
||||||
// Define navigation items specifically for the homepage (no 'Home' link here)
|
|
||||||
const navItemsForHomePage = [
|
const navItemsForHomePage = [
|
||||||
{ name: "Products", id: "/products" },
|
{ name: "Products", id: "/products" },
|
||||||
{ 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: "Shop", id: "/shop" },
|
{ name: "Contact", id: "contact" },
|
||||||
{ name: "Blog", id: "/blog" }
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function SitePage() {
|
export default function SitePage() {
|
||||||
@@ -49,7 +36,7 @@ export default function SitePage() {
|
|||||||
<NavbarLayoutFloatingInline
|
<NavbarLayoutFloatingInline
|
||||||
brandName="Nano Mango"
|
brandName="Nano Mango"
|
||||||
navItems={navItemsForHomePage}
|
navItems={navItemsForHomePage}
|
||||||
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"
|
||||||
@@ -68,7 +55,7 @@ export default function SitePage() {
|
|||||||
enableKpiAnimation={true}
|
enableKpiAnimation={true}
|
||||||
buttons={[
|
buttons={[
|
||||||
{ text: "Explore Collection", href: "/products" },
|
{ text: "Explore Collection", href: "/products" },
|
||||||
{ text: "Our Story", href: "/#about" },
|
{ text: "Our Story", href: "#about" },
|
||||||
]}
|
]}
|
||||||
videoSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_34my1kGeblbsCcwUUCcjBY9WFkg/uploaded-1770649506170-pxkn8ubj.mp4"
|
videoSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_34my1kGeblbsCcwUUCcjBY9WFkg/uploaded-1770649506170-pxkn8ubj.mp4"
|
||||||
imageAlt="Assortment of stylish cups and mugs from Nano Mango"
|
imageAlt="Assortment of stylish cups and mugs from Nano Mango"
|
||||||
@@ -81,8 +68,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 +78,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 +172,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,33 +1,32 @@
|
|||||||
"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 navItemsForSubPages = [
|
||||||
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,
|
const mappedProducts = products.map(p => ({
|
||||||
search,
|
id: p.id,
|
||||||
setSearch,
|
name: p.name,
|
||||||
filters,
|
price: p.price,
|
||||||
} = useProductCatalog({ basePath: "/products" });
|
imageSrc: p.imageSrc,
|
||||||
|
imageAlt: p.imageAlt || p.name,
|
||||||
|
variant: p.category || 'Standard',
|
||||||
|
}));
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
defaultButtonVariant="hover-bubble"
|
defaultButtonVariant="hover-bubble"
|
||||||
@@ -41,63 +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={ALL_NAV_ITEMS_SUB_PAGES}
|
navItems={navItemsForSubPages}
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
button={{ text: "Go to Shop", 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"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="loading-section" data-section="loading-section">
|
{isLoading ? (
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
<div className="w-full mx-auto py-40 text-center">
|
||||||
<p className="text-foreground">Loading products...</p>
|
<p className="text-foreground">Loading products...</p>
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ThemeProvider
|
|
||||||
defaultButtonVariant="hover-bubble"
|
|
||||||
defaultTextAnimation="background-highlight"
|
|
||||||
borderRadius="pill"
|
|
||||||
contentWidth="mediumSmall"
|
|
||||||
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>
|
||||||
|
) : (
|
||||||
<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,31 @@
|
|||||||
"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 navItemsForSubPages = [
|
||||||
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" },
|
||||||
];
|
];
|
||||||
|
|
||||||
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 +41,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={ALL_NAV_ITEMS_SUB_PAGES}
|
navItems={navItemsForSubPages}
|
||||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
button={{ text: "Back to Shop", 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"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="loading-section" data-section="loading-section">
|
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||||
<p className="text-foreground">Loading product...</p>
|
<p className="text-foreground">Loading product...</p>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -133,31 +72,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={ALL_NAV_ITEMS_SUB_PAGES}
|
navItems={navItemsForSubPages}
|
||||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
button={{ text: "Back to Shop", 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"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="not-found-section" data-section="not-found-section">
|
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<p className="text-foreground mb-4">Product not found</p>
|
<p className="text-foreground mb-4">Product not found</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => router.push("/shop")}
|
onClick={() => router.push("/shop")}
|
||||||
className="primary-button px-6 py-2 rounded-theme text-primary-cta-text"
|
className="px-6 py-2 rounded-lg bg-primary text-primary-foreground"
|
||||||
>
|
>
|
||||||
Back to Shop
|
Back to Shop
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -175,54 +110,45 @@ 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={ALL_NAV_ITEMS_SUB_PAGES}
|
navItems={navItemsForSubPages}
|
||||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
button={{ text: "Back to Shop", 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"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="product-detail-card" data-section="product-detail-card">
|
<div id="product-detail" data-section="product-detail">
|
||||||
<ProductDetailCard
|
<SplitAbout
|
||||||
layout="page"
|
title={product.name}
|
||||||
name={product.name}
|
description={product.description || 'No description available.'}
|
||||||
price={product.price}
|
imageSrc={images[0]?.src || '/placeholder.webp'}
|
||||||
salePrice={meta.salePrice}
|
imageAlt={images[0]?.alt || product.name}
|
||||||
rating={product.rating || 0}
|
textboxLayout="default"
|
||||||
description={product.description}
|
useInvertedBackground={false}
|
||||||
images={images}
|
mediaAnimation="opacity"
|
||||||
variants={variants.length > 0 ? variants : undefined}
|
bulletPoints={[
|
||||||
quantity={quantityVariant}
|
{ title: "Price", description: product.price, icon: DollarSign },
|
||||||
ribbon={meta.ribbon}
|
{ title: "SKU", description: meta.sku || 'N/A', icon: Package },
|
||||||
inventoryStatus={meta.inventoryStatus}
|
{ title: "Status", description: meta.inventoryStatus || 'Available', icon: CheckCircle },
|
||||||
inventoryQuantity={meta.inventoryQuantity}
|
|
||||||
sku={meta.sku}
|
|
||||||
buttons={[
|
|
||||||
{ text: "Add To Cart", onClick: handleAddToCart },
|
|
||||||
{ text: "Buy Now", onClick: handleBuyNow },
|
|
||||||
]}
|
]}
|
||||||
|
buttons={[{ text: "Explore More Products", href: "/shop" }]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</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,33 +1,32 @@
|
|||||||
"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 navItemsForSubPages = [
|
||||||
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,
|
const mappedProducts = products.map(p => ({
|
||||||
search,
|
id: p.id,
|
||||||
setSearch,
|
name: p.name,
|
||||||
filters,
|
price: p.price,
|
||||||
} = useProductCatalog({ basePath: "/shop" });
|
imageSrc: p.imageSrc,
|
||||||
|
imageAlt: p.imageAlt || p.name,
|
||||||
|
variant: p.category || 'Standard',
|
||||||
|
}));
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
defaultButtonVariant="hover-bubble"
|
defaultButtonVariant="hover-bubble"
|
||||||
@@ -41,63 +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={ALL_NAV_ITEMS_SUB_PAGES}
|
navItems={navItemsForSubPages}
|
||||||
button={{ text: "Shop Now", href: "/products" }}
|
button={{ text: "View Products", 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>
|
</div>
|
||||||
<div id="loading-section" data-section="loading-section">
|
{isLoading ? (
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
<div className="w-full mx-auto py-40 text-center">
|
||||||
<p className="text-foreground">Loading products...</p>
|
<p className="text-foreground">Loading products...</p>
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ThemeProvider
|
|
||||||
defaultButtonVariant="hover-bubble"
|
|
||||||
defaultTextAnimation="background-highlight"
|
|
||||||
borderRadius="pill"
|
|
||||||
contentWidth="mediumSmall"
|
|
||||||
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>
|
||||||
|
) : (
|
||||||
<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: #060000;;
|
||||||
--card: #efe7dd;;
|
--card: #1d0d0d;;
|
||||||
--foreground: #2b180a;;
|
--foreground: #ffe6e6;;
|
||||||
--primary-cta: #2b180a;;
|
--primary-cta: #ff3d4a;;
|
||||||
--secondary-cta: #efe7dd;;
|
--secondary-cta: #1f0a0a;;
|
||||||
--accent: #94877c;;
|
--accent: #7b2d2d;;
|
||||||
--background-accent: #afa094;; */
|
--background-accent: #b8111f;; */
|
||||||
|
|
||||||
--background: #f6f0e9;;
|
--background: #060000;;
|
||||||
--card: #efe7dd;;
|
--card: #1d0d0d;;
|
||||||
--foreground: #2b180a;;
|
--foreground: #ffe6e6;;
|
||||||
--primary-cta: #2b180a;;
|
--primary-cta: #ff3d4a;;
|
||||||
--primary-cta-text: #f6f0e9;;
|
--primary-cta-text: #060000;;
|
||||||
--secondary-cta: #efe7dd;;
|
--secondary-cta: #1f0a0a;;
|
||||||
--secondary-cta-text: #2b180a;;
|
--secondary-cta-text: #ffe6e6;;
|
||||||
--accent: #94877c;;
|
--accent: #7b2d2d;;
|
||||||
--background-accent: #afa094;;
|
--background-accent: #b8111f;;
|
||||||
|
|
||||||
/* 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