Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ea0e6e79ad | |||
| 5033027a36 | |||
| 72ca4644ca | |||
| 2d84e9113e | |||
| 8d9f3e9f26 | |||
| 52e9668372 | |||
| 9db58c8fa9 | |||
| 8e91479fff | |||
| 5afa8f0023 | |||
| 01c19393f0 | |||
| 9399ea26d9 | |||
| 022e94b543 | |||
| 651de53fad | |||
| 3884f4597f | |||
| 10e33b9c34 | |||
| 906cb350ed | |||
| e677d8740a | |||
| f264dca571 | |||
| 67e2c4ef2a | |||
| 8b2f01f710 | |||
| 52d4d49911 | |||
| 901183f368 | |||
| 85fecaad7d | |||
| af06b6e687 | |||
| 46c7adaf16 | |||
| 653449266e |
@@ -1,10 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import ReactLenis from "lenis/react";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import { useBlogPosts } from "@/hooks/useBlogPosts";
|
||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
|
||||
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
|
||||
|
||||
const navItemsForSubPages = [
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Products", id: "/products" },
|
||||
{ name: "About", id: "/#about" },
|
||||
{ name: "Testimonials", id: "/#testimonials" },
|
||||
{ name: "FAQs", id: "/#faqs" },
|
||||
{ name: "Contact", id: "/#contact" },
|
||||
];
|
||||
|
||||
export default function BlogPage() {
|
||||
const { posts, isLoading } = useBlogPosts();
|
||||
@@ -22,42 +30,33 @@ export default function BlogPage() {
|
||||
secondaryButtonStyle="solid"
|
||||
headingFontWeight="light"
|
||||
>
|
||||
<ReactLenis root>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={[
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Products", id: "/#products" },
|
||||
{ name: "About", id: "/#about" },
|
||||
{ name: "Testimonials", id: "/#testimonials" },
|
||||
{ name: "FAQs", id: "/#faqs" },
|
||||
]}
|
||||
button={{ text: "Shop Now", href: "/#products" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
className="backdrop-blur-sm bg-card/70"
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={navItemsForSubPages}
|
||||
button={{ text: "Shop Now", href: "/shop" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
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>
|
||||
|
||||
{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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Noto_Sans } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { ServiceWrapper } from "@/components/ServiceWrapper";
|
||||
import Tag from "@/tag/Tag";
|
||||
|
||||
const notoSans = Noto_Sans({
|
||||
variable: "--font-noto-sans", subsets: ["latin"],
|
||||
@@ -15,11 +13,11 @@ export const metadata: Metadata = {
|
||||
openGraph: {
|
||||
title: "Nano Mango - Unique & Sustainable Cups Store", description: "Discover Nano Mango's exquisite collection of unique and sustainable cups for every beverage. Elevate your sipping experience with our beautifully crafted designs.", url: "https://nanomango.com", siteName: "Nano Mango", images: [
|
||||
{
|
||||
url: "https://img.b2bpic.net/free-photo/variety-bowls-cups-modern-household-shop_169016-43469.jpg", alt: "Assortment of stylish cups and mugs from Nano Mango"},
|
||||
url: "/og-image.jpg", alt: "Assortment of stylish cups and mugs from Nano Mango"},
|
||||
],
|
||||
type: "website"},
|
||||
twitter: {
|
||||
card: "summary_large_image", title: "Nano Mango - Unique & Sustainable Cups Store", description: "Discover Nano Mango's exquisite collection of unique and sustainable cups for every beverage. Elevate your sipping experience with our beautifully crafted designs.", images: ["https://img.b2bpic.net/free-photo/variety-bowls-cups-modern-household-shop_169016-43469.jpg"],
|
||||
card: "summary_large_image", title: "Nano Mango - Unique & Sustainable Cups Store", description: "Discover Nano Mango's exquisite collection of unique and sustainable cups for every beverage. Elevate your sipping experience with our beautifully crafted designs.", images: ["/twitter-image.jpg"],
|
||||
},
|
||||
robots: {
|
||||
index: true,
|
||||
@@ -34,13 +32,7 @@ export default function RootLayout({
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<ServiceWrapper>
|
||||
<body
|
||||
className={`${notoSans.variable} antialiased`}
|
||||
>
|
||||
<Tag />
|
||||
{children}
|
||||
|
||||
<body className={`${notoSans.variable} antialiased`}>{children}
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
@@ -1408,7 +1400,6 @@ export default function RootLayout({
|
||||
}}
|
||||
/>
|
||||
</body>
|
||||
</ServiceWrapper>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,14 @@ import FaqDouble from '@/components/sections/faq/FaqDouble';
|
||||
import ContactFaq from '@/components/sections/contact/ContactFaq';
|
||||
import { Handshake, HeartHandshake, MessageSquareText, Sparkles } from "lucide-react";
|
||||
|
||||
const navItemsForHomePage = [
|
||||
{ name: "Products", id: "/products" },
|
||||
{ name: "About", id: "about" },
|
||||
{ name: "Testimonials", id: "testimonials" },
|
||||
{ name: "FAQs", id: "faqs" },
|
||||
{ name: "Contact", id: "contact" },
|
||||
];
|
||||
|
||||
export default function SitePage() {
|
||||
return (
|
||||
<ThemeProvider
|
||||
@@ -27,13 +35,8 @@ export default function SitePage() {
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={[
|
||||
{ name: "Products", id: "products" },
|
||||
{ name: "About", id: "about" },
|
||||
{ name: "Testimonials", id: "testimonials" },
|
||||
{ name: "FAQs", id: "faqs" },
|
||||
]}
|
||||
button={{ text: "Shop Now", href: "#products" }}
|
||||
navItems={navItemsForHomePage}
|
||||
button={{ text: "Shop Now", href: "/shop" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
className="backdrop-blur-sm bg-card/70"
|
||||
@@ -51,10 +54,10 @@ export default function SitePage() {
|
||||
]}
|
||||
enableKpiAnimation={true}
|
||||
buttons={[
|
||||
{ text: "Explore Collection", href: "#products" },
|
||||
{ text: "Explore Collection", href: "/products" },
|
||||
{ text: "Our Story", href: "#about" },
|
||||
]}
|
||||
imageSrc="https://img.b2bpic.net/free-photo/variety-bowls-cups-modern-household-shop_169016-43469.jpg"
|
||||
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"
|
||||
imagePosition="right"
|
||||
mediaAnimation="blur-reveal"
|
||||
@@ -65,8 +68,6 @@ export default function SitePage() {
|
||||
titleClassName="font-light text-foreground"
|
||||
descriptionClassName="text-foreground/70"
|
||||
kpiClassName="bg-card/70 backdrop-blur-md border border-accent/20"
|
||||
buttonClassName="shadow-md"
|
||||
buttonContainerClassName="flex-col sm:flex-row"
|
||||
/>
|
||||
</div>
|
||||
<div id="about" data-section="about">
|
||||
@@ -77,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."
|
||||
subdescription="Founded with love, built on quality."
|
||||
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"
|
||||
mediaAnimation="opacity"
|
||||
useInvertedBackground={true}
|
||||
@@ -171,7 +172,6 @@ export default function SitePage() {
|
||||
ctaPanelClassName="bg-card shadow-lg"
|
||||
ctaTitleClassName="font-light"
|
||||
ctaDescriptionClassName="text-foreground/80"
|
||||
ctaButtonClassName="shadow-md"
|
||||
faqsPanelClassName="bg-card shadow-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
80
src/app/products/page.tsx
Normal file
80
src/app/products/page.tsx
Normal file
@@ -0,0 +1,80 @@
|
||||
"use client";
|
||||
|
||||
import { Suspense } from "react";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||
import ProductCardFour from '@/components/sections/product/ProductCardFour';
|
||||
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
||||
|
||||
const navItemsForSubPages = [
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Products", id: "/products" },
|
||||
{ name: "About", id: "/#about" },
|
||||
{ name: "Testimonials", id: "/#testimonials" },
|
||||
{ name: "FAQs", id: "/#faqs" },
|
||||
{ name: "Contact", id: "/#contact" },
|
||||
];
|
||||
|
||||
function ProductsPageContent() {
|
||||
const { products, isLoading } = useProductCatalog({ basePath: "/products" });
|
||||
|
||||
const mappedProducts = products.map(p => ({
|
||||
id: p.id,
|
||||
name: p.name,
|
||||
price: p.price,
|
||||
imageSrc: p.imageSrc,
|
||||
imageAlt: p.imageAlt || p.name,
|
||||
variant: p.category || 'Standard',
|
||||
}));
|
||||
|
||||
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"
|
||||
>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={navItemsForSubPages}
|
||||
button={{ text: "Go to Shop", href: "/shop" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
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 id="product-catalog" data-section="product-catalog">
|
||||
<ProductCardFour
|
||||
title="Our Products"
|
||||
description="Browse our hand-picked selection of high-quality cups."
|
||||
products={mappedProducts}
|
||||
gridVariant="four-items-2x2-equal-grid"
|
||||
animationType="slide-up"
|
||||
textboxLayout="default"
|
||||
useInvertedBackground={false}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default function ProductsPage() {
|
||||
return (
|
||||
<Suspense>
|
||||
<ProductsPageContent />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
@@ -1,77 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { Suspense, use, useCallback } from "react";
|
||||
import { Suspense, use } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ReactLenis from "lenis/react";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
|
||||
import ProductDetailCard from "@/components/ecommerce/productDetail/ProductDetailCard";
|
||||
import ProductCart from "@/components/ecommerce/cart/ProductCart";
|
||||
import SplitAbout from '@/components/sections/about/SplitAbout';
|
||||
import { useProductDetail } from "@/hooks/useProductDetail";
|
||||
import { useCart } from "@/hooks/useCart";
|
||||
import { useCheckout } from "@/hooks/useCheckout";
|
||||
import { DollarSign, Package, CheckCircle } from 'lucide-react';
|
||||
|
||||
const navItemsForSubPages = [
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Products", id: "/products" },
|
||||
{ name: "About", id: "/#about" },
|
||||
{ name: "Testimonials", id: "/#testimonials" },
|
||||
{ name: "FAQs", id: "/#faqs" },
|
||||
{ name: "Contact", id: "/#contact" },
|
||||
];
|
||||
|
||||
interface ProductPageProps {
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default function ProductPage({ params }: ProductPageProps) {
|
||||
return (
|
||||
<Suspense fallback={null}>
|
||||
<ProductPageContent params={params} />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
function ProductPageContent({ params }: ProductPageProps) {
|
||||
const { id } = use(params);
|
||||
const router = useRouter();
|
||||
|
||||
const {
|
||||
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]);
|
||||
const { product, isLoading, images, meta } = useProductDetail(id);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
@@ -87,23 +41,19 @@ function ProductPageContent({ params }: ProductPageProps) {
|
||||
secondaryButtonStyle="solid"
|
||||
headingFontWeight="light"
|
||||
>
|
||||
<ReactLenis root>
|
||||
<div id="navbar" data-section="navbar">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
||||
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 product...</p>
|
||||
</main>
|
||||
</div>
|
||||
</ReactLenis>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={navItemsForSubPages}
|
||||
button={{ text: "Back to Shop", href: "/shop" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
className="backdrop-blur-sm bg-card/70"
|
||||
/>
|
||||
</div>
|
||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||
<p className="text-foreground">Loading product...</p>
|
||||
</main>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
@@ -122,31 +72,27 @@ function ProductPageContent({ params }: ProductPageProps) {
|
||||
secondaryButtonStyle="solid"
|
||||
headingFontWeight="light"
|
||||
>
|
||||
<ReactLenis root>
|
||||
<div id="navbar" data-section="navbar">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
className="backdrop-blur-sm bg-card/70"
|
||||
/>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={navItemsForSubPages}
|
||||
button={{ text: "Back to Shop", href: "/shop" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
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 id="not-found-section" data-section="not-found-section">
|
||||
<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>
|
||||
</main>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
@@ -164,54 +110,45 @@ function ProductPageContent({ params }: ProductPageProps) {
|
||||
secondaryButtonStyle="solid"
|
||||
headingFontWeight="light"
|
||||
>
|
||||
<ReactLenis root>
|
||||
<div id="navbar" data-section="navbar">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
||||
button={{ text: "Cart", onClick: () => setCartOpen(true) }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
className="backdrop-blur-sm bg-card/70"
|
||||
/>
|
||||
</div>
|
||||
<div id="product-detail-card" data-section="product-detail-card">
|
||||
<ProductDetailCard
|
||||
layout="page"
|
||||
name={product.name}
|
||||
price={product.price}
|
||||
salePrice={meta.salePrice}
|
||||
rating={product.rating || 0}
|
||||
description={product.description}
|
||||
images={images}
|
||||
variants={variants.length > 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 },
|
||||
]}
|
||||
/>
|
||||
</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>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={navItemsForSubPages}
|
||||
button={{ text: "Back to Shop", href: "/shop" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
className="backdrop-blur-sm bg-card/70"
|
||||
/>
|
||||
</div>
|
||||
<div id="product-detail" data-section="product-detail">
|
||||
<SplitAbout
|
||||
title={product.name}
|
||||
description={product.description || 'No description available.'}
|
||||
imageSrc={images[0]?.src || '/placeholder.webp'}
|
||||
imageAlt={images[0]?.alt || product.name}
|
||||
textboxLayout="default"
|
||||
useInvertedBackground={false}
|
||||
mediaAnimation="opacity"
|
||||
bulletPoints={[
|
||||
{ title: "Price", description: product.price, icon: DollarSign },
|
||||
{ title: "SKU", description: meta.sku || 'N/A', icon: Package },
|
||||
{ title: "Status", description: meta.inventoryStatus || 'Available', icon: CheckCircle },
|
||||
]}
|
||||
buttons={[{ text: "Explore More Products", href: "/shop" }]}
|
||||
/>
|
||||
</div>
|
||||
</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,55 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { Suspense } from "react";
|
||||
import ReactLenis from "lenis/react";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
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";
|
||||
|
||||
function ShopPageContent() {
|
||||
const {
|
||||
products,
|
||||
isLoading,
|
||||
search,
|
||||
setSearch,
|
||||
filters,
|
||||
} = useProductCatalog({ basePath: "/shop" });
|
||||
const navItemsForSubPages = [
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Products", id: "/products" },
|
||||
{ name: "About", id: "/#about" },
|
||||
{ name: "Testimonials", id: "/#testimonials" },
|
||||
{ name: "FAQs", id: "/#faqs" },
|
||||
{ name: "Contact", id: "/#contact" },
|
||||
];
|
||||
|
||||
if (isLoading) {
|
||||
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="navbar" data-section="navbar">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
||||
button={{ text: "Shop Now" }}
|
||||
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>
|
||||
);
|
||||
}
|
||||
function ShopPageContent() {
|
||||
const { products, isLoading } = useProductCatalog({ basePath: "/shop" });
|
||||
|
||||
const mappedProducts = products.map(p => ({
|
||||
id: p.id,
|
||||
name: p.name,
|
||||
price: p.price,
|
||||
imageSrc: p.imageSrc,
|
||||
imageAlt: p.imageAlt || p.name,
|
||||
variant: p.category || 'Standard',
|
||||
}));
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
@@ -64,29 +40,33 @@ function ShopPageContent() {
|
||||
secondaryButtonStyle="solid"
|
||||
headingFontWeight="light"
|
||||
>
|
||||
<ReactLenis root>
|
||||
<div id="navbar" data-section="navbar">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
||||
button={{ text: "Shop Now" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
className="backdrop-blur-sm bg-card/70"
|
||||
/>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Nano Mango"
|
||||
navItems={navItemsForSubPages}
|
||||
button={{ text: "View Products", href: "/shop" }}
|
||||
buttonClassName="shadow-lg"
|
||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||
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 id="product-catalog" data-section="product-catalog">
|
||||
<ProductCatalog
|
||||
layout="page"
|
||||
products={products}
|
||||
searchValue={search}
|
||||
onSearchChange={setSearch}
|
||||
searchPlaceholder="Search products..."
|
||||
filters={filters}
|
||||
emptyMessage="No products found"
|
||||
<ProductCardFour
|
||||
title="Shop Our Collection"
|
||||
description="Find your perfect companion for coffee, tea, or any beverage."
|
||||
products={mappedProducts}
|
||||
gridVariant="four-items-2x2-equal-grid"
|
||||
animationType="slide-up"
|
||||
textboxLayout="default"
|
||||
useInvertedBackground={false}
|
||||
/>
|
||||
</div>
|
||||
</ReactLenis>
|
||||
)}
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
/* Base units */
|
||||
/* --vw is set by ThemeProvider */
|
||||
|
||||
/* --background: #f6f0e9;;
|
||||
--card: #efe7dd;;
|
||||
--foreground: #2b180a;;
|
||||
--primary-cta: #2b180a;;
|
||||
--secondary-cta: #efe7dd;;
|
||||
--accent: #94877c;;
|
||||
--background-accent: #afa094;; */
|
||||
/* --background: #fdfbf2;;
|
||||
--card: #fefce8;;
|
||||
--foreground: #2b2d21;;
|
||||
--primary-cta: #4CAF50;;
|
||||
--secondary-cta: #FFF176;;
|
||||
--accent: #FFC107;;
|
||||
--background-accent: #E8F5E9;; */
|
||||
|
||||
--background: #f6f0e9;;
|
||||
--card: #efe7dd;;
|
||||
--foreground: #2b180a;;
|
||||
--primary-cta: #2b180a;;
|
||||
--primary-cta-text: #f6f0e9;;
|
||||
--secondary-cta: #efe7dd;;
|
||||
--secondary-cta-text: #2b180a;;
|
||||
--accent: #94877c;;
|
||||
--background-accent: #afa094;;
|
||||
--background: #fdfbf2;;
|
||||
--card: #fefce8;;
|
||||
--foreground: #2b2d21;;
|
||||
--primary-cta: #4CAF50;;
|
||||
--primary-cta-text: #FFFFFF;;
|
||||
--secondary-cta: #FFF176;;
|
||||
--secondary-cta-text: #2b2d21;;
|
||||
--accent: #FFC107;;
|
||||
--background-accent: #E8F5E9;;
|
||||
|
||||
/* text sizing - set by ThemeProvider */
|
||||
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);
|
||||
|
||||
Reference in New Issue
Block a user