Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d84e9113e | |||
| 52e9668372 | |||
| 8e91479fff | |||
| 5afa8f0023 | |||
| 01c19393f0 | |||
| 9399ea26d9 | |||
| 022e94b543 | |||
| 651de53fad | |||
| 10e33b9c34 | |||
| 906cb350ed | |||
| e677d8740a | |||
| f264dca571 | |||
| 67e2c4ef2a | |||
| 8b2f01f710 | |||
| 52d4d49911 | |||
| 901183f368 | |||
| 85fecaad7d | |||
| af06b6e687 | |||
| 46c7adaf16 | |||
| 653449266e |
@@ -1,10 +1,18 @@
|
|||||||
"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';
|
||||||
|
|
||||||
|
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() {
|
export default function BlogPage() {
|
||||||
const { posts, isLoading } = useBlogPosts();
|
const { posts, isLoading } = useBlogPosts();
|
||||||
@@ -22,42 +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={navItemsForSubPages}
|
||||||
navItems={[
|
button={{ text: "Shop Now", href: "/shop" }}
|
||||||
{ name: "Home", id: "/" },
|
buttonClassName="shadow-lg"
|
||||||
{ name: "Products", id: "/#products" },
|
navItemClassName="text-foreground/80 hover:text-foreground"
|
||||||
{ name: "About", id: "/#about" },
|
className="backdrop-blur-sm bg-card/70"
|
||||||
{ name: "Testimonials", id: "/#testimonials" },
|
/>
|
||||||
{ name: "FAQs", id: "/#faqs" },
|
</div>
|
||||||
]}
|
|
||||||
button={{ text: "Shop Now", href: "/#products" }}
|
{isLoading ? (
|
||||||
buttonClassName="shadow-lg"
|
<div className="w-full mx-auto py-40 text-center">
|
||||||
navItemClassName="text-foreground/80 hover:text-foreground"
|
<p className="text-foreground">Loading posts...</p>
|
||||||
className="backdrop-blur-sm bg-card/70"
|
</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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Noto_Sans } from "next/font/google";
|
import { Noto_Sans } from "next/font/google";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { ServiceWrapper } from "@/components/ServiceWrapper";
|
|
||||||
import Tag from "@/tag/Tag";
|
|
||||||
|
|
||||||
const notoSans = Noto_Sans({
|
const notoSans = Noto_Sans({
|
||||||
variable: "--font-noto-sans", subsets: ["latin"],
|
variable: "--font-noto-sans", subsets: ["latin"],
|
||||||
@@ -15,11 +13,11 @@ export const metadata: Metadata = {
|
|||||||
openGraph: {
|
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: [
|
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"},
|
type: "website"},
|
||||||
twitter: {
|
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: {
|
robots: {
|
||||||
index: true,
|
index: true,
|
||||||
@@ -34,13 +32,7 @@ export default function RootLayout({
|
|||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="en" suppressHydrationWarning>
|
<html lang="en" suppressHydrationWarning>
|
||||||
<ServiceWrapper>
|
<body className={`${notoSans.variable} antialiased`}>{children}
|
||||||
<body
|
|
||||||
className={`${notoSans.variable} antialiased`}
|
|
||||||
>
|
|
||||||
<Tag />
|
|
||||||
{children}
|
|
||||||
|
|
||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
@@ -1408,7 +1400,6 @@ export default function RootLayout({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</body>
|
</body>
|
||||||
</ServiceWrapper>
|
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ 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";
|
||||||
|
|
||||||
|
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() {
|
export default function SitePage() {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
@@ -27,13 +35,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={[
|
navItems={navItemsForHomePage}
|
||||||
{ name: "Products", id: "products" },
|
button={{ text: "Shop Now", href: "/shop" }}
|
||||||
{ name: "About", id: "about" },
|
|
||||||
{ name: "Testimonials", id: "testimonials" },
|
|
||||||
{ name: "FAQs", id: "faqs" },
|
|
||||||
]}
|
|
||||||
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"
|
||||||
@@ -51,10 +54,10 @@ 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" },
|
||||||
]}
|
]}
|
||||||
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"
|
imageAlt="Assortment of stylish cups and mugs from Nano Mango"
|
||||||
imagePosition="right"
|
imagePosition="right"
|
||||||
mediaAnimation="blur-reveal"
|
mediaAnimation="blur-reveal"
|
||||||
@@ -65,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">
|
||||||
@@ -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."
|
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}
|
||||||
@@ -171,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>
|
||||||
|
|||||||
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";
|
"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";
|
|
||||||
|
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 {
|
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 (
|
||||||
@@ -87,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="navbar" data-section="navbar">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={navItemsForSubPages}
|
||||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -122,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="navbar" data-section="navbar">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={navItemsForSubPages}
|
||||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -164,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="navbar" data-section="navbar">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={navItemsForSubPages}
|
||||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
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={[
|
</div>
|
||||||
{ 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>
|
|
||||||
</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,55 +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";
|
||||||
|
|
||||||
function ShopPageContent() {
|
const navItemsForSubPages = [
|
||||||
const {
|
{ name: "Home", id: "/" },
|
||||||
products,
|
{ name: "Products", id: "/products" },
|
||||||
isLoading,
|
{ name: "About", id: "/#about" },
|
||||||
search,
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
setSearch,
|
{ name: "FAQs", id: "/#faqs" },
|
||||||
filters,
|
{ name: "Contact", id: "/#contact" },
|
||||||
} = useProductCatalog({ basePath: "/shop" });
|
];
|
||||||
|
|
||||||
if (isLoading) {
|
function ShopPageContent() {
|
||||||
return (
|
const { products, isLoading } = useProductCatalog({ basePath: "/shop" });
|
||||||
<ThemeProvider
|
|
||||||
defaultButtonVariant="hover-bubble"
|
const mappedProducts = products.map(p => ({
|
||||||
defaultTextAnimation="background-highlight"
|
id: p.id,
|
||||||
borderRadius="pill"
|
name: p.name,
|
||||||
contentWidth="mediumSmall"
|
price: p.price,
|
||||||
sizing="largeSmallSizeMediumTitles"
|
imageSrc: p.imageSrc,
|
||||||
background="circleGradient"
|
imageAlt: p.imageAlt || p.name,
|
||||||
cardStyle="solid"
|
variant: p.category || 'Standard',
|
||||||
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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
@@ -64,29 +40,33 @@ function ShopPageContent() {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="navbar" data-section="navbar">
|
<NavbarLayoutFloatingInline
|
||||||
<NavbarLayoutFloatingInline
|
brandName="Nano Mango"
|
||||||
brandName="Nano Mango"
|
navItems={navItemsForSubPages}
|
||||||
navItems={[{ name: "Home", id: "/" }, { name: "Shop", id: "/shop" }]}
|
button={{ text: "View Products", href: "/products" }}
|
||||||
button={{ text: "Shop Now" }}
|
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: #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