storefront-layouts 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/route-skeleton-loader.d.ts.map +1 -1
- package/dist/components/ui/route-skeleton-loader.js +6 -1
- package/dist/editor/alignment-schemas/booking-footer-section.d.ts.map +1 -1
- package/dist/editor/alignment-schemas/booking-footer-section.js +0 -1
- package/dist/editor/alignment-schemas/clothing.d.ts.map +1 -1
- package/dist/editor/alignment-schemas/clothing.js +0 -1
- package/dist/editor/alignment-schemas/food.d.ts.map +1 -1
- package/dist/editor/alignment-schemas/food.js +0 -1
- package/dist/hooks/use-category-products.d.ts +5 -1
- package/dist/hooks/use-category-products.d.ts.map +1 -1
- package/dist/hooks/use-category-products.js +8 -5
- package/dist/hooks/use-filtered-products-fetch.d.ts +12 -0
- package/dist/hooks/use-filtered-products-fetch.d.ts.map +1 -0
- package/dist/hooks/use-filtered-products-fetch.js +58 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -1
- package/dist/layouts/booking/components/BookingHomePage.js +3 -1
- package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/AboutPage.js +3 -1
- package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/CategoryPage.js +3 -1
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ServicesPage.js +4 -2
- package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/AboutPage.js +3 -1
- package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/CategoryPage.js +3 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ServicesPage.js +4 -2
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
- package/dist/layouts/clothing/components/ClothingHomePage.js +5 -4
- package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/AboutPage.js +2 -1
- package/dist/layouts/clothing/pages/CategoriesPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/CategoriesPage.js +3 -2
- package/dist/layouts/clothing/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/CategoryPage.js +4 -3
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductDetailPage.js +3 -2
- package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductsPage.js +53 -60
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +4 -3
- package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/AboutPage.js +2 -1
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +3 -2
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/CategoryPage.js +4 -3
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductsPage.js +53 -60
- package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsHomePage.js +2 -1
- package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsProductsPage.js +45 -36
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +2 -1
- package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/AboutPage.js +3 -1
- package/dist/layouts/electronics/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/CategoryPage.js +4 -3
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductsPage.js +53 -60
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +2 -1
- package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/AboutPage.js +3 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.js +4 -3
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductsPage.js +53 -60
- package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
- package/dist/layouts/food/components/FoodHomePage.js +6 -4
- package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/AboutPage.js +2 -1
- package/dist/layouts/food/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/CategoryPage.js +5 -3
- package/dist/layouts/food/pages/MenuPage.js +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductsPage.js +51 -54
- package/dist/layouts/food-modern/components/FoodHomePageModern.d.ts.map +1 -1
- package/dist/layouts/food-modern/components/FoodHomePageModern.js +4 -2
- package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/AboutPage.js +3 -1
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/CategoryPage.js +5 -3
- package/dist/layouts/food-modern/pages/MenuPage.js +1 -1
- package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductsPage.js +51 -54
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +4 -2
- package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/AboutPage.js +3 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.js +6 -4
- package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ProductsPage.js +53 -60
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +2 -1
- package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ServicesPage.js +4 -2
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +3 -2
- package/dist/layouts/shared/components/StoreFooter.d.ts.map +1 -1
- package/dist/layouts/shared/components/StoreFooter.js +3 -13
- package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/PortfolioPage.js +2 -1
- package/dist/layouts/shared/pages/StoreMaintenanceScreen.d.ts +9 -0
- package/dist/layouts/shared/pages/StoreMaintenanceScreen.d.ts.map +1 -0
- package/dist/layouts/shared/pages/StoreMaintenanceScreen.js +10 -0
- package/dist/layouts/shared/pages/StoreOfflinePage.d.ts +19 -0
- package/dist/layouts/shared/pages/StoreOfflinePage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/StoreOfflinePage.js +113 -0
- package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/WishlistPage.js +11 -14
- package/dist/lib/content-selectors.js +3 -3
- package/dist/lib/layout-route-utils.d.ts +1 -0
- package/dist/lib/layout-route-utils.d.ts.map +1 -1
- package/dist/lib/layout-route-utils.js +1 -1
- package/dist/lib/services/product.service.d.ts +1 -0
- package/dist/lib/services/product.service.d.ts.map +1 -1
- package/dist/lib/store-context.d.ts +1 -0
- package/dist/lib/store-context.d.ts.map +1 -1
- package/dist/lib/store-context.js +1 -0
- package/dist/lib/utils/catalog-price-bounds.d.ts +2 -0
- package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -1
- package/dist/lib/utils/catalog-price-bounds.js +21 -0
- package/dist/lib/utils/filtered-product-query.d.ts +22 -0
- package/dist/lib/utils/filtered-product-query.d.ts.map +1 -0
- package/dist/lib/utils/filtered-product-query.js +57 -0
- package/dist/lib/utils/filtered-products-inflight.d.ts +3 -0
- package/dist/lib/utils/filtered-products-inflight.d.ts.map +1 -0
- package/dist/lib/utils/filtered-products-inflight.js +15 -0
- package/dist/lib/utils/url-helpers.d.ts.map +1 -1
- package/dist/lib/utils/url-helpers.js +2 -11
- package/dist/styles/index.css +33 -6
- package/package.json +2 -2
|
@@ -10,13 +10,16 @@ import { useToast } from '../../../components/ui/toast.js';
|
|
|
10
10
|
import { useLoading } from '../../../lib/loading-context.js';
|
|
11
11
|
import { useAnalytics } from '../../../hooks/use-analytics.js';
|
|
12
12
|
import { Check, Search, RotateCcw, SlidersHorizontal } from 'lucide-react';
|
|
13
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
13
14
|
import { useSearchParams } from 'next/navigation';
|
|
14
|
-
import { useState, useMemo, useEffect,
|
|
15
|
+
import { useState, useMemo, useEffect, Suspense } from 'react';
|
|
16
|
+
import { useFilteredProductsFetch } from '../../../hooks/use-filtered-products-fetch.js';
|
|
15
17
|
import { formatCurrency } from '../../../lib/utils/index.js';
|
|
16
18
|
import { getBannerImage, getLayoutText } from '../../../lib/utils/asset-helpers.js';
|
|
17
19
|
import { shouldUseAPI } from '../../../lib/utils/demo-detection.js';
|
|
18
20
|
import { useCatalogPriceRange } from '../../../hooks/use-catalog-price-range.js';
|
|
19
|
-
import { isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds.js';
|
|
21
|
+
import { getApiPriceFilterActive, isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds.js';
|
|
22
|
+
import { buildFilteredProductQuery, getFilteredProductQueryKey, } from '../../../lib/utils/filtered-product-query.js';
|
|
20
23
|
import { ProductPriceFilterSection } from '../../shared/components/ProductPriceFilterSection';
|
|
21
24
|
import { productService } from '../../../lib/services/product.service.js';
|
|
22
25
|
import { transformProductToStoreProduct } from '../../../lib/store-config-utils.js';
|
|
@@ -51,7 +54,8 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
|
|
|
51
54
|
// State for filters & sort
|
|
52
55
|
const [selectedCategories, setSelectedCategories] = useState([]);
|
|
53
56
|
const storeCurrency = storeConfig.settings?.currency || 'NGN';
|
|
54
|
-
const
|
|
57
|
+
const bootstrapMenuItems = storeConfig.menuItems?.length ? storeConfig.menuItems : menuItems;
|
|
58
|
+
const { priceRange, setPriceRange, catalogBounds, resetPriceRange, hasActivePriceFilter, } = useCatalogPriceRange(bootstrapMenuItems);
|
|
55
59
|
const [selectedCategoryFilter, setSelectedCategoryFilter] = useState(null);
|
|
56
60
|
const [searchQuery, setSearchQuery] = useState('');
|
|
57
61
|
// Initialize filters from URL
|
|
@@ -110,57 +114,50 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
|
|
|
110
114
|
}
|
|
111
115
|
return result;
|
|
112
116
|
}, [menuItems, selectedCategories, priceRange, selectedCategoryFilter, sortBy, searchQuery, categories]);
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return {
|
|
117
|
+
const hasApiPriceFilter = getApiPriceFilterActive(priceRange, bootstrapMenuItems);
|
|
118
|
+
const priceQueryMin = hasApiPriceFilter ? priceRange[0] : undefined;
|
|
119
|
+
const priceQueryMax = hasApiPriceFilter ? priceRange[1] : undefined;
|
|
120
|
+
const { productQueryParams, productQueryKey } = useMemo(() => {
|
|
121
|
+
const params = buildFilteredProductQuery({
|
|
119
122
|
storeId: storeConfig.id,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
categories,
|
|
124
|
+
effectiveCategoryIds: selectedCategories,
|
|
125
|
+
selectedCategoryFilter,
|
|
126
|
+
expandSelectedCategoryFilter: false,
|
|
127
|
+
search: searchQuery,
|
|
128
|
+
priceRange,
|
|
129
|
+
hasActivePriceFilter: hasApiPriceFilter,
|
|
124
130
|
sortBy,
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
productQueryParams: params,
|
|
134
|
+
productQueryKey: getFilteredProductQueryKey(params),
|
|
125
135
|
};
|
|
126
|
-
}, [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
catch (error) {
|
|
153
|
-
if (!cancelled)
|
|
154
|
-
console.error('Failed to fetch menu items:', error);
|
|
155
|
-
}
|
|
156
|
-
finally {
|
|
157
|
-
if (!cancelled)
|
|
158
|
-
setIsLoadingProducts(false);
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const timer = window.setTimeout(fetchFilteredProducts, searchQuery ? 250 : 0);
|
|
162
|
-
return () => { cancelled = true; window.clearTimeout(timer); };
|
|
163
|
-
}, [productQuery, searchQuery]);
|
|
136
|
+
}, [
|
|
137
|
+
storeConfig.id,
|
|
138
|
+
categories,
|
|
139
|
+
selectedCategories,
|
|
140
|
+
selectedCategoryFilter,
|
|
141
|
+
searchQuery,
|
|
142
|
+
hasApiPriceFilter,
|
|
143
|
+
priceQueryMin,
|
|
144
|
+
priceQueryMax,
|
|
145
|
+
sortBy,
|
|
146
|
+
]);
|
|
147
|
+
useFilteredProductsFetch(productQueryParams, productQueryKey, {
|
|
148
|
+
bootstrapItemCount: storeConfig.menuItems?.length ?? menuItems.length,
|
|
149
|
+
bootstrapTotal: storeConfig.productsTotal,
|
|
150
|
+
debounceMs: searchQuery ? 250 : 0,
|
|
151
|
+
mapResponse: (data) => toMenuItems(data),
|
|
152
|
+
applyResults: (items, total) => {
|
|
153
|
+
setMenuItems(items);
|
|
154
|
+
setCurrentPage(1);
|
|
155
|
+
setTotalProducts(total);
|
|
156
|
+
setVisibleProducts(12);
|
|
157
|
+
},
|
|
158
|
+
setTotalProducts,
|
|
159
|
+
setLoading: setIsLoadingProducts,
|
|
160
|
+
});
|
|
164
161
|
const displayedItems = filteredAndSortedItems.slice(0, visibleProducts);
|
|
165
162
|
const hasMore = currentPage * 12 < totalProducts;
|
|
166
163
|
const handleLoadMore = async () => {
|
|
@@ -169,7 +166,7 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
|
|
|
169
166
|
setIsLoadingProducts(true);
|
|
170
167
|
try {
|
|
171
168
|
const nextPage = currentPage + 1;
|
|
172
|
-
const response = await productService.getProducts({ ...
|
|
169
|
+
const response = await productService.getProducts({ ...productQueryParams, page: nextPage, limit: 12 });
|
|
173
170
|
setMenuItems((current) => [...current, ...toMenuItems(response.data)]);
|
|
174
171
|
setCurrentPage(nextPage);
|
|
175
172
|
setTotalProducts(response.meta.total);
|
|
@@ -243,7 +240,7 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
|
|
|
243
240
|
const secondaryButtonText = hasSecondaryButtonFromConfig
|
|
244
241
|
? (categoryHeaderSecondaryButton && categoryHeaderSecondaryButton.trim() !== '' ? categoryHeaderSecondaryButton.trim() : null)
|
|
245
242
|
: getLayoutText(storeConfig, 'sections.categories.viewAll', 'View Categories');
|
|
246
|
-
return (_jsxs("div", { className: "min-h-screen bg-white font-sans text-slate-900", children: [productsConfig?.productsHeader?.show !== false && (_jsxs("div", { className: "relative overflow-hidden bg-white", children: [categoryHeaderImage && (_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(ImageWithFallback, { src: categoryHeaderImage, alt: productsConfig?.productsHeader?.title || categoryHeaderTitle || storeConfig.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/60 via-black/40 to-black/60" })] })), !categoryHeaderImage && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full overflow-hidden z-0 pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[500px] h-[500px] bg-gray-100 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-10%] w-[400px] h-[400px] bg-gray-50 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow", style: { animationDelay: '2s' } })] })), _jsx("div", { className: `container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 pt-12 pb-16 lg:pt-20 lg:pb-24 ${categoryHeaderImage ? 'min-h-[500px] flex items-center' : ''}`, children: _jsx("div", { className: "flex flex-col items-center w-full max-w-4xl mx-auto", children: _jsxs("div", { className: `w-full text-center lg:text-left animate-fade-in-up ${categoryHeaderImage ? 'text-white' : ''}`, children: [_jsx("div", { className: "flex justify-center lg:justify-start mb-6", children: _jsx("div", { className: categoryHeaderImage ? 'bg-white/10 backdrop-blur-md px-4 py-2 rounded-full border border-white/20' : '', children: _jsx(Breadcrumbs, { items: breadcrumbItems, variant: categoryHeaderImage ? 'light' : 'default' }) }) }),
|
|
243
|
+
return (_jsxs("div", { className: "min-h-screen bg-white font-sans text-slate-900", children: [productsConfig?.productsHeader?.show !== false && (_jsxs("div", { className: "relative overflow-hidden bg-white", children: [categoryHeaderImage && (_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(ImageWithFallback, { src: categoryHeaderImage, alt: productsConfig?.productsHeader?.title || categoryHeaderTitle || storeConfig.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/60 via-black/40 to-black/60" })] })), !categoryHeaderImage && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full overflow-hidden z-0 pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[500px] h-[500px] bg-gray-100 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-10%] w-[400px] h-[400px] bg-gray-50 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow", style: { animationDelay: '2s' } })] })), _jsx("div", { className: `container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 pt-12 pb-16 lg:pt-20 lg:pb-24 ${categoryHeaderImage ? 'min-h-[500px] flex items-center' : ''}`, children: _jsx("div", { className: "flex flex-col items-center w-full max-w-4xl mx-auto", children: _jsxs("div", { className: `w-full text-center lg:text-left animate-fade-in-up ${categoryHeaderImage ? 'text-white' : ''}`, children: [_jsx("div", { className: "flex justify-center lg:justify-start mb-6", children: _jsx("div", { className: categoryHeaderImage ? 'bg-white/10 backdrop-blur-md px-4 py-2 rounded-full border border-white/20' : '', children: _jsx(Breadcrumbs, { items: breadcrumbItems, variant: categoryHeaderImage ? 'light' : 'default' }) }) }), _jsx("h1", { className: `text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight mb-6 leading-[1.1] ${categoryHeaderImage ? 'text-white' : 'text-gray-900'}`, children: productsConfig?.productsHeader?.title || categoryHeaderTitle || (_jsxs(_Fragment, { children: ["Explore The Collections of ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-gray-900 via-gray-700 to-gray-900", children: storeConfig.name })] })) }), _jsx("p", { className: `text-lg mb-8 leading-relaxed max-w-lg mx-auto lg:mx-0 ${categoryHeaderImage ? 'text-white/90' : 'text-gray-600'}`, children: getLayoutText(storeConfig, 'category_header:description', "Don't miss out on shopping our latest collection! curated for quality and style. Experience the perfect blend of modern aesthetics and premium craftsmanship.") }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 justify-center lg:justify-start", children: [primaryButtonText && primaryButtonText.trim() !== '' && (_jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${categoryHeaderImage ? 'bg-white text-gray-900 hover:bg-gray-100' : ''}`, onClick: () => {
|
|
247
244
|
const element = document.getElementById('product-grid');
|
|
248
245
|
element?.scrollIntoView({ behavior: 'smooth' });
|
|
249
246
|
}, children: primaryButtonText })), secondaryButtonText && secondaryButtonText.trim() !== '' && (_jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${categoryHeaderImage ? 'bg-white/10 backdrop-blur-md text-white border border-white/30 hover:bg-white/20' : 'bg-gray-100 text-gray-900 hover:bg-gray-200 border border-gray-200'}`, onClick: () => {
|
|
@@ -252,7 +249,7 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
|
|
|
252
249
|
? 'bg-gray-900 text-white hover:bg-blue-600'
|
|
253
250
|
: 'bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600'}`, children: "All" }), categories.map((category) => (_jsx("button", { onClick: () => setSelectedCategoryFilter(selectedCategoryFilter === category.slug ? null : category.slug), className: `px-6 py-2.5 rounded-lg text-sm font-semibold whitespace-nowrap transition-all ${selectedCategoryFilter === category.slug
|
|
254
251
|
? 'bg-gray-900 text-white hover:bg-blue-600'
|
|
255
|
-
: 'bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600'}`, children: category.name }, category.id)))] }), _jsxs("div", { id: "product-grid", className: "grid grid-cols-1 lg:grid-cols-4 gap-8", children: [_jsxs("aside", { className: "hidden lg:block col-span-1 space-y-8 sticky top-24 h-fit max-h-[calc(100vh-8rem)] overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent", children: [_jsxs("div", { className: "flex items-center justify-between pb-4 border-b border-gray-100", children: [_jsx("h2", { className: "text-xl font-bold text-gray-900", children: "Filters" }), hasActiveFilters && (_jsxs("button", { onClick: clearAllFilters, className: "text-xs font-medium text-red-500 hover:text-red-700 flex items-center gap-1", children: [_jsx(RotateCcw, { className: "h-3 w-3" }), " Reset"] }))] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Search" }), _jsxs("div", { className: "relative", children: [_jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), _jsx("input", { type: "text", placeholder: "Search items...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "w-full pl-10 pr-4 py-2 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-orange-500/20 focus:border-orange-500 transition-all" })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Category" }), _jsx("div", { className: "space-y-2", children: categories.map((category) => (_jsxs("label", { className: "flex items-center gap-3 cursor-pointer group p-2 -ml-2 rounded-lg hover:bg-gray-50 transition-colors", children: [_jsx("div", { className: `w-5 h-5 rounded border flex items-center justify-center transition-colors ${selectedCategories.includes(category.id) ? 'bg-orange-500 border-orange-500' : 'border-gray-300 group-hover:border-orange-400'}`, children: selectedCategories.includes(category.id) && _jsx(Check, { className: "h-3 w-3 text-white" }) }), _jsx("input", { type: "checkbox", className: "hidden", checked: selectedCategories.includes(category.id), onChange: () => setSelectedCategories(prev => prev.includes(category.id) ? prev.filter(id => id !== category.id) : [...prev, category.id]) }), _jsx("span", { className: "text-sm text-gray-700 font-medium", children: category.name })] }, category.id))) })] }), _jsx(ProductPriceFilterSection, { currency: storeCurrency, priceRange: priceRange, onPriceRangeChange: setPriceRange, bounds: catalogBounds, isFilterActive: hasActivePriceFilter, onReset: resetPriceRange })] }), _jsxs("div", { className: "lg:col-span-3", children: [_jsxs("div", { className: "lg:hidden mb-6 flex items-center justify-between", children: [_jsxs(Button, { onClick: () => setIsFilterOpen(true), variant: "outline", className: "flex items-center gap-2", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), " Filters"] }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-700 focus:outline-none", children: [_jsx("option", { value: "featured", children: "Sort by: Featured" }), _jsx("option", { value: "price-asc", children: "Sort by: Price Low-High" }), _jsx("option", { value: "price-desc", children: "Sort by: Price High-Low" })] })] }), _jsxs("div", { className: "hidden lg:flex items-center justify-between mb-6", children: [_jsxs("p", { className: "text-sm text-gray-600", children: ["Showing ", _jsx("span", { className: "font-semibold text-gray-900", children: filteredAndSortedItems.length }), " items"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm text-gray-500", children: "Sort by:" }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-900 focus:outline-none cursor-pointer hover:text-orange-600 transition-colors", children: [_jsx("option", { value: "featured", children: "Featured" }), _jsx("option", { value: "price-asc", children: "Price: Low to High" }), _jsx("option", { value: "price-desc", children: "Price: High to Low" })] })] })] }), isFiltering ? (_jsx(ProductGridSkeleton, { count: 12, columns: 3 })) : displayedItems.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: displayedItems.map((item) => (_jsxs("div", { className: "group bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-xl transition-all duration-300 border border-gray-100 flex flex-col h-full", children: [_jsxs("div", { className: "relative aspect-square overflow-hidden", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-full bg-white text-black hover:bg-orange-600 hover:text-white transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8", onClick: () => handleAddToCart(item), children: "Add to Order" }) })] }), _jsxs("div", { className: "p-5 flex flex-col flex-1", children: [_jsxs("div", { className: "flex justify-between items-start mb-2", children: [_jsx("h3", { className: "font-bold text-lg text-gray-900 leading-tight group-hover:text-orange-600 transition-colors", children: item.name }), _jsx("span", { className: "font-black text-lg text-gray-900 ml-2", children: formatCurrency(item.price, storeConfig.settings?.currency || 'USD') })] }), _jsx("p",
|
|
252
|
+
: 'bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600'}`, children: category.name }, category.id)))] }), _jsxs("div", { id: "product-grid", className: "grid grid-cols-1 lg:grid-cols-4 gap-8", children: [_jsxs("aside", { className: "hidden lg:block col-span-1 space-y-8 sticky top-24 h-fit max-h-[calc(100vh-8rem)] overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent", children: [_jsxs("div", { className: "flex items-center justify-between pb-4 border-b border-gray-100", children: [_jsx("h2", { className: "text-xl font-bold text-gray-900", children: "Filters" }), hasActiveFilters && (_jsxs("button", { onClick: clearAllFilters, className: "text-xs font-medium text-red-500 hover:text-red-700 flex items-center gap-1", children: [_jsx(RotateCcw, { className: "h-3 w-3" }), " Reset"] }))] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Search" }), _jsxs("div", { className: "relative", children: [_jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), _jsx("input", { type: "text", placeholder: "Search items...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "w-full pl-10 pr-4 py-2 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-orange-500/20 focus:border-orange-500 transition-all" })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Category" }), _jsx("div", { className: "space-y-2", children: categories.map((category) => (_jsxs("label", { className: "flex items-center gap-3 cursor-pointer group p-2 -ml-2 rounded-lg hover:bg-gray-50 transition-colors", children: [_jsx("div", { className: `w-5 h-5 rounded border flex items-center justify-center transition-colors ${selectedCategories.includes(category.id) ? 'bg-orange-500 border-orange-500' : 'border-gray-300 group-hover:border-orange-400'}`, children: selectedCategories.includes(category.id) && _jsx(Check, { className: "h-3 w-3 text-white" }) }), _jsx("input", { type: "checkbox", className: "hidden", checked: selectedCategories.includes(category.id), onChange: () => setSelectedCategories(prev => prev.includes(category.id) ? prev.filter(id => id !== category.id) : [...prev, category.id]) }), _jsx("span", { className: "text-sm text-gray-700 font-medium", children: category.name })] }, category.id))) })] }), _jsx(ProductPriceFilterSection, { currency: storeCurrency, priceRange: priceRange, onPriceRangeChange: setPriceRange, bounds: catalogBounds, isFilterActive: hasActivePriceFilter, onReset: resetPriceRange })] }), _jsxs("div", { className: "lg:col-span-3", children: [_jsxs("div", { className: "lg:hidden mb-6 flex items-center justify-between", children: [_jsxs(Button, { onClick: () => setIsFilterOpen(true), variant: "outline", className: "flex items-center gap-2", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), " Filters"] }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-700 focus:outline-none", children: [_jsx("option", { value: "featured", children: "Sort by: Featured" }), _jsx("option", { value: "price-asc", children: "Sort by: Price Low-High" }), _jsx("option", { value: "price-desc", children: "Sort by: Price High-Low" })] })] }), _jsxs("div", { className: "hidden lg:flex items-center justify-between mb-6", children: [_jsxs("p", { className: "text-sm text-gray-600", children: ["Showing ", _jsx("span", { className: "font-semibold text-gray-900", children: filteredAndSortedItems.length }), " items"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm text-gray-500", children: "Sort by:" }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-900 focus:outline-none cursor-pointer hover:text-orange-600 transition-colors", children: [_jsx("option", { value: "featured", children: "Featured" }), _jsx("option", { value: "price-asc", children: "Price: Low to High" }), _jsx("option", { value: "price-desc", children: "Price: High to Low" })] })] })] }), isFiltering ? (_jsx(ProductGridSkeleton, { count: 12, columns: 3 })) : displayedItems.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: displayedItems.map((item) => (_jsxs("div", { className: "group bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-xl transition-all duration-300 border border-gray-100 flex flex-col h-full", children: [_jsxs("div", { className: "relative aspect-square overflow-hidden", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-full bg-white text-black hover:bg-orange-600 hover:text-white transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8", onClick: () => handleAddToCart(item), children: "Add to Order" }) })] }), _jsxs("div", { className: "p-5 flex flex-col flex-1", children: [_jsxs("div", { className: "flex justify-between items-start mb-2", children: [_jsx("h3", { className: "font-bold text-lg text-gray-900 leading-tight group-hover:text-orange-600 transition-colors", children: item.name }), _jsx("span", { className: "font-black text-lg text-gray-900 ml-2", children: formatCurrency(item.price, storeConfig.settings?.currency || 'USD') })] }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-500 text-sm line-clamp-2 leading-relaxed flex-1" })] })] }, item.id))) }), hasMore && (_jsx("div", { className: "mt-12 text-center", children: _jsx(Button, { onClick: handleLoadMore, variant: "outline", className: "min-w-[200px] rounded-full font-bold h-12 border-gray-200 hover:border-orange-500 hover:text-orange-600", children: "Load More" }) }))] })) : (_jsxs("div", { className: "flex flex-col items-center justify-center py-20 bg-white rounded-3xl border border-dashed border-gray-200 text-center", children: [_jsx("div", { className: "w-16 h-16 bg-gray-50 rounded-full flex items-center justify-center mb-6 text-gray-300", children: _jsx(Search, { className: "h-8 w-8" }) }), _jsx("h3", { className: "text-xl font-bold text-gray-900 mb-2", children: "No items found" }), _jsx("p", { className: "text-gray-500 mb-8 max-w-sm mx-auto", children: "We couldn't find anything matching your filters. Try adjusting your search or clearing filters." }), _jsx(Button, { onClick: clearAllFilters, className: "rounded-full px-8 bg-gray-900 hover:bg-orange-600", children: "Clear All Filters" })] }))] })] })] }), _jsxs(Sheet, { isOpen: isFilterOpen, onClose: () => setIsFilterOpen(false), title: "Filters", side: "right", children: [_jsxs("div", { className: "flex flex-col h-full overflow-y-auto pb-24 space-y-8 p-1", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Search" }), _jsxs("div", { className: "relative", children: [_jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), _jsx("input", { type: "text", placeholder: "Search items...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "w-full pl-10 pr-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm outline-none focus:ring-2 focus:ring-orange-500/20" })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Categories" }), _jsx("div", { className: "space-y-3", children: categories.map((category) => (_jsxs("label", { className: "flex items-center gap-3", children: [_jsx("input", { type: "checkbox", checked: selectedCategories.includes(category.id), onChange: () => setSelectedCategories(prev => prev.includes(category.id) ? prev.filter(id => id !== category.id) : [...prev, category.id]), className: "w-5 h-5 rounded border-gray-300 text-orange-600 focus:ring-orange-500" }), _jsx("span", { className: "text-sm text-gray-700 font-medium", children: category.name })] }, category.id))) })] }), _jsx(ProductPriceFilterSection, { currency: storeCurrency, priceRange: priceRange, onPriceRangeChange: setPriceRange, bounds: catalogBounds, isFilterActive: hasActivePriceFilter, onReset: resetPriceRange })] }), _jsxs("div", { className: "absolute bottom-0 left-0 right-0 p-4 bg-white border-t border-gray-100 flex gap-3", children: [_jsx(Button, { onClick: clearAllFilters, variant: "outline", className: "flex-1 h-12 font-bold rounded-xl border-gray-300", children: "Reset" }), _jsx(Button, { onClick: () => setIsFilterOpen(false), className: "flex-[2] bg-orange-600 text-white hover:bg-orange-700 h-12 font-bold rounded-xl transition-colors", children: "View Results" })] })] })] }))] }));
|
|
256
253
|
}
|
|
257
254
|
export function ProductsPage(props) {
|
|
258
255
|
return (_jsx(Suspense, { fallback: _jsx("div", { className: "min-h-screen flex items-center justify-center", children: _jsx("div", { className: "w-8 h-8 border-2 border-black border-t-transparent rounded-full animate-spin" }) }), children: _jsx(ProductsPageContent, { ...props }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoodHomePageModern.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/components/FoodHomePageModern.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"FoodHomePageModern.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/components/FoodHomePageModern.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,UAAU,uBAAuB;IAC9B,WAAW,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,uBAAuB,+BA4ZzF"}
|
|
@@ -12,6 +12,8 @@ import { getLayoutText, getBannerImage, getAssetUrl } from '../../../lib/utils/a
|
|
|
12
12
|
import { VideoPlayer } from '../../../components/ui/video-player';
|
|
13
13
|
import { PromoBanner } from '../../shared/components/PromoBanner';
|
|
14
14
|
import { getPayazaSectionInlineStyle } from '../../../lib/payaza-section-styles';
|
|
15
|
+
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
|
|
16
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
15
17
|
export function FoodHomePageModern({ storeConfig: initialConfig }) {
|
|
16
18
|
const { store, addToCart } = useStore();
|
|
17
19
|
const storeConfig = store || initialConfig;
|
|
@@ -68,7 +70,7 @@ export function FoodHomePageModern({ storeConfig: initialConfig }) {
|
|
|
68
70
|
image: t.image || fallbackTestimonials[idx]?.image || '',
|
|
69
71
|
}))
|
|
70
72
|
: (isPreview ? fallbackTestimonials : []);
|
|
71
|
-
return (_jsxs("div", { className: "bg-[#0F0F0F] text-white font-sans selection:bg-orange-500 selection:text-white", children: [layoutConfig?.sections?.hero?.show !== false && _jsxs("section", { "data-section": "hero", "data-payaza-section-key": "hero", "data-payaza-page": "home", className: "relative h-screen w-full overflow-hidden flex items-center justify-center bg-[#0F0F0F]", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'hero'), children: [_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(VideoPlayer, { src: getAssetUrl(storeConfig, 'hero_video', "https://cdn.coverr.co/videos/coverr-chef-preparing-food-in-kitchen-5379/1080p.mp4"), poster: getBannerImage(storeConfig, 'hero_video_poster', "https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?q=80&w=2070&auto=format&fit=crop"), context: "background", className: "w-full h-full opacity-50 scale-105" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-[#0F0F0F] via-[#0F0F0F]/40 to-black/30" }), _jsx("div", { className: "absolute inset-0 bg-[url('https://www.transparenttextures.com/patterns/noise.png')] opacity-20 mix-blend-overlay" })] }), _jsxs("div", { className: "relative z-10 text-center px-4 max-w-5xl mx-auto space-y-10", children: [_jsxs("div", { className: "flex justify-center items-center gap-6 animate-fade-in-up", children: [_jsx("span", { className: "h-px w-16 bg-white/30" }), _jsxs("div", { className: "flex items-center gap-2 text-orange-500 uppercase tracking-[0.3em] text-xs font-bold", children: [_jsx(Star, { className: "h-3 w-3 fill-current" }), " ", getLayoutText(storeConfig, 'food.ourPhilosophy', 'Michelin Star 2024')] }), _jsx("span", { className: "h-px w-16 bg-white/30" })] }), _jsxs("h1", { className: "text-5xl md:text-8xl lg:text-9xl font-black tracking-tighter leading-none uppercase text-white animate-fade-in-up delay-100", children: [getLayoutText(storeConfig, 'food.ourPhilosophy', 'Taste the Extraordinary'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-amber-200", children: "Extraordinary" })] }),
|
|
73
|
+
return (_jsxs("div", { className: "bg-[#0F0F0F] text-white font-sans selection:bg-orange-500 selection:text-white", children: [layoutConfig?.sections?.hero?.show !== false && _jsxs("section", { "data-section": "hero", "data-payaza-section-key": "hero", "data-payaza-page": "home", className: "relative h-screen w-full overflow-hidden flex items-center justify-center bg-[#0F0F0F]", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'hero'), children: [_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(VideoPlayer, { src: getAssetUrl(storeConfig, 'hero_video', "https://cdn.coverr.co/videos/coverr-chef-preparing-food-in-kitchen-5379/1080p.mp4"), poster: getBannerImage(storeConfig, 'hero_video_poster', "https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?q=80&w=2070&auto=format&fit=crop"), context: "background", className: "w-full h-full opacity-50 scale-105" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-[#0F0F0F] via-[#0F0F0F]/40 to-black/30" }), _jsx("div", { className: "absolute inset-0 bg-[url('https://www.transparenttextures.com/patterns/noise.png')] opacity-20 mix-blend-overlay" })] }), _jsxs("div", { className: "relative z-10 text-center px-4 max-w-5xl mx-auto space-y-10", children: [_jsxs("div", { className: "flex justify-center items-center gap-6 animate-fade-in-up", children: [_jsx("span", { className: "h-px w-16 bg-white/30" }), _jsxs("div", { className: "flex items-center gap-2 text-orange-500 uppercase tracking-[0.3em] text-xs font-bold", children: [_jsx(Star, { className: "h-3 w-3 fill-current" }), " ", getLayoutText(storeConfig, 'food.ourPhilosophy', 'Michelin Star 2024')] }), _jsx("span", { className: "h-px w-16 bg-white/30" })] }), _jsxs("h1", { className: "text-5xl md:text-8xl lg:text-9xl font-black tracking-tighter leading-none uppercase text-white animate-fade-in-up delay-100", children: [getLayoutText(storeConfig, 'food.ourPhilosophy', 'Taste the Extraordinary'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-amber-200", children: "Extraordinary" })] }), _jsx(SafeRichHtml, { value: `${storeConfig.description || ''} Where culinary art meets exceptional atmosphere.`, as: "div", className: "text-lg md:text-xl text-gray-300 max-w-xl mx-auto font-light leading-relaxed animate-fade-in-up delay-200 tracking-wide [&_p]:mb-0" }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-6 justify-center items-center pt-8 animate-fade-in-up delay-300", children: [_jsx(Button, { onClick: () => setIsReservationOpen(true), className: "h-14 px-10 bg-orange-600 hover:bg-orange-700 text-white text-sm font-bold uppercase tracking-[0.2em] rounded-full transition-all hover:scale-105 hover:shadow-[0_0_40px_rgba(234,88,12,0.3)]", children: getLayoutText(storeConfig, 'food.reserveTable', 'Reserve Table') }), _jsx("div", { onClick: scrollToMenu, className: "w-14 h-14 rounded-full border border-white/20 flex items-center justify-center cursor-pointer hover:bg-white hover:text-black transition-all group", children: _jsx(ArrowRight, { className: "h-5 w-5 group-hover:rotate-90 transition-transform duration-300" }) })] })] }), _jsxs("div", { className: "absolute bottom-10 left-1/2 -translate-x-1/2 flex flex-col items-center gap-4 animate-pulse", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.3em] text-gray-500", children: "Scroll" }), _jsx("div", { className: "w-px h-16 bg-gradient-to-b from-orange-500 to-transparent" })] })] }), layoutConfig?.sections?.story?.show !== false && (_jsxs("section", { "data-section": "about", "data-payaza-section-key": "about", "data-payaza-page": "home", className: "py-20 px-6 relative overflow-hidden", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'about'), children: [_jsx("div", { className: "absolute top-0 right-0 w-1/3 h-full bg-white/5 skew-x-12 transform translate-x-20 pointer-events-none" }), _jsx("div", { className: "container mx-auto max-w-6xl relative z-10", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-center", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "aspect-[4/5] rounded-none overflow-hidden grayscale hover:grayscale-0 transition-all duration-700", children: _jsx(ImageWithFallback, { src: getBannerImage(storeConfig, 'about_section_image', "https://images.unsplash.com/photo-1559339352-11d035aa65de?w=1200&q=80"), alt: "Chef", className: "w-full h-full object-cover" }) }), _jsxs("div", { className: "absolute -bottom-10 -right-10 bg-[#1A1A1A] p-8 border border-white/5 max-w-xs hidden md:block", children: [_jsx("p", { className: "font-serif italic text-2xl text-white mb-4", children: "\"Cooking is an art, but patience is the key ingredient.\"" }), _jsx("p", { className: "text-orange-500 text-xs font-bold uppercase tracking-widest", children: "\u2014 Head Chef Marco" })] })] }), _jsxs("div", { className: "space-y-8", children: [_jsx("span", { className: "text-orange-500 font-bold uppercase tracking-widest text-xs", children: layoutConfig?.sections?.story?.label || getLayoutText(storeConfig, 'food.ourPhilosophy', 'Our Philosophy') }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold leading-tight", children: layoutConfig?.sections?.story?.title || getLayoutText(storeConfig, 'food.ourPhilosophy', 'Crafting Memories Through Flavor') }), _jsx("p", { className: "text-gray-400 text-lg leading-relaxed", children: layoutConfig?.sections?.story?.description || getLayoutText(storeConfig, 'food.ourPhilosophy', 'We believe that dining is more than just eating; it\'s an experience that engages all senses. Our seasonal menu is carefully curated using locally sourced ingredients to bring you the freshest flavors of the region.') }), _jsxs("div", { className: "grid grid-cols-3 gap-8 pt-8 border-t border-white/10", children: [_jsxs("div", { children: [_jsx(Flame, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Wood Fired" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Authentic taste" })] }), _jsxs("div", { children: [_jsx(Wine, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Fine Wines" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Curated selection" })] }), _jsxs("div", { children: [_jsx(Coffee, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Artisan Coffee" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Roasted in-house" })] })] })] })] }) })] })), layoutConfig?.sections?.promoBanner?.show !== false && layoutConfig?.sections?.promoBanner && (_jsx(PromoBanner, { config: layoutConfig.sections.promoBanner, layoutStyle: "food", className: "my-20" })), _jsx("section", { id: "menu-section", "data-section": "menuGrid", "data-payaza-section-key": "menuGrid", "data-payaza-page": "home", className: "py-20 bg-[#141414] border-t border-white/5", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'menuGrid'), children: _jsxs("div", { className: "container mx-auto px-6 max-w-7xl", children: [_jsxs("div", { className: "text-center mb-12", children: [_jsx("span", { className: "text-orange-500 font-bold uppercase tracking-widest text-xs mb-4 block", children: "Discover" }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold uppercase tracking-tight mb-8", children: getLayoutText(storeConfig, 'food.menuCategories', 'Our Menu') }), _jsxs("div", { className: "flex flex-wrap justify-center gap-4", children: [_jsx("button", { onClick: () => setActiveTab('all'), className: `px-8 py-3 rounded-full text-sm font-bold uppercase tracking-wider transition-all border ${activeTab === 'all' ? 'bg-white text-black border-white' : 'bg-transparent text-gray-400 border-white/10 hover:border-white/30'}`, children: "All" }), categories.map((cat) => (_jsx("button", { onClick: () => setActiveTab(cat.id), className: `px-8 py-3 rounded-full text-sm font-bold uppercase tracking-wider transition-all border ${activeTab === cat.id ? 'bg-white text-black border-white' : 'bg-transparent text-gray-400 border-white/10 hover:border-white/30'}`, children: cat.name }, cat.id)))] })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-16", children: filteredItems.map((item) => (_jsxs("div", { className: "group cursor-pointer", children: [_jsxs("div", { className: "aspect-square overflow-hidden rounded-full mb-6 border border-white/10 relative", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110 group-hover:rotate-3", skeletonAspectRatio: "square" }), _jsx("div", { className: "hidden lg:flex absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity items-center justify-center", children: _jsx(Button, { className: "bg-orange-600 rounded-full px-6 hover:bg-orange-700", onClick: (e) => {
|
|
72
74
|
e.preventDefault();
|
|
73
75
|
e.stopPropagation();
|
|
74
76
|
// Adapt menu item to product for cart
|
|
@@ -97,5 +99,5 @@ export function FoodHomePageModern({ storeConfig: initialConfig }) {
|
|
|
97
99
|
};
|
|
98
100
|
addToCart(product);
|
|
99
101
|
addToast(`${item.name} added to order`, 'success');
|
|
100
|
-
}, children: _jsx(Utensils, { className: "h-5 w-5" }) })] }), _jsxs("div", { className: "text-center px-4", children: [_jsx("h3", { className: "text-xl font-bold uppercase tracking-wide mb-2 group-hover:text-orange-500 transition-colors", children: item.name }), _jsx("p",
|
|
102
|
+
}, children: _jsx(Utensils, { className: "h-5 w-5" }) })] }), _jsxs("div", { className: "text-center px-4", children: [_jsx("h3", { className: "text-xl font-bold uppercase tracking-wide mb-2 group-hover:text-orange-500 transition-colors", children: item.name }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-500 text-sm mb-3 line-clamp-2" }), _jsx("span", { className: "text-2xl font-serif text-white block", children: formatCurrency(item.price, item.currency || storeConfig.settings?.currency || 'USD') })] })] }, item.id))) })] }) }), testimonialsSection?.show !== false && (_jsx("section", { "data-section": "testimonials", "data-payaza-section-key": "testimonials", "data-payaza-page": "home", className: "py-20 px-6 bg-[#0F0F0F] border-t border-white/5", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'testimonials'), children: _jsxs("div", { className: "container mx-auto max-w-6xl", children: [_jsx("h2", { className: "text-3xl md:text-4xl font-bold text-center mb-12 uppercase tracking-tight", children: testimonialsSection?.title || getLayoutText(storeConfig, 'sections.testimonials.title', 'Guest Stories') }), testimonialsSection?.subtitle && (_jsx("p", { className: "text-center text-gray-400 mb-12 max-w-2xl mx-auto", children: testimonialsSection.subtitle })), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: testimonials.slice(0, 3).map((t) => (_jsxs("div", { className: "bg-[#1A1A1A] p-8 rounded-none border border-white/5 relative hover:-translate-y-2 transition-transform duration-300", children: [_jsx("div", { className: "absolute -top-5 left-8 text-6xl text-orange-500/20 font-serif", children: "\"" }), _jsx("p", { className: "text-gray-300 leading-relaxed mb-8 relative z-10 italic font-light", children: t.comment }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsx(ImageWithFallback, { src: t.image, alt: t.name, className: "w-12 h-12 rounded-full object-cover grayscale" }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-white text-sm uppercase tracking-wide", children: t.name }), _jsx("span", { className: "text-xs text-orange-500 font-bold uppercase tracking-widest", children: t.role })] })] })] }, t.id))) })] }) })), _jsxs("section", { className: "relative py-20 md:py-32 flex items-center justify-center overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 bg-cover bg-center fixed-bg opacity-30 grayscale", style: { backgroundImage: `url('${getBannerImage(storeConfig, 'reservation_bg', "https://images.unsplash.com/photo-1559339352-11d035aa65de?q=80&w=1974&auto=format&fit=crop")}')` } }), _jsx("div", { className: "absolute inset-0 bg-[#0F0F0F]/80" }), _jsxs("div", { className: "relative z-10 text-center max-w-4xl mx-auto px-6", children: [_jsx(ChefHat, { className: "h-12 w-12 md:h-16 md:w-16 text-white/20 mx-auto mb-6 md:mb-8" }), _jsx("h2", { className: "text-4xl md:text-7xl font-bold uppercase tracking-tight mb-6 md:mb-8", children: "Your Table Awaits" }), _jsx("p", { className: "text-lg md:text-xl text-gray-300 mb-10 md:mb-12 font-light", children: "Experience the art of fine dining in the heart of the city." }), _jsx(Button, { onClick: () => setIsReservationOpen(true), className: "h-16 px-12 bg-white text-black hover:bg-orange-500 hover:text-white text-lg font-bold uppercase tracking-[0.2em] rounded-full transition-all duration-300 hover:shadow-[0_0_30px_rgba(255,255,255,0.2)]", children: "Make a Reservation" })] })] }), _jsx(Modal, { isOpen: isReservationOpen, onClose: closeReservation, title: "Table Reservation", className: "bg-[#1A1A1A] text-white border border-white/10 rounded-none", children: reservationStep === 1 ? (_jsxs("form", { onSubmit: handleReservationSubmit, className: "space-y-6", children: [_jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-xs font-bold uppercase tracking-wider text-gray-500", children: "Date" }), _jsxs("div", { className: "relative", children: [_jsx(Calendar, { className: "absolute left-3 top-3 h-4 w-4 text-gray-400" }), _jsx("input", { type: "date", required: true, className: "w-full pl-10 pr-4 py-3 bg-[#0F0F0F] border border-white/10 rounded-none focus:outline-none focus:border-orange-500 text-sm" })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-xs font-bold uppercase tracking-wider text-gray-500", children: "Time" }), _jsxs("div", { className: "relative", children: [_jsx(Clock, { className: "absolute left-3 top-3 h-4 w-4 text-gray-400" }), _jsxs("select", { required: true, className: "w-full pl-10 pr-4 py-3 bg-[#0F0F0F] border border-white/10 rounded-none focus:outline-none focus:border-orange-500 text-sm text-gray-300", children: [_jsx("option", { children: "18:00" }), _jsx("option", { children: "18:30" }), _jsx("option", { children: "19:00" }), _jsx("option", { children: "19:30" }), _jsx("option", { children: "20:00" }), _jsx("option", { children: "20:30" })] })] })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-xs font-bold uppercase tracking-wider text-gray-500", children: "Guests" }), _jsxs("div", { className: "relative", children: [_jsx(Users, { className: "absolute left-3 top-3 h-4 w-4 text-gray-400" }), _jsx("select", { required: true, className: "w-full pl-10 pr-4 py-3 bg-[#0F0F0F] border border-white/10 rounded-none focus:outline-none focus:border-orange-500 text-sm text-gray-300", children: [1, 2, 3, 4, 5, 6, 7, 8].map(n => _jsxs("option", { value: n, children: [n, " People"] }, n)) })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-xs font-bold uppercase tracking-wider text-gray-500", children: "Contact Details" }), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "relative", children: [_jsx(Users, { className: "absolute left-3 top-3 h-4 w-4 text-gray-400" }), _jsx("input", { type: "text", placeholder: "Full Name", required: true, className: "w-full pl-10 pr-4 py-3 bg-[#0F0F0F] border border-white/10 rounded-none focus:outline-none focus:border-orange-500 text-sm" })] }), _jsxs("div", { className: "relative", children: [_jsx(Mail, { className: "absolute left-3 top-3 h-4 w-4 text-gray-400" }), _jsx("input", { type: "email", placeholder: "Email Address", required: true, className: "w-full pl-10 pr-4 py-3 bg-[#0F0F0F] border border-white/10 rounded-none focus:outline-none focus:border-orange-500 text-sm" })] }), _jsxs("div", { className: "relative", children: [_jsx(Phone, { className: "absolute left-3 top-3 h-4 w-4 text-gray-400" }), _jsx("input", { type: "tel", placeholder: "Phone Number", required: true, className: "w-full pl-10 pr-4 py-3 bg-[#0F0F0F] border border-white/10 rounded-none focus:outline-none focus:border-orange-500 text-sm" })] })] })] }), _jsx(Button, { type: "submit", disabled: isSubmitting, className: "w-full h-14 bg-orange-600 hover:bg-orange-700 text-white font-bold uppercase tracking-[0.2em] rounded-none mt-4", children: isSubmitting ? 'Confirming...' : 'Confirm Reservation' })] })) : (_jsxs("div", { className: "text-center py-8 space-y-6", children: [_jsx("div", { className: "w-20 h-20 bg-green-500/10 rounded-full flex items-center justify-center mx-auto border border-green-500/20", children: _jsx(CheckCircle, { className: "h-10 w-10 text-green-500" }) }), _jsx("h3", { className: "text-2xl font-bold uppercase tracking-tight", children: "Confirmed" }), _jsx("p", { className: "text-gray-400", children: "Your table has been reserved. Check your email for details." }), _jsx(Button, { onClick: closeReservation, className: "bg-white text-black hover:bg-gray-200 rounded-none px-10 h-12 uppercase tracking-wider font-bold", children: "Close" })] })) })] }));
|
|
101
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,UAAU,cAAc;IACtB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,cAAc,+BA8OvE"}
|
|
@@ -5,6 +5,8 @@ import { Button } from '../../../components/ui/button.js';
|
|
|
5
5
|
import { DotPattern } from '../../../components/ui/background-patterns.js';
|
|
6
6
|
import { useStore } from '../../../lib/store-context.js';
|
|
7
7
|
import Image from 'next/image';
|
|
8
|
+
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
|
|
9
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
8
10
|
export function AboutPage({ storeConfig: initialConfig }) {
|
|
9
11
|
const { store } = useStore();
|
|
10
12
|
const storeConfig = store || initialConfig;
|
|
@@ -40,7 +42,7 @@ export function AboutPage({ storeConfig: initialConfig }) {
|
|
|
40
42
|
description: "Sustainable practices and responsible sourcing for a better tomorrow."
|
|
41
43
|
}
|
|
42
44
|
];
|
|
43
|
-
return (_jsxs("div", { className: "min-h-screen bg-white pb-20 overflow-hidden", children: [_jsxs("section", { "data-section": "hero", className: "relative h-[60vh] min-h-[500px] w-full overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: heroImage, alt: "About Us", fill: true, className: "w-full h-full object-cover transform scale-105 animate-pulse-slow" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/80 via-black/50 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "max-w-3xl animate-fade-in-up", children: [_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-white text-sm font-medium mb-6", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }), "Est. 2024"] }), _jsx("h1", { className: "text-5xl md:text-7xl font-bold text-white mb-6 tracking-tight leading-tight", children: pageTitle }), _jsx("
|
|
45
|
+
return (_jsxs("div", { className: "min-h-screen bg-white pb-20 overflow-hidden", children: [_jsxs("section", { "data-section": "hero", className: "relative h-[60vh] min-h-[500px] w-full overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: heroImage, alt: "About Us", fill: true, className: "w-full h-full object-cover transform scale-105 animate-pulse-slow" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/80 via-black/50 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "max-w-3xl animate-fade-in-up", children: [_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-white text-sm font-medium mb-6", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }), "Est. 2024"] }), _jsx("h1", { className: "text-5xl md:text-7xl font-bold text-white mb-6 tracking-tight leading-tight", children: pageTitle }), _jsx(SafeRichHtml, { value: missionStatement || storeConfig.description, as: "div", className: "text-xl md:text-2xl text-gray-200 max-w-2xl leading-relaxed font-light [&_p]:mb-0" })] }) }) })] }), _jsxs("section", { "data-section": "story", className: "py-24 px-4 sm:px-6 lg:px-8 relative", children: [_jsx("div", { className: "absolute top-0 right-0 -mt-24 -mr-24 w-96 h-96 bg-gray-50 rounded-full blur-3xl -z-10" }), _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-16 items-center", children: [_jsxs("div", { className: "relative", children: [galleryImages && galleryImages.length > 0 ? (_jsx("div", { className: "grid grid-cols-2 gap-4", children: galleryImages.slice(0, 4).map((img, i) => (_jsx("div", { className: `relative overflow-hidden rounded-2xl shadow-lg ${i === 0 ? 'col-span-2 aspect-[16/9]' : 'aspect-square'}`, children: _jsx(Image, { src: img.image, alt: img.caption || "Gallery Image", fill: true, className: "w-full h-full object-cover hover:scale-110 transition-transform duration-500" }) }, i))) })) : (_jsxs("div", { className: "relative aspect-[4/5] rounded-[2rem] overflow-hidden shadow-2xl", children: [_jsx(Image, { src: "https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=2071&auto=format&fit=crop", alt: "Our Team", fill: true, className: "w-full h-full object-cover" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-60" }), _jsxs("div", { className: "absolute bottom-8 left-8 text-white", children: [_jsx("p", { className: "font-bold text-lg", children: "The Dream Team" }), _jsx("p", { className: "text-white/80 text-sm", children: "Working together to serve you better" })] })] })), _jsx("div", { className: "absolute -bottom-6 -right-6 w-24 h-24 bg-white rounded-2xl shadow-xl flex items-center justify-center p-4 animate-bounce duration-[3000ms]", children: _jsx(Heart, { className: "w-10 h-10", style: { color: primaryColor, fill: primaryColor } }) })] }), _jsxs("div", { className: "space-y-10", children: [_jsxs("div", { children: [_jsx("span", { className: "text-sm font-bold uppercase tracking-widest mb-3 block", style: { color: primaryColor }, children: "Who We Are" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 mb-6 tracking-tight", children: "Our Journey" }), _jsxs("div", { className: "prose prose-lg text-gray-600 leading-relaxed space-y-6", children: [pageContent?.split('\n').map((paragraph, idx) => (_jsx("p", { children: paragraph }, idx))), !pageContent && (_jsxs(_Fragment, { children: [_jsxs("p", { children: ["Founded with a bold vision to redefine excellence in the ", _jsx("span", { className: "font-semibold text-gray-900", children: storeConfig.type }), " industry, ", storeConfig.name, " has grown from a small passion project into a beloved brand. We believe in the power of quality, innovation, and community."] }), _jsx("p", { children: "Every day, we strive to bring you the best products, curated with care and delivered with a smile. Our team is dedicated to ensuring that your experience with us is nothing short of exceptional." })] }))] })] }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-8", children: values.map((item, idx) => (_jsxs("div", { className: "flex gap-4 group", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("div", { className: "w-14 h-14 rounded-2xl flex items-center justify-center transition-colors group-hover:bg-gray-100", style: { backgroundColor: `${primaryColor}10` }, children: _jsx(item.icon, { className: "h-7 w-7 transition-transform group-hover:scale-110", style: { color: primaryColor } }) }) }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-gray-900 mb-2 text-lg", children: item.title }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-600 text-sm leading-relaxed" })] })] }, idx))) })] })] }) })] }), _jsxs("section", { "data-section": "stats", className: "py-20 relative overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 opacity-10", children: _jsx(DotPattern, { color: primaryColor, cx: 2, cy: 2, cr: 2, width: 30, height: 30 }) }), _jsx("div", { className: "absolute inset-0", style: { backgroundColor: `${secondaryColor}15` } }), _jsx("div", { className: "container mx-auto px-4 relative z-10", children: _jsx("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-8 md:gap-12", children: [
|
|
44
46
|
{ label: "Elite Members", value: "5k+" },
|
|
45
47
|
{ label: "Modern Creations", value: menuItems?.length ? `${menuItems.length}+` : "35+" },
|
|
46
48
|
{ label: "Culinary Awards", value: "12+" },
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { type CategoryProductsSeed } from '../../../hooks/use-category-products.js';
|
|
1
2
|
import { StoreConfig } from '../../../lib/store-types.js';
|
|
2
3
|
interface CategoryPageProps {
|
|
3
4
|
storeConfig: StoreConfig;
|
|
4
5
|
categorySlug: string;
|
|
6
|
+
categoryProductsSeed?: CategoryProductsSeed;
|
|
5
7
|
}
|
|
6
|
-
export declare function CategoryPage({ storeConfig: initialConfig, categorySlug }: CategoryPageProps): import("react").JSX.Element;
|
|
8
|
+
export declare function CategoryPage({ storeConfig: initialConfig, categorySlug, categoryProductsSeed }: CategoryPageProps): import("react").JSX.Element;
|
|
7
9
|
export {};
|
|
8
10
|
//# sourceMappingURL=CategoryPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/CategoryPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CategoryPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/CategoryPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE/F,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAgB5E,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,iBAAiB,+BAwKjH"}
|
|
@@ -10,12 +10,14 @@ import { useToast } from '../../../components/ui/toast.js';
|
|
|
10
10
|
import { useAnalytics } from '../../../hooks/use-analytics.js';
|
|
11
11
|
import { useEffect } from 'react';
|
|
12
12
|
import { formatCurrency } from '../../../lib/utils/index.js';
|
|
13
|
-
|
|
13
|
+
import { CategoryDescription } from '../../../components/rich-text/CategoryDescription';
|
|
14
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt';
|
|
15
|
+
export function CategoryPage({ storeConfig: initialConfig, categorySlug, categoryProductsSeed }) {
|
|
14
16
|
const { store, addToCart } = useStore();
|
|
15
17
|
const storeConfig = store || initialConfig;
|
|
16
18
|
const categories = storeConfig.categories || [];
|
|
17
19
|
const category = categories.find(c => c.slug === categorySlug);
|
|
18
|
-
const { products, isLoading, hasMore, loadMore } = useCategoryProducts(storeConfig.id, category?.id);
|
|
20
|
+
const { products, isLoading, hasMore, loadMore } = useCategoryProducts(storeConfig.id, category?.id, categoryProductsSeed);
|
|
19
21
|
const menuItems = products.map((product) => ({
|
|
20
22
|
id: product.id,
|
|
21
23
|
name: product.name,
|
|
@@ -63,5 +65,5 @@ export function CategoryPage({ storeConfig: initialConfig, categorySlug }) {
|
|
|
63
65
|
const isDarkTheme = storeConfig.type === 'food-modern' || storeConfig.branding.theme === 'dark';
|
|
64
66
|
const bgColor = isDarkTheme ? 'bg-[#0F0F0F]' : 'bg-gray-50';
|
|
65
67
|
const textColor = isDarkTheme ? 'text-white' : 'text-gray-900';
|
|
66
|
-
return (_jsxs("div", { className: `min-h-screen ${bgColor} ${textColor} transition-colors duration-300`, children: [_jsxs("div", { className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: `absolute inset-0 ${isDarkTheme ? 'bg-black/60' : 'bg-black/40'} backdrop-blur-[2px]` }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }),
|
|
68
|
+
return (_jsxs("div", { className: `min-h-screen ${bgColor} ${textColor} transition-colors duration-300`, children: [_jsxs("div", { className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: `absolute inset-0 ${isDarkTheme ? 'bg-black/60' : 'bg-black/40'} backdrop-blur-[2px]` }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }), _jsx(CategoryDescription, { description: category.description })] })] }), _jsxs("div", { className: "container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center mb-10 gap-4", children: [_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: `inline-flex items-center text-sm font-medium ${isDarkTheme ? 'text-gray-400 hover:text-white' : 'text-gray-600 hover:text-gray-900'}`, children: [_jsx(ArrowLeft, { className: "h-4 w-4 mr-2" }), "Back to All Categories"] }), _jsx("div", { className: "flex items-center gap-4", children: _jsxs(Button, { variant: "outline", className: `${isDarkTheme ? 'border-white/20 text-white hover:bg-white/10' : 'bg-white'}`, children: [_jsx(Filter, { className: "h-4 w-4 mr-2" }), " Filter"] }) })] }), !hasItems && !isLoading ? (_jsxs("div", { className: "text-center py-20 border border-dashed border-gray-300 rounded-3xl", children: [_jsx("p", { className: "text-gray-500 text-lg", children: "No items found in this category." }), _jsx(Button, { className: "mt-4", onClick: () => window.history.back(), children: "Go Back" })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "space-y-12", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: menuItems.map((item) => (_jsxs("div", { className: "group bg-[#1A1A1A] rounded-none overflow-hidden border border-white/5 hover:border-orange-500/50 transition-all duration-500 flex flex-col h-full", children: [_jsxs("div", { className: "relative aspect-square overflow-hidden grayscale hover:grayscale-0 transition-all duration-700", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-none bg-white text-black hover:bg-orange-600 hover:text-white transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8 uppercase tracking-widest text-xs", onClick: () => handleAddToCart(item), children: "Order Now" }) })] }), _jsxs("div", { className: "p-8 flex flex-col flex-1 text-center", children: [_jsx("h3", { className: "font-bold text-xl text-white uppercase tracking-tight mb-2 group-hover:text-orange-500 transition-colors", children: item.name }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-500 text-sm mb-6 line-clamp-2 leading-relaxed flex-1 font-light italic" }), _jsx("span", { className: "text-2xl font-serif text-white", children: formatCurrency(item.price, storeConfig.settings?.currency || 'USD') })] })] }, item.id))) }) }), hasMore && (_jsx("div", { className: "mt-10 flex justify-center", children: _jsx(Button, { onClick: loadMore, disabled: isLoading, children: "Load more" }) }))] }))] })] }));
|
|
67
69
|
}
|
|
@@ -132,7 +132,7 @@ export function MenuPage({ storeConfig: initialConfig, categorySlug }) {
|
|
|
132
132
|
? "text-white border-transparent shadow-md transform scale-105"
|
|
133
133
|
: "bg-white text-gray-600 border-gray-200 hover:bg-gray-100 hover:border-gray-300"), style: !selectedCategory ? { backgroundColor: primaryColor } : {}, children: "All Items" }), categories.map((category) => (_jsx("button", { onClick: () => setSelectedCategory(category.slug), className: cn("px-4 py-2 rounded-full text-sm font-bold whitespace-nowrap transition-all border flex-shrink-0 select-none", selectedCategory === category.slug
|
|
134
134
|
? "text-white border-transparent shadow-md transform scale-105"
|
|
135
|
-
: "bg-white text-gray-600 border-gray-200 hover:bg-gray-100 hover:border-gray-300"), style: selectedCategory === category.slug ? { backgroundColor: primaryColor } : {}, children: category.name }, category.id)))] })] })] }) }) }), _jsxs("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [selectedCategory && (_jsx("div", { className: "mb-8 animate-fade-in", children: _jsxs("h2", { className: "text-2xl font-bold text-gray-900 capitalize flex items-center gap-3", children: [categories.find(c => c.slug === selectedCategory)?.name || 'Category', _jsxs("span", { className: "text-sm font-normal text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full", children: [filteredItems.length, " items"] })] }) })), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: filteredItems.map((item, index) => (_jsxs(Card, { className: "group overflow-hidden hover:shadow-xl transition-all duration-300 border-gray-100 flex flex-col h-full bg-white rounded-2xl", children: [_jsxs("div", { className: "relative aspect-[4/3] overflow-hidden", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "4/3" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-end justify-center pb-6", children: _jsx(Button, { className: "rounded-full font-bold shadow-lg transform translate-y-4 group-hover:translate-y-0 transition-transform duration-300", style: { backgroundColor: primaryColor, color: 'white' }, children: "Quick Add" }) }), index % 3 === 0 && (_jsxs("div", { className: "absolute top-3 right-3 bg-white/90 backdrop-blur text-gray-900 text-[10px] font-bold px-2 py-1 rounded-full shadow-sm flex items-center gap-1", children: [_jsx(Star, { className: "w-3 h-3 fill-yellow-400 text-yellow-400" }), " Popular"] }))] }), _jsxs(CardContent, { className: "p-6 flex-1 flex flex-col", children: [_jsxs("div", { className: "flex justify-between items-start mb-2", children: [_jsx("h3", { className: "font-bold text-lg text-gray-900 leading-tight", children: item.name }), _jsx("span", { className: "font-black text-lg text-gray-900 whitespace-nowrap ml-2", children: formatCurrency(item.price, item.currency || storeConfig.settings?.currency || 'USD') })] }), _jsx("p",
|
|
135
|
+
: "bg-white text-gray-600 border-gray-200 hover:bg-gray-100 hover:border-gray-300"), style: selectedCategory === category.slug ? { backgroundColor: primaryColor } : {}, children: category.name }, category.id)))] })] })] }) }) }), _jsxs("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [selectedCategory && (_jsx("div", { className: "mb-8 animate-fade-in", children: _jsxs("h2", { className: "text-2xl font-bold text-gray-900 capitalize flex items-center gap-3", children: [categories.find(c => c.slug === selectedCategory)?.name || 'Category', _jsxs("span", { className: "text-sm font-normal text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full", children: [filteredItems.length, " items"] })] }) })), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: filteredItems.map((item, index) => (_jsxs(Card, { className: "group overflow-hidden hover:shadow-xl transition-all duration-300 border-gray-100 flex flex-col h-full bg-white rounded-2xl", children: [_jsxs("div", { className: "relative aspect-[4/3] overflow-hidden", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "4/3" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-end justify-center pb-6", children: _jsx(Button, { className: "rounded-full font-bold shadow-lg transform translate-y-4 group-hover:translate-y-0 transition-transform duration-300", style: { backgroundColor: primaryColor, color: 'white' }, children: "Quick Add" }) }), index % 3 === 0 && (_jsxs("div", { className: "absolute top-3 right-3 bg-white/90 backdrop-blur text-gray-900 text-[10px] font-bold px-2 py-1 rounded-full shadow-sm flex items-center gap-1", children: [_jsx(Star, { className: "w-3 h-3 fill-yellow-400 text-yellow-400" }), " Popular"] }))] }), _jsxs(CardContent, { className: "p-6 flex-1 flex flex-col", children: [_jsxs("div", { className: "flex justify-between items-start mb-2", children: [_jsx("h3", { className: "font-bold text-lg text-gray-900 leading-tight", children: item.name }), _jsx("span", { className: "font-black text-lg text-gray-900 whitespace-nowrap ml-2", children: formatCurrency(item.price, item.currency || storeConfig.settings?.currency || 'USD') })] }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-500 text-sm mb-4 line-clamp-2 leading-relaxed flex-1" }), item.dietaryInfo && item.dietaryInfo.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mb-6", children: item.dietaryInfo.map((info) => {
|
|
136
136
|
const Icon = dietaryIcons[info.toLowerCase()] || Info;
|
|
137
137
|
return (_jsxs("span", { className: "inline-flex items-center gap-1 text-[10px] uppercase font-bold px-2 py-1 rounded bg-gray-50 text-gray-500 border border-gray-100", children: [_jsx(Icon, { className: "w-3 h-3" }), info] }, info));
|
|
138
138
|
}) })), _jsxs(Button, { className: "w-full rounded-xl font-bold h-11 shadow-sm hover:shadow-md transition-all active:scale-[0.98]", style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AA6B5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BAwiCpG"}
|
|
@@ -18,6 +18,7 @@ import { getGuestUserInfo, saveGuestUserInfo } from '../../../lib/guest-user.js'
|
|
|
18
18
|
import { ProductCard } from '../../../components/ui/product-card.js';
|
|
19
19
|
import Image from 'next/image';
|
|
20
20
|
import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
|
|
21
|
+
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
|
|
21
22
|
import { ButtonLoader } from '../../../components/ui/page-loader.js';
|
|
22
23
|
import { extractImageUrls } from '../../../lib/store-config-utils.js';
|
|
23
24
|
import { OutOfStockOverlay } from '../../../components/ui/out-of-stock-overlay.js';
|
|
@@ -506,5 +507,5 @@ export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
|
506
507
|
: 'bg-white text-gray-700 border-gray-200 hover:border-gray-300 hover:bg-gray-50'}`, children: variant.value }, variant.id));
|
|
507
508
|
}) })] })), _jsxs("div", { className: "flex flex-col gap-4 mb-8", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: "Quantity" }), _jsxs("div", { className: "flex items-center border border-gray-300 rounded-lg", children: [_jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-l-lg disabled:opacity-50", onClick: () => setQuantity(Math.max(1, quantity - 1)), disabled: quantity <= 1, children: _jsx(Minus, { className: "h-4 w-4" }) }), _jsx("span", { className: "w-12 text-center font-semibold text-gray-900", children: quantity }), _jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-r-lg", onClick: () => setQuantity(quantity + 1), children: _jsx(Plus, { className: "h-4 w-4" }) })] })] }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 mt-2", children: [_jsx(Button, { "data-add-to-cart": true, size: "lg", onClick: handleAddToCart, disabled: isCartLoading || isOutOfStock, className: "flex-1 bg-white border-2 border-gray-900 text-gray-900 hover:bg-gray-50 rounded-full h-14 text-base font-bold shadow-sm transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-2" }), "Adding..."] })) : (_jsxs(_Fragment, { children: [_jsx(ShoppingCart, { className: "h-5 w-5 mr-2" }), "Add to Cart"] })) }), _jsx(Button, { size: "lg", onClick: handleBuyNow, disabled: isOutOfStock || isBuyNowLoading || isCartLoading, className: "flex-1 bg-gray-900 hover:bg-gray-800 text-white rounded-full h-14 text-base font-bold shadow-lg hover:shadow-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isBuyNowLoading || isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-2" }), "Adding..."] })) : ('Buy Now') }), storeConfig.features.wishlist && (_jsx(Button, { variant: "outline", size: "lg", onClick: handleWishlistClick, disabled: isWishlistLoading || !product, className: cn("h-14 w-14 rounded-full border-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed", product && isInWishlist(product.id)
|
|
508
509
|
? "border-red-500 bg-red-50 text-red-500 hover:bg-red-100"
|
|
509
|
-
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: product.price, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }), _jsxs("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: [_jsx(
|
|
510
|
+
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: product.price, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }), _jsxs("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: [_jsx(SafeRichHtml, { value: product.description, fallbackPlain: "", as: "div" }), _jsxs("ul", { className: "list-disc pl-5 space-y-1 mt-2", children: [_jsx("li", { children: "Premium quality material" }), _jsx("li", { children: "Comfortable fit for all-day wear" }), _jsx("li", { children: "Durable stitching and finish" })] })] })] })), product.specifications && Object.keys(product.specifications).length > 0 && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Specifications" }), _jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-4", children: Object.entries(product.specifications).map(([key, value]) => (_jsxs("div", { className: "flex flex-col p-3 bg-gray-50 rounded-lg", children: [_jsx("dt", { className: "text-xs text-gray-500 font-medium uppercase tracking-wider mb-1", children: key }), _jsx("dd", { className: "text-sm font-bold text-gray-900", children: value })] }, key))) })] }))] })] }), _jsx("div", { className: "mt-20 pt-16 border-t border-gray-200", children: _jsxs("div", { className: "max-w-4xl", children: [_jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6 mb-10", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-4", children: "Customer Reviews" }), product.reviewCount && product.reviewCount > 0 && product.rating && product.rating > 0 ? (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(StarRating, { rating: typeof product.rating === 'number' ? product.rating : Number(product.rating) || 0, size: "lg" }), _jsx("span", { className: "text-2xl font-bold text-gray-900", children: Number(product.rating).toFixed(1) }), _jsx("span", { className: "text-lg text-gray-500", children: "out of 5" })] }), _jsx("span", { className: "text-gray-300", children: "|" }), _jsxs("span", { className: "text-lg text-gray-600", children: [product.reviewCount, " ", product.reviewCount === 1 ? 'review' : 'reviews'] })] })) : (_jsx("div", { className: "text-gray-500", children: _jsx("p", { className: "text-base", children: "Be the first to review this product" }) }))] }), _jsx(Button, { onClick: () => setIsReviewModalOpen(true), className: "rounded-full shrink-0 bg-gray-900 hover:bg-gray-800 text-white", children: product.reviewCount && product.reviewCount > 0 ? 'Write a Review' : 'Be the First to Review' })] }), ratingDistribution.some(r => r.count > 0) && (_jsxs("div", { className: "mb-10 p-6 bg-gray-50 rounded-xl border border-gray-100", children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 mb-5", children: "Rating Breakdown" }), _jsx("div", { className: "space-y-3", children: ratingDistribution.map(({ rating, count, percentage }) => (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-1.5 w-20", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: rating }), _jsx(Star, { className: "h-4 w-4 fill-gray-900 text-gray-900" })] }), _jsx("div", { className: "flex-1 h-2.5 bg-gray-200 rounded-full overflow-hidden", children: _jsx("div", { className: "h-full bg-gradient-to-r from-gray-700 to-gray-900 rounded-full transition-all duration-500", style: { width: `${percentage}%` } }) }), _jsx("span", { className: "text-sm font-medium text-gray-700 w-12 text-right", children: count })] }, rating))) })] })), reviews.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "space-y-6", children: displayedReviews.map((review) => (_jsx(ReviewCard, { review: review }, review.id))) }), hasMoreReviews && !showAllReviews && (_jsx("div", { className: "mt-8 text-center", children: _jsxs(Button, { variant: "outline", onClick: () => setShowAllReviews(true), className: "px-8 rounded-full h-12 border-gray-300", children: ["Show All ", reviews.length, " Reviews"] }) }))] })) : (_jsxs("div", { className: "text-center py-12 bg-gray-50 rounded-xl border border-dashed border-gray-300", children: [_jsx("div", { className: "inline-flex items-center justify-center w-12 h-12 rounded-full bg-white shadow-sm mb-4", children: _jsx(Star, { className: "h-6 w-6 text-gray-400" }) }), _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: "No Reviews Yet" }), _jsx("p", { className: "text-gray-500 max-w-sm mx-auto mb-6", children: "Be the first to review this product and help other customers make informed decisions." }), _jsx(Button, { onClick: () => setIsReviewModalOpen(true), className: "bg-gray-900 hover:bg-gray-800 text-white", children: "Write the First Review" })] }))] }) }), relatedProducts.length > 0 && (_jsxs("div", { className: "mt-20 pt-16 border-t border-gray-200", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-8", children: "You Might Also Like" }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6", children: relatedProducts.map((relatedProduct) => (_jsx("div", { className: "h-[400px]", children: _jsx(ProductCard, { product: relatedProduct, storeSlug: storeConfig.slug, onAddToCart: (p) => addToCart(p, 1), onQuickView: handleQuickView, className: "h-full" }) }, relatedProduct.id))) })] }))] }), _jsx(Modal, { isOpen: isReviewModalOpen, onClose: () => setIsReviewModalOpen(false), title: "Write a Review", children: _jsxs("form", { onSubmit: handleSubmitReview, className: "space-y-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Rating" }), _jsxs("div", { className: "flex items-center gap-1", children: [[1, 2, 3, 4, 5].map((star) => (_jsxs("div", { className: "relative group", children: [_jsx("button", { type: "button", onClick: () => setNewReview({ ...newReview, rating: star - 0.5 }), className: "absolute top-0 left-0 w-1/2 h-full z-20 focus:outline-none", title: `${star - 0.5} stars` }), _jsx("button", { type: "button", onClick: () => setNewReview({ ...newReview, rating: star }), className: "absolute top-0 right-0 w-1/2 h-full z-20 focus:outline-none", title: `${star} stars` }), _jsxs("div", { className: "relative pointer-events-none transition-transform group-hover:scale-110", children: [_jsx(Star, { className: "h-8 w-8 text-gray-200 fill-gray-200" }), newReview.rating >= star - 0.5 && (_jsx("div", { className: "absolute inset-0 overflow-hidden", style: { width: newReview.rating === star - 0.5 ? '50%' : '100%' }, children: _jsx(Star, { className: "h-8 w-8 text-gray-900 fill-gray-900" }) }))] })] }, star))), _jsx("span", { className: "ml-3 text-lg font-medium text-gray-900 w-12", children: newReview.rating })] })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "title", className: "block text-sm font-medium text-gray-700 mb-1", children: "Review Title" }), _jsx("input", { type: "text", id: "title", required: true, className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-black", placeholder: "Summarize your thoughts", value: newReview.title, onChange: (e) => setNewReview({ ...newReview, title: e.target.value }) })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "comment", className: "block text-sm font-medium text-gray-700 mb-1", children: "Review" }), _jsx("textarea", { id: "comment", required: true, rows: 4, className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-black", placeholder: "What did you like or dislike?", value: newReview.comment, onChange: (e) => setNewReview({ ...newReview, comment: e.target.value }) })] }), _jsxs("div", { className: "pt-4 flex justify-end gap-3", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => setIsReviewModalOpen(false), children: "Cancel" }), _jsx(Button, { type: "submit", className: "bg-black text-white hover:bg-gray-800", children: "Submit Review" })] })] }) }), _jsx(GuestCheckoutModal, { isOpen: showGuestModal, onClose: () => setShowGuestModal(false), onSubmit: handleGuestInfoSubmit, initialData: getGuestUserInfo() || undefined })] }));
|
|
510
511
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductsPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAgC9D,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAolBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAMpD"}
|