Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c2254c2faf | |||
| 2777466057 | |||
| 3e39766798 | |||
| 12614bf6f7 | |||
| ed01a00d27 | |||
| dad36c5d2d | |||
| 47dc645476 | |||
| a28cc0a9b1 | |||
| 5db6ada320 | |||
| 92627b54c0 | |||
| b617b9ae06 | |||
| 56b620f36d |
@@ -1,12 +1,19 @@
|
|||||||
"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 NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
|
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
|
||||||
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
||||||
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
|
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Home", id: "/" },
|
||||||
|
{ name: "Products", id: "/#products" },
|
||||||
|
{ name: "About", id: "/#about" },
|
||||||
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
|
{ name: "Contact", id: "/#contact" },
|
||||||
|
];
|
||||||
|
|
||||||
export default function BlogPage() {
|
export default function BlogPage() {
|
||||||
const { posts, isLoading } = useBlogPosts();
|
const { posts, isLoading } = useBlogPosts();
|
||||||
@@ -24,35 +31,34 @@ export default function BlogPage() {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<NavbarStyleApple
|
<NavbarStyleApple
|
||||||
brandName="Persik"
|
brandName="Persik"
|
||||||
navItems={[
|
navItems={navItems}
|
||||||
{ name: "Home", id: "/" },
|
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "About", id: "#about" },
|
|
||||||
{ name: "Testimonials", id: "#testimonials" },
|
|
||||||
{ name: "FAQ", id: "#faq" },
|
|
||||||
{ name: "Contact", id: "#contact" },
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<main>
|
||||||
{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>
|
||||||
) : (
|
) : (
|
||||||
<BlogCardThree
|
<div id="blog-posts" data-section="blog-posts">
|
||||||
blogs={posts}
|
<BlogCardTwo
|
||||||
title="Featured Articles"
|
blogs={posts}
|
||||||
description="Explore our latest insights"
|
title="From Our Blog"
|
||||||
animationType="slide-up"
|
description="Explore our latest floral tips, stories, and insights."
|
||||||
textboxLayout="default"
|
animationType="slide-up"
|
||||||
useInvertedBackground={false}
|
textboxLayout="default"
|
||||||
carouselMode="buttons"
|
useInvertedBackground={false}
|
||||||
/>
|
carouselMode="buttons"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
<FooterMedia
|
<FooterMedia
|
||||||
imageSrc="https://img.b2bpic.net/free-photo/woman-holds-festive-flower-arrangement-with-bright-chrysanthemum-flowers_169016-51483.jpg?_wi=2"
|
imageSrc="https://img.b2bpic.net/free-photo/woman-holds-festive-flower-arrangement-with-bright-chrysanthemum-flowers_169016-51483.jpg?_wi=2"
|
||||||
imageAlt="Soft focus background image of various flowers"
|
imageAlt="Soft focus background image of various flowers"
|
||||||
@@ -68,21 +74,20 @@ export default function BlogPage() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "About Us", items: [
|
title: "About Us", items: [
|
||||||
{ label: "Our Story", href: "#about" },
|
{ label: "Our Story", href: "/#about" },
|
||||||
{ label: "Testimonials", href: "#testimonials" },
|
{ label: "Testimonials", href: "/#testimonials" },
|
||||||
{ label: "FAQ", href: "#faq" },
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Support", items: [
|
title: "Support", items: [
|
||||||
{ label: "Contact", href: "#contact" },
|
{ label: "Contact", href: "/#contact" },
|
||||||
{ label: "Delivery Info", href: "https://example.com/delivery" },
|
{ label: "Delivery Info", href: "https://example.com/delivery" },
|
||||||
{ label: "Privacy Policy", href: "https://example.com/privacy" },
|
{ label: "Privacy Policy", href: "https://example.com/privacy" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</ReactLenis>
|
</div>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
1384
src/app/layout.tsx
1384
src/app/layout.tsx
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import { Award, Flower, Heart } from "lucide-react";
|
import { Award, Flower, Heart, Phone } from "lucide-react";
|
||||||
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
|
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
|
||||||
import HeroBillboard from '@/components/sections/hero/HeroBillboard';
|
import HeroBillboard from '@/components/sections/hero/HeroBillboard';
|
||||||
import ProductCardFour from '@/components/sections/product/ProductCardFour';
|
import ProductCardFour from '@/components/sections/product/ProductCardFour';
|
||||||
import AboutMetric from '@/components/sections/about/AboutMetric';
|
import AboutMetric from '@/components/sections/about/AboutMetric';
|
||||||
import TestimonialCardSix from '@/components/sections/testimonial/TestimonialCardSix';
|
import TestimonialCardSix from '@/components/sections/testimonial/TestimonialCardSix';
|
||||||
import FaqSplitText from '@/components/sections/faq/FaqSplitText';
|
import ContactFaq from '@/components/sections/contact/ContactFaq';
|
||||||
import ContactSplitForm from '@/components/sections/contact/ContactSplitForm';
|
|
||||||
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
||||||
|
|
||||||
export default function LandingPage() {
|
export default function LandingPage() {
|
||||||
@@ -30,10 +29,9 @@ export default function LandingPage() {
|
|||||||
brandName="Persik"
|
brandName="Persik"
|
||||||
navItems={[
|
navItems={[
|
||||||
{ name: "Home", id: "/" },
|
{ name: "Home", id: "/" },
|
||||||
{ name: "Shop", id: "/shop" },
|
{ name: "Products", id: "#products" },
|
||||||
{ name: "About", id: "#about" },
|
{ name: "About", id: "#about" },
|
||||||
{ name: "Testimonials", id: "#testimonials" },
|
{ name: "Testimonials", id: "#testimonials" },
|
||||||
{ name: "FAQ", id: "#faq" },
|
|
||||||
{ name: "Contact", id: "#contact" },
|
{ name: "Contact", id: "#contact" },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -98,36 +96,20 @@ export default function LandingPage() {
|
|||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="faq" data-section="faq">
|
|
||||||
<FaqSplitText
|
<div id="contact" data-section="contact">
|
||||||
sideTitle="Frequently Asked Questions"
|
<ContactFaq
|
||||||
sideDescription="Find quick answers to common questions about our flowers, delivery, and services."
|
ctaTitle="Get in Touch with Persik"
|
||||||
|
ctaDescription="Have a question or a special request? We'd love to hear from you. Send us a message and we'll get back to you shortly."
|
||||||
|
ctaButton={{ text: "Send Message", href: "#contact" }}
|
||||||
|
ctaIcon={Phone}
|
||||||
faqs={[
|
faqs={[
|
||||||
{ id: "1", title: "What are your delivery options?", content: "We offer same-day delivery for orders placed before 2 PM. Standard delivery is available nationwide. Please check our delivery policy for details." },
|
{ id: "1", title: "What are your delivery options?", content: "We offer same-day delivery for orders placed before 2 PM. Standard delivery is available nationwide. Please check our delivery policy for details." },
|
||||||
{ id: "2", title: "Can I customize a bouquet?", content: "Absolutely! We love creating bespoke arrangements. Contact us directly to discuss your specific preferences and occasion." },
|
{ id: "2", title: "Can I customize a bouquet?", content: "Absolutely! We love creating bespoke arrangements. Contact us directly to discuss your specific preferences and occasion." },
|
||||||
{ id: "3", title: "How do I care for my flowers?", content: "Each bouquet comes with a care card. Generally, trim stems, change water daily, and keep away from direct sunlight and heat sources." },
|
{ id: "3", title: "How do I care for my flowers?", content: "Each bouquet comes with a care card. Generally, trim stems, change water daily, and keep away from direct sunlight and heat sources." },
|
||||||
{ id: "4", title: "Do you offer corporate services?", content: "Yes, we provide floral services for corporate events, office decor, and client gifting. Reach out to our team for a tailored proposal." },
|
{ id: "4", title: "Do you offer corporate services?", content: "Yes, we provide floral services for corporate events, office decor, and client gifting. Reach out to our team for a tailored proposal." },
|
||||||
]}
|
]}
|
||||||
faqsAnimation="slide-up"
|
animationType="slide-up"
|
||||||
textPosition="left"
|
|
||||||
useInvertedBackground={false}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div id="contact" data-section="contact">
|
|
||||||
<ContactSplitForm
|
|
||||||
title="Get in Touch with Persik"
|
|
||||||
description="Have a question or a special request? We'd love to hear from you. Send us a message and we'll get back to you shortly."
|
|
||||||
inputs={[
|
|
||||||
{ name: "name", type: "text", placeholder: "Your Name", required: true },
|
|
||||||
{ name: "email", type: "email", placeholder: "Your Email", required: true },
|
|
||||||
{ name: "phone", type: "tel", placeholder: "Your Phone Number (Optional)" },
|
|
||||||
]}
|
|
||||||
textarea={{ name: "message", placeholder: "Tell us about your floral needs or inquiry...", rows: 5, required: true }}
|
|
||||||
buttonText="Send Message"
|
|
||||||
imageSrc="https://img.b2bpic.net/free-photo/flowers-floral-shop-different-types_1303-15615.jpg"
|
|
||||||
imageAlt="Beautiful flowers in a vase on a wooden table, in a cozy flower shop setting"
|
|
||||||
mediaAnimation="slide-up"
|
|
||||||
mediaPosition="right"
|
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -139,11 +121,11 @@ export default function LandingPage() {
|
|||||||
copyrightText="© 2024 Persik | All rights reserved"
|
copyrightText="© 2024 Persik | All rights reserved"
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "Shop", items: [{ label: "Bouquets", href: "/shop" }, { label: "Arrangements", href: "/shop" }, { label: "Gifts", href: "/shop" }] },
|
{ title: "Shop", items: [{ label: "Bouquets", href: "/shop" }, { label: "Arrangements", href: "/shop" }, { label: "Gifts", href: "/shop" }] },
|
||||||
{ title: "About Us", items: [{ label: "Our Story", href: "#about" }, { label: "Testimonials", href: "#testimonials" }, { label: "FAQ", href: "#faq" }] },
|
{ title: "About Us", items: [{ label: "Our Story", href: "/#about" }, { label: "Testimonials", href: "/#testimonials" }] },
|
||||||
{ title: "Support", items: [{ label: "Contact", href: "#contact" }, { label: "Delivery Info", href: "https://example.com/delivery" }, { label: "Privacy Policy", href: "https://example.com/privacy" }] },
|
{ title: "Support", items: [{ label: "Contact", href: "/#contact" }, { label: "Delivery Info", href: "https://example.com/delivery" }, { label: "Privacy Policy", href: "https://example.com/privacy" }] },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
import React, { use, useCallback } from "react";
|
import React, { use, useCallback } 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 NavbarStyleApple from "@/components/navbar/NavbarStyleApple/NavbarStyleApple";
|
import NavbarStyleApple from "@/components/navbar/NavbarStyleApple/NavbarStyleApple";
|
||||||
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
||||||
import ProductDetailCard from "@/components/ecommerce/productDetail/ProductDetailCard";
|
import FeatureCardTwentyOne from "@/components/sections/feature/FeatureCardTwentyOne";
|
||||||
import ProductCart from "@/components/ecommerce/cart/ProductCart";
|
import ProductCart from "@/components/ecommerce/cart/ProductCart";
|
||||||
import { useProductDetail } from "@/hooks/useProductDetail";
|
import { useProductDetail } from "@/hooks/useProductDetail";
|
||||||
import { useCart } from "@/hooks/useCart";
|
import { useCart } from "@/hooks/useCart";
|
||||||
@@ -16,6 +15,14 @@ interface ProductPageProps {
|
|||||||
params: Promise<{ id: string }>;
|
params: Promise<{ id: string }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Home", id: "/" },
|
||||||
|
{ name: "Products", id: "/shop" },
|
||||||
|
{ name: "About", id: "/#about" },
|
||||||
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
|
{ name: "Contact", id: "/#contact" },
|
||||||
|
];
|
||||||
|
|
||||||
export default function ProductPage({ params }: ProductPageProps) {
|
export default function ProductPage({ params }: ProductPageProps) {
|
||||||
const { id } = use(params);
|
const { id } = use(params);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -25,8 +32,6 @@ export default function ProductPage({ params }: ProductPageProps) {
|
|||||||
isLoading,
|
isLoading,
|
||||||
images,
|
images,
|
||||||
meta,
|
meta,
|
||||||
variants,
|
|
||||||
quantityVariant,
|
|
||||||
selectedQuantity,
|
selectedQuantity,
|
||||||
createCartItem,
|
createCartItem,
|
||||||
} = useProductDetail(id);
|
} = useProductDetail(id);
|
||||||
@@ -48,8 +53,9 @@ export default function ProductPage({ params }: ProductPageProps) {
|
|||||||
const item = createCartItem();
|
const item = createCartItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
addItem(item);
|
addItem(item);
|
||||||
|
setCartOpen(true);
|
||||||
}
|
}
|
||||||
}, [createCartItem, addItem]);
|
}, [createCartItem, addItem, setCartOpen]);
|
||||||
|
|
||||||
const handleBuyNow = useCallback(() => {
|
const handleBuyNow = useCallback(() => {
|
||||||
if (product) {
|
if (product) {
|
||||||
@@ -66,23 +72,17 @@ export default function ProductPage({ params }: ProductPageProps) {
|
|||||||
await checkout(getCheckoutItems(), { successUrl: currentUrl.toString() });
|
await checkout(getCheckoutItems(), { successUrl: currentUrl.toString() });
|
||||||
}, [cartItems, checkout, getCheckoutItems]);
|
}, [cartItems, checkout, getCheckoutItems]);
|
||||||
|
|
||||||
|
const cartCount = cartItems.length;
|
||||||
const navbarProps = {
|
const navbarProps = {
|
||||||
brandName: "Persik", navItems: [
|
brandName: "Persik", navItems: navItems,
|
||||||
{ name: "Home", id: "/" },
|
button: { text: `Cart (${cartCount})`, onClick: () => setCartOpen(true) },
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "About", id: "#about" },
|
|
||||||
{ name: "Testimonials", id: "#testimonials" },
|
|
||||||
{ name: "FAQ", id: "#faq" },
|
|
||||||
{ name: "Contact", id: "#contact" }
|
|
||||||
],
|
|
||||||
button: { text: "Cart", onClick: () => setCartOpen(true) },
|
|
||||||
mobileNavContent: (
|
mobileNavContent: (
|
||||||
<div className="flex flex-col gap-2 mt-4">
|
<div className="flex flex-col gap-2 mt-4">
|
||||||
<button
|
<button
|
||||||
onClick={() => setCartOpen(true)}
|
onClick={() => setCartOpen(true)}
|
||||||
className="w-full text-left p-2 rounded-md hover:bg-muted/50"
|
className="w-full text-left p-2 rounded-md hover:bg-muted/50"
|
||||||
>
|
>
|
||||||
Cart
|
Cart ({cartCount})
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -91,76 +91,59 @@ export default function ProductPage({ params }: ProductPageProps) {
|
|||||||
const footerProps = {
|
const footerProps = {
|
||||||
imageSrc: "https://img.b2bpic.net/free-photo/woman-holds-festive-flower-arrangement-with-bright-chrysanthemum-flowers_169016-51483.jpg?_wi=4", imageAlt: "Soft focus background image of various flowers", logoText: "Persik Flowers", copyrightText: "© 2024 Persik | All rights reserved", columns: [
|
imageSrc: "https://img.b2bpic.net/free-photo/woman-holds-festive-flower-arrangement-with-bright-chrysanthemum-flowers_169016-51483.jpg?_wi=4", imageAlt: "Soft focus background image of various flowers", logoText: "Persik Flowers", copyrightText: "© 2024 Persik | All rights reserved", columns: [
|
||||||
{ title: "Shop", items: [{ label: "Bouquets", href: "/shop" }, { label: "Arrangements", href: "/shop" }, { label: "Gifts", href: "/shop" }] },
|
{ title: "Shop", items: [{ label: "Bouquets", href: "/shop" }, { label: "Arrangements", href: "/shop" }, { label: "Gifts", href: "/shop" }] },
|
||||||
{ title: "About Us", items: [{ label: "Our Story", href: "#about" }, { label: "Testimonials", href: "#testimonials" }, { label: "FAQ", href: "#faq" }] },
|
{ title: "About Us", items: [{ label: "Our Story", href: "/#about" }, { label: "Testimonials", href: "/#testimonials" }] },
|
||||||
{ title: "Support", items: [{ label: "Contact", href: "#contact" }, { label: "Delivery Info", href: "https://example.com/delivery" }, { label: "Privacy Policy", href: "https://example.com/privacy" }] }
|
{ title: "Support", items: [{ label: "Contact", href: "/#contact" }, { label: "Delivery Info", href: "https://example.com/delivery" }, { label: "Privacy Policy", href: "https://example.com/privacy" }] }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isLoading) {
|
const renderContent = () => {
|
||||||
return (
|
if (isLoading) {
|
||||||
<ThemeProvider
|
return (
|
||||||
defaultButtonVariant="elastic-effect"
|
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||||
defaultTextAnimation="reveal-blur"
|
<p className="text-foreground">Loading product...</p>
|
||||||
borderRadius="soft"
|
</main>
|
||||||
contentWidth="smallMedium"
|
);
|
||||||
sizing="mediumSizeLargeTitles"
|
}
|
||||||
background="none"
|
|
||||||
cardStyle="gradient-bordered"
|
if (!product) {
|
||||||
primaryButtonStyle="diagonal-gradient"
|
return (
|
||||||
secondaryButtonStyle="solid"
|
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||||
headingFontWeight="light"
|
<div className="text-center">
|
||||||
>
|
<p className="text-foreground mb-4">Product not found</p>
|
||||||
<ReactLenis root>
|
<button
|
||||||
<div id="navbar" data-section="navbar">
|
onClick={() => router.push("/shop")}
|
||||||
<NavbarStyleApple {...navbarProps} />
|
className="primary-button px-6 py-2 rounded-theme"
|
||||||
</div>
|
>
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
Back to Shop
|
||||||
<p className="text-foreground">Loading product...</p>
|
</button>
|
||||||
</main>
|
</div>
|
||||||
<div id="footer" data-section="footer">
|
</main>
|
||||||
<FooterMedia {...footerProps} />
|
);
|
||||||
</div>
|
}
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!product) {
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<div id="product-detail" data-section="product-detail">
|
||||||
defaultButtonVariant="elastic-effect"
|
<FeatureCardTwentyOne
|
||||||
defaultTextAnimation="reveal-blur"
|
title={product.name}
|
||||||
borderRadius="soft"
|
description={product.description}
|
||||||
contentWidth="smallMedium"
|
imageSrc={images[0]?.src || '/placeholders/placeholder1.webp'}
|
||||||
sizing="mediumSizeLargeTitles"
|
imageAlt={images[0]?.alt || product.name}
|
||||||
background="none"
|
mediaPosition="left"
|
||||||
cardStyle="gradient-bordered"
|
useInvertedBackground={false}
|
||||||
primaryButtonStyle="diagonal-gradient"
|
mediaAnimation="slide-up"
|
||||||
secondaryButtonStyle="solid"
|
accordionItems={[
|
||||||
headingFontWeight="light"
|
{ id: 'price', title: 'Price', content: product.price },
|
||||||
>
|
...(meta.sku ? [{ id: 'sku', title: 'SKU', content: meta.sku }] : []),
|
||||||
<ReactLenis root>
|
...(product.rating ? [{ id: 'rating', title: 'Rating', content: `${product.rating}/5` }] : []),
|
||||||
<div id="navbar" data-section="navbar">
|
]}
|
||||||
<NavbarStyleApple {...navbarProps} />
|
buttons={[
|
||||||
</div>
|
{ text: "Add To Cart", onClick: handleAddToCart },
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
{ text: "Buy Now", onClick: handleBuyNow },
|
||||||
<div className="text-center">
|
]}
|
||||||
<p className="text-foreground mb-4">Product not found</p>
|
/>
|
||||||
<button
|
</div>
|
||||||
onClick={() => router.push("/shop")}
|
|
||||||
className="primary-button px-6 py-2 rounded-theme"
|
|
||||||
>
|
|
||||||
Back to Shop
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<div id="footer" data-section="footer">
|
|
||||||
<FooterMedia {...footerProps} />
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
@@ -175,50 +158,26 @@ export default function ProductPage({ params }: ProductPageProps) {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="navbar" data-section="navbar">
|
<NavbarStyleApple {...navbarProps} />
|
||||||
<NavbarStyleApple {...navbarProps} />
|
</div>
|
||||||
</div>
|
{renderContent()}
|
||||||
<div id="product-detail-card" data-section="product-detail-card">
|
<ProductCart
|
||||||
<ProductDetailCard
|
isOpen={cartOpen}
|
||||||
layout="page"
|
onClose={() => setCartOpen(false)}
|
||||||
name={product.name}
|
items={cartItems}
|
||||||
price={product.price}
|
onQuantityChange={updateQuantity}
|
||||||
salePrice={meta.salePrice}
|
onRemove={removeItem}
|
||||||
rating={product.rating || 0}
|
total={`$${cartTotal}`}
|
||||||
description={product.description}
|
buttons={[
|
||||||
images={images}
|
{
|
||||||
variants={variants.length > 0 ? variants : undefined}
|
text: isCheckoutLoading ? "Processing..." : "Check Out", onClick: handleCheckout,
|
||||||
quantity={quantityVariant}
|
},
|
||||||
ribbon={meta.ribbon}
|
]}
|
||||||
inventoryStatus={meta.inventoryStatus}
|
/>
|
||||||
inventoryQuantity={meta.inventoryQuantity}
|
<div id="footer" data-section="footer">
|
||||||
sku={meta.sku}
|
<FooterMedia {...footerProps} />
|
||||||
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>
|
|
||||||
<div id="footer" data-section="footer">
|
|
||||||
<FooterMedia {...footerProps} />
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,29 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useCallback } from "react";
|
import React, { useCallback } from "react";
|
||||||
import ReactLenis from "lenis/react";
|
import { useRouter } from 'next/navigation';
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
|
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
|
||||||
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
import FooterMedia from '@/components/sections/footer/FooterMedia';
|
||||||
import ProductCatalog from "@/components/ecommerce/productCatalog/ProductCatalog";
|
import ProductCardOne from "@/components/sections/product/ProductCardOne";
|
||||||
import ProductCart from "@/components/ecommerce/cart/ProductCart";
|
import ProductCart from "@/components/ecommerce/cart/ProductCart";
|
||||||
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
||||||
import { useCart } from "@/hooks/useCart";
|
import { useCart } from "@/hooks/useCart";
|
||||||
import { useCheckout } from "@/hooks/useCheckout";
|
import { useCheckout } from "@/hooks/useCheckout";
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Home", id: "/" },
|
||||||
|
{ name: "Products", id: "/shop" },
|
||||||
|
{ name: "About", id: "/#about" },
|
||||||
|
{ name: "Testimonials", id: "/#testimonials" },
|
||||||
|
{ name: "Contact", id: "/#contact" },
|
||||||
|
];
|
||||||
|
|
||||||
export default function ShopPage() {
|
export default function ShopPage() {
|
||||||
|
const router = useRouter();
|
||||||
const {
|
const {
|
||||||
products,
|
products,
|
||||||
isLoading,
|
isLoading,
|
||||||
search,
|
|
||||||
setSearch,
|
|
||||||
filters,
|
|
||||||
} = useProductCatalog({ basePath: "/shop" });
|
} = useProductCatalog({ basePath: "/shop" });
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -41,23 +47,17 @@ export default function ShopPage() {
|
|||||||
await checkout(getCheckoutItems(), { successUrl: currentUrl.toString() });
|
await checkout(getCheckoutItems(), { successUrl: currentUrl.toString() });
|
||||||
}, [cartItems, checkout, getCheckoutItems]);
|
}, [cartItems, checkout, getCheckoutItems]);
|
||||||
|
|
||||||
|
const cartCount = cartItems.length;
|
||||||
const navbarProps = {
|
const navbarProps = {
|
||||||
brandName: "Persik", navItems: [
|
brandName: "Persik", navItems: navItems,
|
||||||
{ name: "Home", id: "/" },
|
button: { text: `Cart (${cartCount})`, onClick: () => setCartOpen(true) },
|
||||||
{ name: "Shop", id: "/shop" },
|
|
||||||
{ name: "About", id: "#about" },
|
|
||||||
{ name: "Testimonials", id: "#testimonials" },
|
|
||||||
{ name: "FAQ", id: "#faq" },
|
|
||||||
{ name: "Contact", id: "#contact" }
|
|
||||||
],
|
|
||||||
button: { text: "Cart", onClick: () => setCartOpen(true) },
|
|
||||||
mobileNavContent: (
|
mobileNavContent: (
|
||||||
<div className="flex flex-col gap-2 mt-4">
|
<div className="flex flex-col gap-2 mt-4">
|
||||||
<button
|
<button
|
||||||
onClick={() => setCartOpen(true)}
|
onClick={() => setCartOpen(true)}
|
||||||
className="w-full text-left p-2 rounded-md hover:bg-muted/50"
|
className="w-full text-left p-2 rounded-md hover:bg-muted/50"
|
||||||
>
|
>
|
||||||
Cart
|
Cart ({cartCount})
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -66,40 +66,11 @@ export default function ShopPage() {
|
|||||||
const footerProps = {
|
const footerProps = {
|
||||||
imageSrc: "https://img.b2bpic.net/free-photo/woman-holds-festive-flower-arrangement-with-bright-chrysanthemum-flowers_169016-51483.jpg?_wi=3", imageAlt: "Soft focus background image of various flowers", logoText: "Persik Flowers", copyrightText: "© 2024 Persik | All rights reserved", columns: [
|
imageSrc: "https://img.b2bpic.net/free-photo/woman-holds-festive-flower-arrangement-with-bright-chrysanthemum-flowers_169016-51483.jpg?_wi=3", imageAlt: "Soft focus background image of various flowers", logoText: "Persik Flowers", copyrightText: "© 2024 Persik | All rights reserved", columns: [
|
||||||
{ title: "Shop", items: [{ label: "Bouquets", href: "/shop" }, { label: "Arrangements", href: "/shop" }, { label: "Gifts", href: "/shop" }] },
|
{ title: "Shop", items: [{ label: "Bouquets", href: "/shop" }, { label: "Arrangements", href: "/shop" }, { label: "Gifts", href: "/shop" }] },
|
||||||
{ title: "About Us", items: [{ label: "Our Story", href: "#about" }, { label: "Testimonials", href: "#testimonials" }, { label: "FAQ", href: "#faq" }] },
|
{ title: "About Us", items: [{ label: "Our Story", href: "/#about" }, { label: "Testimonials", href: "/#testimonials" }] },
|
||||||
{ title: "Support", items: [{ label: "Contact", href: "#contact" }, { label: "Delivery Info", href: "https://example.com/delivery" }, { label: "Privacy Policy", href: "https://example.com/privacy" }] }
|
{ title: "Support", items: [{ label: "Contact", href: "/#contact" }, { label: "Delivery Info", href: "https://example.com/delivery" }, { label: "Privacy Policy", href: "https://example.com/privacy" }] }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return (
|
|
||||||
<ThemeProvider
|
|
||||||
defaultButtonVariant="elastic-effect"
|
|
||||||
defaultTextAnimation="reveal-blur"
|
|
||||||
borderRadius="soft"
|
|
||||||
contentWidth="smallMedium"
|
|
||||||
sizing="mediumSizeLargeTitles"
|
|
||||||
background="none"
|
|
||||||
cardStyle="gradient-bordered"
|
|
||||||
primaryButtonStyle="diagonal-gradient"
|
|
||||||
secondaryButtonStyle="solid"
|
|
||||||
headingFontWeight="light"
|
|
||||||
>
|
|
||||||
<ReactLenis root>
|
|
||||||
<div id="navbar" data-section="navbar">
|
|
||||||
<NavbarStyleApple {...navbarProps} />
|
|
||||||
</div>
|
|
||||||
<main className="min-h-screen flex items-center justify-center pt-20">
|
|
||||||
<p className="text-foreground">Loading products...</p>
|
|
||||||
</main>
|
|
||||||
<div id="footer" data-section="footer">
|
|
||||||
<FooterMedia {...footerProps} />
|
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
defaultButtonVariant="elastic-effect"
|
defaultButtonVariant="elastic-effect"
|
||||||
@@ -113,40 +84,49 @@ export default function ShopPage() {
|
|||||||
secondaryButtonStyle="solid"
|
secondaryButtonStyle="solid"
|
||||||
headingFontWeight="light"
|
headingFontWeight="light"
|
||||||
>
|
>
|
||||||
<ReactLenis root>
|
<div id="nav" data-section="nav">
|
||||||
<div id="navbar" data-section="navbar">
|
<NavbarStyleApple {...navbarProps} />
|
||||||
<NavbarStyleApple {...navbarProps} />
|
</div>
|
||||||
</div>
|
{isLoading ? (
|
||||||
|
<main className="min-h-screen flex items-center justify-center pt-20">
|
||||||
|
<p className="text-foreground">Loading products...</p>
|
||||||
|
</main>
|
||||||
|
) : (
|
||||||
<div id="product-catalog" data-section="product-catalog">
|
<div id="product-catalog" data-section="product-catalog">
|
||||||
<ProductCatalog
|
<ProductCardOne
|
||||||
layout="page"
|
title="Our Products"
|
||||||
products={products}
|
description="Browse our collection of beautiful flowers."
|
||||||
searchValue={search}
|
products={products.map((p: any) => ({
|
||||||
onSearchChange={setSearch}
|
id: p.id,
|
||||||
searchPlaceholder="Search products..."
|
name: p.name,
|
||||||
filters={filters}
|
price: p.price,
|
||||||
emptyMessage="No products found"
|
imageSrc: p.images?.[0]?.src || '/placeholders/placeholder1.webp',
|
||||||
|
imageAlt: p.images?.[0]?.alt || p.name,
|
||||||
|
onProductClick: () => router.push(`/shop/${p.id}`),
|
||||||
|
}))}
|
||||||
|
gridVariant="four-items-2x2-equal-grid"
|
||||||
|
animationType="slide-up"
|
||||||
|
textboxLayout="default"
|
||||||
|
useInvertedBackground={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="product-cart" data-section="product-cart">
|
)}
|
||||||
<ProductCart
|
<ProductCart
|
||||||
isOpen={cartOpen}
|
isOpen={cartOpen}
|
||||||
onClose={() => setCartOpen(false)}
|
onClose={() => setCartOpen(false)}
|
||||||
items={cartItems}
|
items={cartItems}
|
||||||
onQuantityChange={updateQuantity}
|
onQuantityChange={updateQuantity}
|
||||||
onRemove={removeItem}
|
onRemove={removeItem}
|
||||||
total={`$${cartTotal}`}
|
total={`$${cartTotal}`}
|
||||||
buttons={[
|
buttons={[
|
||||||
{
|
{
|
||||||
text: isCheckoutLoading ? "Processing..." : "Check Out", onClick: handleCheckout,
|
text: isCheckoutLoading ? "Processing..." : "Check Out", onClick: handleCheckout,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
<div id="footer" data-section="footer">
|
||||||
<div id="footer" data-section="footer">
|
<FooterMedia {...footerProps} />
|
||||||
<FooterMedia {...footerProps} />
|
</div>
|
||||||
</div>
|
|
||||||
</ReactLenis>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user