95 lines
4.2 KiB
TypeScript
95 lines
4.2 KiB
TypeScript
"use client";
|
|
|
|
import ReactLenis from "lenis/react";
|
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
|
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
|
|
import FooterSimple from '@/components/sections/footer/FooterSimple';
|
|
import ProductCatalog from "@/components/ecommerce/productCatalog/ProductCatalog";
|
|
import { useProductCatalog } from "@/hooks/useProductCatalog";
|
|
|
|
export default function ShopPage() {
|
|
const {
|
|
products,
|
|
isLoading,
|
|
search,
|
|
setSearch,
|
|
filters,
|
|
} = useProductCatalog({ basePath: "/shop" });
|
|
|
|
// themeProviderProps object removed, props are now directly on ThemeProvider
|
|
|
|
const navbarProps = {"navItems":[{"name":"Home","id":"/"},{"name":"Adopt","id":"/adopt"},{"name":"About Us","id":"/about"},{"name":"Contact","id":"/contact"},{"name":"Blog","id":"/blog"},{"name":"Shop","id":"/shop"}],"brandName":"Paws & Hearts","bottomLeftText":"Connecting Pets & People","bottomRightText":"hello@pawsandhearts.org","logoHref":"/"};
|
|
|
|
const footerProps = {"columns":[{"title":"Navigate","items":[{"label":"Home","href":"/"},{"label":"Adopt","href":"/adopt"},{"label":"":"About Us","href":"/about"}]},{"title":"Support","items":[{"label":"Volunteer","href":"/contact"},{"label":"Donate","href":"/contact"},{"label":"Foster","href":"/contact"}]},{"title":"Connect","items":[{"label":"Contact Us","href":"/contact"},{"label":"FAQ","href":"/contact"},{"label":"Privacy Policy","href":"/privacy"}]}],"bottomLeftText":"© 2024 Paws & Hearts Shelter. All rights reserved.","bottomRightText":"Made with Love & Paws"};
|
|
|
|
if (isLoading) {
|
|
return (
|
|
<ThemeProvider
|
|
defaultButtonVariant="icon-arrow"
|
|
defaultTextAnimation="background-highlight"
|
|
borderRadius="sharp"
|
|
contentWidth="smallMedium"
|
|
sizing="mediumLarge"
|
|
background="floatingGradient"
|
|
cardStyle="glass-depth"
|
|
primaryButtonStyle="gradient"
|
|
secondaryButtonStyle="solid"
|
|
headingFontWeight="semibold"
|
|
>
|
|
<ReactLenis root>
|
|
<div id="navbar" data-section="navbar">
|
|
<NavbarStyleFullscreen
|
|
{...navbarProps}
|
|
/>
|
|
</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>
|
|
<div id="footer" data-section="footer">
|
|
<FooterSimple {...footerProps} />
|
|
</div>
|
|
</ReactLenis>
|
|
</ThemeProvider>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<ThemeProvider
|
|
defaultButtonVariant="icon-arrow"
|
|
defaultTextAnimation="background-highlight"
|
|
borderRadius="sharp"
|
|
contentWidth="smallMedium"
|
|
sizing="mediumLarge"
|
|
background="floatingGradient"
|
|
cardStyle="glass-depth"
|
|
primaryButtonStyle="gradient"
|
|
secondaryButtonStyle="solid"
|
|
headingFontWeight="semibold"
|
|
>
|
|
<ReactLenis root>
|
|
<div id="navbar" data-section="navbar">
|
|
<NavbarStyleFullscreen
|
|
{...navbarProps}
|
|
/>
|
|
</div>
|
|
<div id="product-catalog-section" data-section="product-catalog-section">
|
|
<ProductCatalog
|
|
layout="page"
|
|
products={products}
|
|
searchValue={search}
|
|
onSearchChange={setSearch}
|
|
searchPlaceholder="Search products..."
|
|
filters={filters}
|
|
emptyMessage="No products found"
|
|
/>
|
|
</div>
|
|
<div id="footer" data-section="footer">
|
|
<FooterSimple {...footerProps} />
|
|
</div>
|
|
</ReactLenis>
|
|
</ThemeProvider>
|
|
);
|
|
}
|