payaza-storefront-layouts 1.0.14 → 1.0.17
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/hooks/use-cart-api.d.ts +13 -2
- package/dist/hooks/use-cart-api.d.ts.map +1 -1
- package/dist/hooks/use-cart-api.js +71 -89
- package/dist/layouts/clothing/components/ClothingHomePage.js +3 -3
- package/dist/layouts/electronics/pages/TrackOrderPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/TrackOrderPage.js +8 -4
- package/dist/layouts/electronics-grid/pages/TrackOrderPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/TrackOrderPage.js +8 -4
- package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
- package/dist/layouts/food/components/FoodHomePage.js +4 -4
- package/dist/layouts/shared/components/GenericPageWrapper.js +1 -1
- package/dist/layouts/shared/pages/AccountPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/AccountPage.js +30 -21
- package/dist/layouts/shared/pages/TrackOrderPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/TrackOrderPage.js +8 -6
- package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/WishlistPage.js +3 -18
- package/dist/lib/preview-data.js +5 -5
- package/dist/lib/services/index.d.ts +2 -3
- package/dist/lib/services/index.d.ts.map +1 -1
- package/dist/lib/services/index.js +2 -3
- package/dist/lib/store-context.d.ts.map +1 -1
- package/dist/lib/store-context.js +89 -453
- package/dist/preview/ShadowDOMWrapper.d.ts +3 -6
- package/dist/preview/ShadowDOMWrapper.d.ts.map +1 -1
- package/dist/preview/ShadowDOMWrapper.js +61 -193
- package/package.json +2 -2
- package/dist/lib/services/cart.service.d.ts +0 -37
- package/dist/lib/services/cart.service.d.ts.map +0 -1
- package/dist/lib/services/cart.service.js +0 -55
- package/dist/lib/services/order.service.d.ts +0 -107
- package/dist/lib/services/order.service.d.ts.map +0 -1
- package/dist/lib/services/order.service.js +0 -82
- package/dist/lib/services/wishlist.service.d.ts +0 -30
- package/dist/lib/services/wishlist.service.d.ts.map +0 -1
- package/dist/lib/services/wishlist.service.js +0 -53
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import { Cart } from '../lib/services/cart.service';
|
|
2
1
|
import { StoreConfig } from '../lib/store-types';
|
|
2
|
+
export interface Cart {
|
|
3
|
+
items: CartItem[];
|
|
4
|
+
total: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CartItem {
|
|
7
|
+
id: string;
|
|
8
|
+
productId: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
price: number;
|
|
11
|
+
product?: any;
|
|
12
|
+
}
|
|
3
13
|
export interface UseCartApiResult {
|
|
4
14
|
cart: Cart | null;
|
|
5
15
|
loading: boolean;
|
|
@@ -11,7 +21,8 @@ export interface UseCartApiResult {
|
|
|
11
21
|
clearCart: () => Promise<void>;
|
|
12
22
|
}
|
|
13
23
|
/**
|
|
14
|
-
* Hook to manage cart
|
|
24
|
+
* Hook to manage cart - uses StoreContext only (localStorage-based)
|
|
25
|
+
* Note: cartService removed - all cart operations use StoreContext
|
|
15
26
|
*/
|
|
16
27
|
export declare function useCartApi(storeConfig: StoreConfig | null): UseCartApiResult;
|
|
17
28
|
//# sourceMappingURL=use-cart-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cart-api.d.ts","sourceRoot":"","sources":["../../src/hooks/use-cart-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-cart-api.d.ts","sourceRoot":"","sources":["../../src/hooks/use-cart-api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,gBAAgB,CAqH5E"}
|
|
@@ -1,126 +1,108 @@
|
|
|
1
|
-
import { useState,
|
|
2
|
-
import { cartService } from '../lib/services/cart.service';
|
|
3
|
-
import { shouldUseAPI } from '../lib/utils/demo-detection';
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
4
2
|
import { useStore } from '../lib/store-context';
|
|
5
3
|
/**
|
|
6
|
-
* Hook to manage cart
|
|
4
|
+
* Hook to manage cart - uses StoreContext only (localStorage-based)
|
|
5
|
+
* Note: cartService removed - all cart operations use StoreContext
|
|
7
6
|
*/
|
|
8
7
|
export function useCartApi(storeConfig) {
|
|
9
8
|
const { cart: localCart, addToCart: localAddToCart, updateCartQuantity, removeFromCart: localRemoveFromCart } = useStore();
|
|
10
|
-
const [apiCart, setApiCart] = useState(null);
|
|
11
9
|
const [loading, setLoading] = useState(false);
|
|
12
10
|
const [error, setError] = useState(null);
|
|
11
|
+
// Convert localCart to Cart format
|
|
12
|
+
const apiCart = localCart.length > 0 ? {
|
|
13
|
+
items: localCart.map(item => ({
|
|
14
|
+
id: item.id,
|
|
15
|
+
productId: item.productId,
|
|
16
|
+
quantity: item.quantity,
|
|
17
|
+
price: item.price,
|
|
18
|
+
product: item.product,
|
|
19
|
+
})),
|
|
20
|
+
total: localCart.reduce((sum, item) => sum + (item.price * item.quantity), 0),
|
|
21
|
+
} : null;
|
|
13
22
|
const syncCart = useCallback(async () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
// No-op: cart is managed by StoreContext (localStorage-based)
|
|
24
|
+
// This function exists for API compatibility
|
|
25
|
+
}, []);
|
|
26
|
+
const addItem = useCallback(async (productId, quantity, options) => {
|
|
27
|
+
if (!storeConfig)
|
|
28
|
+
return;
|
|
17
29
|
try {
|
|
18
30
|
setLoading(true);
|
|
19
31
|
setError(null);
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
// Find product from storeConfig
|
|
33
|
+
const product = storeConfig.products?.find(p => p.id === productId);
|
|
34
|
+
if (!product) {
|
|
35
|
+
throw new Error('Product not found');
|
|
36
|
+
}
|
|
37
|
+
// Use StoreContext addToCart (localStorage-based)
|
|
38
|
+
await localAddToCart(product, quantity, options?.variantId);
|
|
22
39
|
}
|
|
23
40
|
catch (err) {
|
|
24
|
-
const errorMessage = err instanceof Error ? err.message : 'Failed to
|
|
41
|
+
const errorMessage = err instanceof Error ? err.message : 'Failed to add item';
|
|
25
42
|
setError(errorMessage);
|
|
43
|
+
throw err;
|
|
26
44
|
}
|
|
27
45
|
finally {
|
|
28
46
|
setLoading(false);
|
|
29
47
|
}
|
|
30
|
-
}, [storeConfig]);
|
|
31
|
-
const addItem = useCallback(async (productId, quantity, options) => {
|
|
32
|
-
if (!storeConfig)
|
|
33
|
-
return;
|
|
34
|
-
if (shouldUseAPI(storeConfig.slug)) {
|
|
35
|
-
try {
|
|
36
|
-
setLoading(true);
|
|
37
|
-
await cartService.addItem(productId, quantity, options);
|
|
38
|
-
await syncCart();
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
const errorMessage = err instanceof Error ? err.message : 'Failed to add item';
|
|
42
|
-
setError(errorMessage);
|
|
43
|
-
throw err;
|
|
44
|
-
}
|
|
45
|
-
finally {
|
|
46
|
-
setLoading(false);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
// Use local storage for demo stores
|
|
51
|
-
// This will be handled by the StoreContext
|
|
52
|
-
}
|
|
53
|
-
}, [storeConfig, syncCart]);
|
|
48
|
+
}, [storeConfig, localAddToCart]);
|
|
54
49
|
const updateItem = useCallback(async (itemId, quantity) => {
|
|
55
50
|
if (!storeConfig)
|
|
56
51
|
return;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
const errorMessage = err instanceof Error ? err.message : 'Failed to update item';
|
|
65
|
-
setError(errorMessage);
|
|
66
|
-
throw err;
|
|
67
|
-
}
|
|
68
|
-
finally {
|
|
69
|
-
setLoading(false);
|
|
70
|
-
}
|
|
52
|
+
try {
|
|
53
|
+
setLoading(true);
|
|
54
|
+
setError(null);
|
|
55
|
+
// Use StoreContext updateCartQuantity (localStorage-based)
|
|
56
|
+
await updateCartQuantity(itemId, quantity);
|
|
71
57
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
catch (err) {
|
|
59
|
+
const errorMessage = err instanceof Error ? err.message : 'Failed to update item';
|
|
60
|
+
setError(errorMessage);
|
|
61
|
+
throw err;
|
|
75
62
|
}
|
|
76
|
-
|
|
63
|
+
finally {
|
|
64
|
+
setLoading(false);
|
|
65
|
+
}
|
|
66
|
+
}, [storeConfig, updateCartQuantity]);
|
|
77
67
|
const removeItem = useCallback(async (itemId) => {
|
|
78
68
|
if (!storeConfig)
|
|
79
69
|
return;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
catch (err) {
|
|
87
|
-
const errorMessage = err instanceof Error ? err.message : 'Failed to remove item';
|
|
88
|
-
setError(errorMessage);
|
|
89
|
-
throw err;
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
setLoading(false);
|
|
93
|
-
}
|
|
70
|
+
try {
|
|
71
|
+
setLoading(true);
|
|
72
|
+
setError(null);
|
|
73
|
+
// Use StoreContext removeFromCart (localStorage-based)
|
|
74
|
+
await localRemoveFromCart(itemId);
|
|
94
75
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
76
|
+
catch (err) {
|
|
77
|
+
const errorMessage = err instanceof Error ? err.message : 'Failed to remove item';
|
|
78
|
+
setError(errorMessage);
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
setLoading(false);
|
|
98
83
|
}
|
|
99
|
-
}, [storeConfig,
|
|
84
|
+
}, [storeConfig, localRemoveFromCart]);
|
|
100
85
|
const clearCart = useCallback(async () => {
|
|
101
86
|
if (!storeConfig)
|
|
102
87
|
return;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const errorMessage = err instanceof Error ? err.message : 'Failed to clear cart';
|
|
111
|
-
setError(errorMessage);
|
|
112
|
-
throw err;
|
|
113
|
-
}
|
|
114
|
-
finally {
|
|
115
|
-
setLoading(false);
|
|
88
|
+
try {
|
|
89
|
+
setLoading(true);
|
|
90
|
+
setError(null);
|
|
91
|
+
// Remove all items from cart
|
|
92
|
+
const itemsToRemove = [...localCart];
|
|
93
|
+
for (const item of itemsToRemove) {
|
|
94
|
+
await localRemoveFromCart(item.id);
|
|
116
95
|
}
|
|
117
96
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
97
|
+
catch (err) {
|
|
98
|
+
const errorMessage = err instanceof Error ? err.message : 'Failed to clear cart';
|
|
99
|
+
setError(errorMessage);
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
setLoading(false);
|
|
122
104
|
}
|
|
123
|
-
}, [storeConfig,
|
|
105
|
+
}, [storeConfig, localCart, localRemoveFromCart]);
|
|
124
106
|
return {
|
|
125
107
|
cart: apiCart,
|
|
126
108
|
loading,
|
|
@@ -114,7 +114,7 @@ export function ClothingHomePage({ storeConfig }) {
|
|
|
114
114
|
// Fallback to old format (backward compatibility)
|
|
115
115
|
heroSlides = [
|
|
116
116
|
{
|
|
117
|
-
image: getBannerImage(storeConfig, 'hero_slide_1', 'https://images.unsplash.com/photo-
|
|
117
|
+
image: getBannerImage(storeConfig, 'hero_slide_1', 'https://images.unsplash.com/photo-1523381210434-271e8be1f52b?q=80&w=2000&auto=format&fit=crop'),
|
|
118
118
|
badge: layoutConfig?.hero?.showBadges
|
|
119
119
|
? (isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.badge ? layoutConfig.text.hero.slides[0].badge : getLayoutText(storeConfig, 'hero.badge', 'New Season'))
|
|
120
120
|
: undefined,
|
|
@@ -126,7 +126,7 @@ export function ClothingHomePage({ storeConfig }) {
|
|
|
126
126
|
secondaryButtonLink: `/${storeConfig.slug}/categories`,
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
|
-
image: getBannerImage(storeConfig, 'hero_slide_2', 'https://images.unsplash.com/photo-
|
|
129
|
+
image: getBannerImage(storeConfig, 'hero_slide_2', 'https://images.unsplash.com/photo-1617059063772-34532796ddb5?q=80&w=2000&auto=format&fit=crop'),
|
|
130
130
|
badge: layoutConfig?.hero?.showBadges
|
|
131
131
|
? (isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.badge ? layoutConfig.text.hero.slides[1].badge : getLayoutText(storeConfig, 'common.trending', 'Trending Now'))
|
|
132
132
|
: undefined,
|
|
@@ -138,7 +138,7 @@ export function ClothingHomePage({ storeConfig }) {
|
|
|
138
138
|
secondaryButtonLink: `/${storeConfig.slug}/categories/men`,
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
|
-
image: getBannerImage(storeConfig, 'hero_slide_3', 'https://images.unsplash.com/photo-
|
|
141
|
+
image: getBannerImage(storeConfig, 'hero_slide_3', 'https://images.unsplash.com/photo-1558769132-cb1aea458c5e?q=80&w=2000&auto=format&fit=crop'),
|
|
142
142
|
badge: layoutConfig?.hero?.showBadges
|
|
143
143
|
? (isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.badge ? layoutConfig.text.hero.slides[2].badge : getLayoutText(storeConfig, 'common.limited', 'Limited Edition'))
|
|
144
144
|
: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrackOrderPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/TrackOrderPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TrackOrderPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/TrackOrderPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD,UAAU,mBAAmB;IAC3B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,EAAE,mBAAmB,2CAkmBlE"}
|
|
@@ -4,7 +4,8 @@ import { Search, Package, Truck, CheckCircle, Clock, AlertCircle, Loader2, XCirc
|
|
|
4
4
|
import { useState, useEffect, useRef } from 'react';
|
|
5
5
|
import { useSearchParams } from 'next/navigation';
|
|
6
6
|
import { Button } from '../../../components/ui/button';
|
|
7
|
-
|
|
7
|
+
// Note: orderService removed - this page is shared and not editable in the editor
|
|
8
|
+
// Order tracking functionality not available in preview mode
|
|
8
9
|
import { useToast } from '../../../components/ui/toast';
|
|
9
10
|
import { useLoading } from '../../../lib/loading-context';
|
|
10
11
|
export function TrackOrderPage({ storeConfig }) {
|
|
@@ -32,7 +33,9 @@ export function TrackOrderPage({ storeConfig }) {
|
|
|
32
33
|
setError(null);
|
|
33
34
|
startBackendLoading();
|
|
34
35
|
try {
|
|
35
|
-
|
|
36
|
+
// Note: orderService removed - order tracking not available in preview mode
|
|
37
|
+
setError('Order tracking is not available in preview mode. This feature requires the order service.');
|
|
38
|
+
const orderData = null;
|
|
36
39
|
processOrderData(orderData);
|
|
37
40
|
}
|
|
38
41
|
catch (error) {
|
|
@@ -254,8 +257,9 @@ export function TrackOrderPage({ storeConfig }) {
|
|
|
254
257
|
setError(null);
|
|
255
258
|
startBackendLoading();
|
|
256
259
|
try {
|
|
257
|
-
//
|
|
258
|
-
|
|
260
|
+
// Note: orderService removed - order tracking not available in preview mode
|
|
261
|
+
setError('Order tracking is not available in preview mode. This feature requires the order service.');
|
|
262
|
+
const orderData = null;
|
|
259
263
|
processOrderData(orderData);
|
|
260
264
|
}
|
|
261
265
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrackOrderPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/pages/TrackOrderPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TrackOrderPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/pages/TrackOrderPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD,UAAU,mBAAmB;IAC3B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,EAAE,mBAAmB,2CAkmBlE"}
|
|
@@ -4,7 +4,8 @@ import { Search, Package, Truck, CheckCircle, Clock, AlertCircle, Loader2, XCirc
|
|
|
4
4
|
import { useState, useEffect, useRef } from 'react';
|
|
5
5
|
import { useSearchParams } from 'next/navigation';
|
|
6
6
|
import { Button } from '../../../components/ui/button';
|
|
7
|
-
|
|
7
|
+
// Note: orderService removed - this page is shared and not editable in the editor
|
|
8
|
+
// Order tracking functionality not available in preview mode
|
|
8
9
|
import { useToast } from '../../../components/ui/toast';
|
|
9
10
|
import { useLoading } from '../../../lib/loading-context';
|
|
10
11
|
export function TrackOrderPage({ storeConfig }) {
|
|
@@ -32,7 +33,9 @@ export function TrackOrderPage({ storeConfig }) {
|
|
|
32
33
|
setError(null);
|
|
33
34
|
startBackendLoading();
|
|
34
35
|
try {
|
|
35
|
-
|
|
36
|
+
// Note: orderService removed - order tracking not available in preview mode
|
|
37
|
+
setError('Order tracking is not available in preview mode. This feature requires the order service.');
|
|
38
|
+
const orderData = null;
|
|
36
39
|
processOrderData(orderData);
|
|
37
40
|
}
|
|
38
41
|
catch (error) {
|
|
@@ -254,8 +257,9 @@ export function TrackOrderPage({ storeConfig }) {
|
|
|
254
257
|
setError(null);
|
|
255
258
|
startBackendLoading();
|
|
256
259
|
try {
|
|
257
|
-
//
|
|
258
|
-
|
|
260
|
+
// Note: orderService removed - order tracking not available in preview mode
|
|
261
|
+
setError('Order tracking is not available in preview mode. This feature requires the order service.');
|
|
262
|
+
const orderData = null;
|
|
259
263
|
processOrderData(orderData);
|
|
260
264
|
}
|
|
261
265
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoodHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food/components/FoodHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAc/D,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"FoodHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food/components/FoodHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAc/D,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,EAAE,iBAAiB,2CAw9B9D"}
|
|
@@ -109,7 +109,7 @@ export function FoodHomePage({ storeConfig }) {
|
|
|
109
109
|
// Fallback to old format (backward compatibility)
|
|
110
110
|
heroSlides = [
|
|
111
111
|
{
|
|
112
|
-
image: getBannerImage(storeConfig, 'hero_slide_1', "https://images.unsplash.com/photo-
|
|
112
|
+
image: getBannerImage(storeConfig, 'hero_slide_1', "https://images.unsplash.com/photo-1546069901-ba9599a7e63c?q=80&w=2000&auto=format&fit=crop"),
|
|
113
113
|
badge: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.badge ? layoutConfig.text.hero.slides[0].badge : getTextContent(storeConfig, 'hero_slide_1:badge', "#1 Food Delivery in Town"),
|
|
114
114
|
title: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.title ? layoutConfig.text.hero.slides[0].title : getTextContent(storeConfig, 'hero_slide_1:title', "Taste the"),
|
|
115
115
|
highlight: getTextContent(storeConfig, 'hero_slide_1:highlight', "Extraordinary"),
|
|
@@ -118,7 +118,7 @@ export function FoodHomePage({ storeConfig }) {
|
|
|
118
118
|
secondaryBtn: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.secondaryButton ? layoutConfig.text.hero.slides[0].secondaryButton : getLayoutText(storeConfig, 'common.viewMenu', "View Menu")
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
image: getBannerImage(storeConfig, 'hero_slide_2', "https://images.unsplash.com/photo-
|
|
121
|
+
image: getBannerImage(storeConfig, 'hero_slide_2', "https://images.unsplash.com/photo-1556910103-1c02745a30bf?q=80&w=2000&auto=format&fit=crop"),
|
|
122
122
|
badge: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.badge ? layoutConfig.text.hero.slides[1].badge : getTextContent(storeConfig, 'hero_slide_2:badge', "Fresh & Authentic"),
|
|
123
123
|
title: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.title ? layoutConfig.text.hero.slides[1].title : getTextContent(storeConfig, 'hero_slide_2:title', "Ingredients of"),
|
|
124
124
|
highlight: getTextContent(storeConfig, 'hero_slide_2:highlight', "Quality"),
|
|
@@ -127,7 +127,7 @@ export function FoodHomePage({ storeConfig }) {
|
|
|
127
127
|
secondaryBtn: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.secondaryButton ? layoutConfig.text.hero.slides[1].secondaryButton : getLayoutText(storeConfig, 'common.ourStory', "Our Story")
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
image: getBannerImage(storeConfig, 'hero_slide_3', "https://images.unsplash.com/photo-
|
|
130
|
+
image: getBannerImage(storeConfig, 'hero_slide_3', "https://images.unsplash.com/photo-1559339352-11d035aa65de?q=80&w=1974&auto=format&fit=crop"),
|
|
131
131
|
badge: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.badge ? layoutConfig.text.hero.slides[2].badge : getTextContent(storeConfig, 'hero_slide_3:badge', "Chef's Special"),
|
|
132
132
|
title: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.title ? layoutConfig.text.hero.slides[2].title : getTextContent(storeConfig, 'hero_slide_3:title', "Crafted with"),
|
|
133
133
|
highlight: getTextContent(storeConfig, 'hero_slide_3:highlight', "Passion"),
|
|
@@ -263,7 +263,7 @@ export function FoodHomePage({ storeConfig }) {
|
|
|
263
263
|
setIsAutoPlaying(false);
|
|
264
264
|
}, className: `transition-all duration-500 rounded-full ${index === currentSlide
|
|
265
265
|
? 'w-12 h-3 bg-orange-500 shadow-lg shadow-orange-500/50'
|
|
266
|
-
: 'w-3 h-3 bg-white/30 hover:bg-white/50'}`, "aria-label": `Go to slide ${index + 1}` }, index))) })] })), _jsx("section", { className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 -mt-20 md:-mt-32 relative z-10", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "bg-white/80 backdrop-blur-xl rounded-[2.5rem] shadow-2xl shadow-black/5 p-8 md:p-14 border border-white/20", children: [_jsxs("div", { className: "text-center mb-8 md:mb-12", children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Menu Categories" }), _jsx("h2", { className: "text-3xl md:text-4xl font-black text-gray-900 tracking-tight", children: "What are you craving?" })] }), _jsx("div", { className: "flex flex-wrap justify-center gap-8 md:gap-12", children: categories.map((category) => (_jsxs(Link, { href: `/${storeConfig.slug}/menu/${category.slug}`, className: "group flex flex-col items-center gap-5 min-w-[120px]", children: [_jsxs("div", { className: "w-24 h-24 md:w-32 md:h-32 rounded-full bg-white shadow-[0_10px_40px_rgba(0,0,0,0.08)] group-hover:shadow-[0_20px_40px_rgba(249,115,22,0.2)] flex items-center justify-center transition-all duration-500 group-hover:-translate-y-2 border-4 border-white overflow-hidden relative", children: [_jsx("div", { className: "absolute inset-0 bg-orange-50 opacity-0 group-hover:opacity-100 transition-opacity duration-500" }), _jsx(Utensils, { className: "h-10 w-10 md:h-12 md:w-12 text-gray-400 group-hover:text-orange-500 transition-colors relative z-10" })] }), _jsx("span", { className: "font-bold text-gray-600 group-hover:text-orange-600 transition-colors text-base md:text-lg tracking-tight", children: category.name })] }, category.id))) })] }) }) }), _jsx("section", { className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-[#FAFAFA]", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "text-center mb-12 md:mb-20", children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Simple Process" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 tracking-tight", children: "How It Works" })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-12 relative max-w-5xl mx-auto", children: [_jsx("div", { className: "hidden md:block absolute top-16 left-[20%] right-[20%] h-0.5 bg-gradient-to-r from-gray-200 via-orange-200 to-gray-200 -z-10 border-t-2 border-dashed border-gray-300/50" }), _jsxs("div", { className: "flex flex-col items-center text-center group", children: [_jsxs("div", { className: "w-32 h-32 rounded-[2rem] bg-white flex items-center justify-center mb-8 shadow-[0_20px_50px_rgba(0,0,0,0.05)] group-hover:shadow-[0_20px_50px_rgba(249,115,22,0.15)] group-hover:-translate-y-2 transition-all duration-500 relative z-10 border border-gray-100", children: [_jsx("div", { className: "p-4 bg-orange-50 rounded-2xl group-hover:bg-orange-100 transition-colors duration-500", children: _jsx(Smartphone, { className: "h-10 w-10 text-orange-500 group-hover:scale-110 transition-transform duration-500" }) }), _jsx("div", { className: "absolute -top-3 -right-3 w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center text-white font-bold text-sm shadow-lg", children: "1" })] }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Choose Your Dish" }), _jsx("p", { className: "text-gray-500 leading-relaxed max-w-xs font-medium", children: "Browse our diverse menu and select your favorite meals with just a few taps." })] }), _jsxs("div", { className: "flex flex-col items-center text-center group", children: [_jsxs("div", { className: "w-32 h-32 rounded-[2rem] bg-white flex items-center justify-center mb-8 shadow-[0_20px_50px_rgba(0,0,0,0.05)] group-hover:shadow-[0_20px_50px_rgba(249,115,22,0.15)] group-hover:-translate-y-2 transition-all duration-500 relative z-10 border border-gray-100", children: [_jsx("div", { className: "p-4 bg-orange-50 rounded-2xl group-hover:bg-orange-100 transition-colors duration-500", children: _jsx(ChefHat, { className: "h-10 w-10 text-orange-500 group-hover:scale-110 transition-transform duration-500" }) }), _jsx("div", { className: "absolute -top-3 -right-3 w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center text-white font-bold text-sm shadow-lg", children: "2" })] }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-4", children: "We Cook It Fresh" }), _jsx("p", { className: "text-gray-500 leading-relaxed max-w-xs font-medium", children: "Our expert chefs prepare your order using the finest, freshest ingredients." })] }), _jsxs("div", { className: "flex flex-col items-center text-center group", children: [_jsxs("div", { className: "w-32 h-32 rounded-[2rem] bg-white flex items-center justify-center mb-8 shadow-[0_20px_50px_rgba(0,0,0,0.05)] group-hover:shadow-[0_20px_50px_rgba(249,115,22,0.15)] group-hover:-translate-y-2 transition-all duration-500 relative z-10 border border-gray-100", children: [_jsx("div", { className: "p-4 bg-orange-50 rounded-2xl group-hover:bg-orange-100 transition-colors duration-500", children: _jsx(Truck, { className: "h-10 w-10 text-orange-500 group-hover:scale-110 transition-transform duration-500" }) }), _jsx("div", { className: "absolute -top-3 -right-3 w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center text-white font-bold text-sm shadow-lg", children: "3" })] }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Fast Delivery" }), _jsx("p", { className: "text-gray-500 leading-relaxed max-w-xs font-medium", children: "Receive your hot and delicious meal at your doorstep in record time." })] })] })] }) }), _jsx("section", { className: "py-16 md:py-20 px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "flex flex-col md:flex-row items-end justify-between mb-8 md:mb-12 gap-4", children: [_jsxs("div", { children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Our Menu" }), _jsx("h2", { className: "text-3xl md:text-4xl font-black text-gray-900 tracking-tight", children: getLayoutText(storeConfig, 'food.chefRecommendations', 'Chef\'s Recommendations') })] }), _jsxs(Link, { href: `/${storeConfig.slug}/menu`, className: "group flex items-center gap-2 text-gray-600 hover:text-orange-600 font-bold transition-colors", children: [getLayoutText(storeConfig, 'food.viewMenu', 'View Full Menu'), " ", _jsx(ArrowRight, { className: "h-5 w-5 transition-transform group-hover:translate-x-1" })] })] }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8", children: menuItems.slice(0, 3).map((item) => (_jsxs("div", { className: "group bg-white rounded-[2rem] border border-gray-100 shadow-sm hover:shadow-[0_20px_50px_rgba(0,0,0,0.08)] transition-all duration-500 overflow-hidden flex flex-col h-full hover:-translate-y-2", children: [_jsxs("div", { className: "relative aspect-[4/3] overflow-hidden m-3 rounded-[1.5rem]", children: [item.image ? (_jsx("div", { className: "w-full h-full relative", children: _jsx(Image, { src: item.image, alt: item.name, fill: true, className: "object-cover transition-transform duration-700 group-hover:scale-110", unoptimized: true }) })) : (_jsx("div", { className: "w-full h-full bg-gray-100 flex items-center justify-center", children: _jsx(Utensils, { className: "h-12 w-12 text-gray-300" }) })), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" }), _jsx("div", { className: "absolute top-4 right-4 bg-white/95 backdrop-blur-md px-4 py-2 rounded-full font-black text-gray-900 shadow-lg border border-white/50", children: formatCurrency(item.price, storeConfig.settings?.currency || 'USD') }), _jsx("div", { className: "hidden lg:block absolute bottom-4 left-4 right-4 translate-y-20 opacity-0 group-hover:translate-y-0 group-hover:opacity-100 transition-all duration-500 delay-100", children: _jsx(Button, { onClick: () => handleAddToCart(item), className: "w-full h-12 rounded-xl bg-white hover:bg-orange-600 text-gray-900 hover:text-white font-bold shadow-xl border-0 transition-colors", children: "Add to Order" }) }), _jsx("button", { onClick: () => handleAddToCart(item), className: "lg:hidden absolute bottom-3 right-3 bg-white text-orange-600 w-10 h-10 rounded-full shadow-lg flex items-center justify-center font-bold z-10 active:scale-95 transition-transform", children: _jsx(Plus, { className: "h-5 w-5" }) })] }), _jsxs("div", { className: "p-6 pt-2 flex flex-col flex-1", children: [_jsx("div", { className: "flex justify-between items-start mb-2", children: _jsx("h3", { className: "font-bold text-xl text-gray-900 group-hover:text-orange-600 transition-colors line-clamp-1", children: item.name }) }), _jsx("p", { className: "text-gray-500 text-sm mb-6 line-clamp-2 flex-1 leading-relaxed font-medium", children: item.description }), item.dietaryInfo && item.dietaryInfo.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mt-auto pt-4 border-t border-gray-50", children: item.dietaryInfo.map((info) => (_jsx("span", { className: "text-[10px] font-bold uppercase tracking-wider px-3 py-1.5 bg-gray-50 text-gray-600 rounded-lg group-hover:bg-orange-50 group-hover:text-orange-700 transition-colors", children: info }, info))) }))] })] }, item.id))) })] }) }), layoutConfig?.sections?.story?.show !== false && (_jsx("section", { className: "py-16 md:py-20 px-4 sm:px-6 lg:px-8 bg-white overflow-hidden", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-10 md:gap-12 lg:gap-20 items-center", children: [_jsx("div", { className: "order-2 lg:order-1", children: _jsxs("div", { className: "relative", children: [_jsx("div", { className: "absolute -top-10 -left-10 w-64 h-64 bg-orange-100 rounded-full blur-3xl opacity-50" }), _jsx("div", { className: "relative aspect-square rounded-3xl overflow-hidden shadow-2xl rotate-3 hover:rotate-0 transition-transform duration-700", children: _jsx(Image, { src: layoutConfig?.sections?.story?.image || getBannerImage(storeConfig, 'chef_image', "https://images.unsplash.com/photo-1577219491135-ce391730fb2c?q=80&w=2077&auto=format&fit=crop"), alt: "Chef Cooking", fill: true, className: "object-cover", unoptimized: true }) }), _jsx("div", { className: "absolute -bottom-8 -right-8 bg-white p-6 rounded-2xl shadow-xl animate-fade-in-up hidden md:block", children: _jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "p-3 bg-orange-100 rounded-full text-orange-600", children: _jsx(ChefHat, { className: "h-8 w-8" }) }), _jsxs("div", { children: [_jsx("p", { className: "font-bold text-gray-900 text-lg", children: "Master Chef" }), _jsx("p", { className: "text-sm text-gray-500", children: "15+ Years Experience" })] })] }) })] }) }), _jsxs("div", { className: "order-1 lg:order-2 space-y-6", children: [_jsx("span", { className: "text-orange-600 font-bold tracking-wider uppercase text-sm", children: layoutConfig?.sections?.story?.label || getLayoutText(storeConfig, 'chef_image:section_title', 'Our Story') }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 leading-tight", children: layoutConfig?.sections?.story?.title || getLayoutText(storeConfig, 'chef_image:chef_name', 'Crafted with Love, Served with Passion') }), _jsx("p", { className: "text-lg text-gray-600 leading-relaxed", children: layoutConfig?.sections?.story?.description || getLayoutText(storeConfig, 'chef_image:chef_bio', 'We believe that great food brings people together. Our chefs use only the freshest, locally-sourced ingredients to create dishes that not only taste amazing but also tell a story of tradition and innovation.') }), _jsxs("div", { className: "grid grid-cols-2 gap-6 pt-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("h4", { className: "text-3xl font-black text-gray-900", children: "15k+" }), _jsx("p", { className: "text-gray-500 font-medium", children: "Happy Customers" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("h4", { className: "text-3xl font-black text-gray-900", children: "100%" }), _jsx("p", { className: "text-gray-500 font-medium", children: "Fresh Ingredients" })] })] }), _jsx("div", { className: "pt-6", children: _jsx(Link, { href: `/${storeConfig.slug}/about`, children: _jsx(Button, { variant: "outline", className: "rounded-full px-8 py-6 border-gray-200 hover:border-orange-600 hover:text-orange-600 text-base font-bold", children: "Read More About Us" }) }) })] })] }) }) })), layoutConfig?.sections?.testimonials?.show !== false && (_jsx("section", { className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-gradient-to-b from-white via-orange-50/30 to-white", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "text-center mb-12 md:mb-20", children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Testimonials" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 tracking-tight", children: layoutConfig?.sections?.testimonials?.title || getLayoutText(storeConfig, 'sections.testimonials.title', 'What Our Customers Say') }), _jsx("p", { className: "text-gray-500 text-lg mt-4 max-w-2xl mx-auto", children: layoutConfig?.sections?.testimonials?.subtitle || getLayoutText(storeConfig, 'sections.testimonials.subtitle', 'Real experiences from food lovers who trust us') })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: (() => {
|
|
266
|
+
: 'w-3 h-3 bg-white/30 hover:bg-white/50'}`, "aria-label": `Go to slide ${index + 1}` }, index))) })] })), _jsx("section", { className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 -mt-20 md:-mt-32 relative z-10", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "bg-white/80 backdrop-blur-xl rounded-[2.5rem] shadow-2xl shadow-black/5 p-8 md:p-14 border border-white/20", children: [_jsxs("div", { className: "text-center mb-8 md:mb-12", children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Menu Categories" }), _jsx("h2", { className: "text-3xl md:text-4xl font-black text-gray-900 tracking-tight", children: "What are you craving?" })] }), _jsx("div", { className: "flex flex-wrap justify-center gap-8 md:gap-12", children: categories.map((category) => (_jsxs(Link, { href: `/${storeConfig.slug}/menu/${category.slug}`, className: "group flex flex-col items-center gap-5 min-w-[120px]", children: [_jsxs("div", { className: "w-24 h-24 md:w-32 md:h-32 rounded-full bg-white shadow-[0_10px_40px_rgba(0,0,0,0.08)] group-hover:shadow-[0_20px_40px_rgba(249,115,22,0.2)] flex items-center justify-center transition-all duration-500 group-hover:-translate-y-2 border-4 border-white overflow-hidden relative", children: [_jsx("div", { className: "absolute inset-0 bg-orange-50 opacity-0 group-hover:opacity-100 transition-opacity duration-500" }), _jsx(Utensils, { className: "h-10 w-10 md:h-12 md:w-12 text-gray-400 group-hover:text-orange-500 transition-colors relative z-10" })] }), _jsx("span", { className: "font-bold text-gray-600 group-hover:text-orange-600 transition-colors text-base md:text-lg tracking-tight", children: category.name })] }, category.id))) })] }) }) }), _jsx("section", { className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-[#FAFAFA]", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "text-center mb-12 md:mb-20", children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Simple Process" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 tracking-tight", children: "How It Works" })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-12 relative max-w-5xl mx-auto", children: [_jsx("div", { className: "hidden md:block absolute top-16 left-[20%] right-[20%] h-0.5 bg-gradient-to-r from-gray-200 via-orange-200 to-gray-200 -z-10 border-t-2 border-dashed border-gray-300/50" }), _jsxs("div", { className: "flex flex-col items-center text-center group", children: [_jsxs("div", { className: "w-32 h-32 rounded-[2rem] bg-white flex items-center justify-center mb-8 shadow-[0_20px_50px_rgba(0,0,0,0.05)] group-hover:shadow-[0_20px_50px_rgba(249,115,22,0.15)] group-hover:-translate-y-2 transition-all duration-500 relative z-10 border border-gray-100", children: [_jsx("div", { className: "p-4 bg-orange-50 rounded-2xl group-hover:bg-orange-100 transition-colors duration-500", children: _jsx(Smartphone, { className: "h-10 w-10 text-orange-500 group-hover:scale-110 transition-transform duration-500" }) }), _jsx("div", { className: "absolute -top-3 -right-3 w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center text-white font-bold text-sm shadow-lg", children: "1" })] }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Choose Your Dish" }), _jsx("p", { className: "text-gray-500 leading-relaxed max-w-xs font-medium", children: "Browse our diverse menu and select your favorite meals with just a few taps." })] }), _jsxs("div", { className: "flex flex-col items-center text-center group", children: [_jsxs("div", { className: "w-32 h-32 rounded-[2rem] bg-white flex items-center justify-center mb-8 shadow-[0_20px_50px_rgba(0,0,0,0.05)] group-hover:shadow-[0_20px_50px_rgba(249,115,22,0.15)] group-hover:-translate-y-2 transition-all duration-500 relative z-10 border border-gray-100", children: [_jsx("div", { className: "p-4 bg-orange-50 rounded-2xl group-hover:bg-orange-100 transition-colors duration-500", children: _jsx(ChefHat, { className: "h-10 w-10 text-orange-500 group-hover:scale-110 transition-transform duration-500" }) }), _jsx("div", { className: "absolute -top-3 -right-3 w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center text-white font-bold text-sm shadow-lg", children: "2" })] }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-4", children: "We Cook It Fresh" }), _jsx("p", { className: "text-gray-500 leading-relaxed max-w-xs font-medium", children: "Our expert chefs prepare your order using the finest, freshest ingredients." })] }), _jsxs("div", { className: "flex flex-col items-center text-center group", children: [_jsxs("div", { className: "w-32 h-32 rounded-[2rem] bg-white flex items-center justify-center mb-8 shadow-[0_20px_50px_rgba(0,0,0,0.05)] group-hover:shadow-[0_20px_50px_rgba(249,115,22,0.15)] group-hover:-translate-y-2 transition-all duration-500 relative z-10 border border-gray-100", children: [_jsx("div", { className: "p-4 bg-orange-50 rounded-2xl group-hover:bg-orange-100 transition-colors duration-500", children: _jsx(Truck, { className: "h-10 w-10 text-orange-500 group-hover:scale-110 transition-transform duration-500" }) }), _jsx("div", { className: "absolute -top-3 -right-3 w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center text-white font-bold text-sm shadow-lg", children: "3" })] }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Fast Delivery" }), _jsx("p", { className: "text-gray-500 leading-relaxed max-w-xs font-medium", children: "Receive your hot and delicious meal at your doorstep in record time." })] })] })] }) }), _jsx("section", { className: "py-16 md:py-20 px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "flex flex-col md:flex-row items-end justify-between mb-8 md:mb-12 gap-4", children: [_jsxs("div", { children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Our Menu" }), _jsx("h2", { className: "text-3xl md:text-4xl font-black text-gray-900 tracking-tight", children: getLayoutText(storeConfig, 'food.chefRecommendations', 'Chef\'s Recommendations') })] }), _jsxs(Link, { href: `/${storeConfig.slug}/menu`, className: "group flex items-center gap-2 text-gray-600 hover:text-orange-600 font-bold transition-colors", children: [getLayoutText(storeConfig, 'food.viewMenu', 'View Full Menu'), " ", _jsx(ArrowRight, { className: "h-5 w-5 transition-transform group-hover:translate-x-1" })] })] }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8", children: menuItems.slice(0, 3).map((item) => (_jsxs("div", { className: "group bg-white rounded-[2rem] border border-gray-100 shadow-sm hover:shadow-[0_20px_50px_rgba(0,0,0,0.08)] transition-all duration-500 overflow-hidden flex flex-col h-full hover:-translate-y-2", children: [_jsxs("div", { className: "relative aspect-[4/3] overflow-hidden m-3 rounded-[1.5rem]", children: [item.image ? (_jsx("div", { className: "w-full h-full relative", children: _jsx(Image, { src: item.image, alt: item.name, fill: true, className: "object-cover transition-transform duration-700 group-hover:scale-110", unoptimized: true }) })) : (_jsx("div", { className: "w-full h-full bg-gray-100 flex items-center justify-center", children: _jsx(Utensils, { className: "h-12 w-12 text-gray-300" }) })), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" }), _jsx("div", { className: "absolute top-4 right-4 bg-white/95 backdrop-blur-md px-4 py-2 rounded-full font-black text-gray-900 shadow-lg border border-white/50", children: formatCurrency(item.price, storeConfig.settings?.currency || 'USD') }), _jsx("div", { className: "hidden lg:block absolute bottom-4 left-4 right-4 translate-y-20 opacity-0 group-hover:translate-y-0 group-hover:opacity-100 transition-all duration-500 delay-100", children: _jsx(Button, { onClick: () => handleAddToCart(item), className: "w-full h-12 rounded-xl bg-white hover:bg-orange-600 text-gray-900 hover:text-white font-bold shadow-xl border-0 transition-colors", children: "Add to Order" }) }), _jsx("button", { onClick: () => handleAddToCart(item), className: "lg:hidden absolute bottom-3 right-3 bg-white text-orange-600 w-10 h-10 rounded-full shadow-lg flex items-center justify-center font-bold z-10 active:scale-95 transition-transform", children: _jsx(Plus, { className: "h-5 w-5" }) })] }), _jsxs("div", { className: "p-6 pt-2 flex flex-col flex-1", children: [_jsx("div", { className: "flex justify-between items-start mb-2", children: _jsx("h3", { className: "font-bold text-xl text-gray-900 group-hover:text-orange-600 transition-colors line-clamp-1", children: item.name }) }), _jsx("p", { className: "text-gray-500 text-sm mb-6 line-clamp-2 flex-1 leading-relaxed font-medium", children: item.description }), item.dietaryInfo && item.dietaryInfo.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mt-auto pt-4 border-t border-gray-50", children: item.dietaryInfo.map((info) => (_jsx("span", { className: "text-[10px] font-bold uppercase tracking-wider px-3 py-1.5 bg-gray-50 text-gray-600 rounded-lg group-hover:bg-orange-50 group-hover:text-orange-700 transition-colors", children: info }, info))) }))] })] }, item.id))) })] }) }), layoutConfig?.sections?.story?.show !== false && (_jsx("section", { className: "py-16 md:py-20 px-4 sm:px-6 lg:px-8 bg-white overflow-hidden", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-10 md:gap-12 lg:gap-20 items-center", children: [_jsx("div", { className: "order-2 lg:order-1", children: _jsxs("div", { className: "relative", children: [_jsx("div", { className: "absolute -top-10 -left-10 w-64 h-64 bg-orange-100 rounded-full blur-3xl opacity-50" }), _jsx("div", { className: "relative aspect-square rounded-3xl overflow-hidden shadow-2xl rotate-3 hover:rotate-0 transition-transform duration-700", children: _jsx(Image, { src: layoutConfig?.sections?.story?.image || getBannerImage(storeConfig, 'chef_image', "https://images.unsplash.com/photo-1583394293214-28ded15ee548?q=80&w=2000&auto=format&fit=crop"), alt: "Chef Cooking", fill: true, className: "object-cover", unoptimized: true }) }), _jsx("div", { className: "absolute -bottom-8 -right-8 bg-white p-6 rounded-2xl shadow-xl animate-fade-in-up hidden md:block", children: _jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "p-3 bg-orange-100 rounded-full text-orange-600", children: _jsx(ChefHat, { className: "h-8 w-8" }) }), _jsxs("div", { children: [_jsx("p", { className: "font-bold text-gray-900 text-lg", children: "Master Chef" }), _jsx("p", { className: "text-sm text-gray-500", children: "15+ Years Experience" })] })] }) })] }) }), _jsxs("div", { className: "order-1 lg:order-2 space-y-6", children: [_jsx("span", { className: "text-orange-600 font-bold tracking-wider uppercase text-sm", children: layoutConfig?.sections?.story?.label || getLayoutText(storeConfig, 'chef_image:section_title', 'Our Story') }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 leading-tight", children: layoutConfig?.sections?.story?.title || getLayoutText(storeConfig, 'chef_image:chef_name', 'Crafted with Love, Served with Passion') }), _jsx("p", { className: "text-lg text-gray-600 leading-relaxed", children: layoutConfig?.sections?.story?.description || getLayoutText(storeConfig, 'chef_image:chef_bio', 'We believe that great food brings people together. Our chefs use only the freshest, locally-sourced ingredients to create dishes that not only taste amazing but also tell a story of tradition and innovation.') }), _jsxs("div", { className: "grid grid-cols-2 gap-6 pt-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("h4", { className: "text-3xl font-black text-gray-900", children: "15k+" }), _jsx("p", { className: "text-gray-500 font-medium", children: "Happy Customers" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("h4", { className: "text-3xl font-black text-gray-900", children: "100%" }), _jsx("p", { className: "text-gray-500 font-medium", children: "Fresh Ingredients" })] })] }), _jsx("div", { className: "pt-6", children: _jsx(Link, { href: `/${storeConfig.slug}/about`, children: _jsx(Button, { variant: "outline", className: "rounded-full px-8 py-6 border-gray-200 hover:border-orange-600 hover:text-orange-600 text-base font-bold", children: "Read More About Us" }) }) })] })] }) }) })), layoutConfig?.sections?.testimonials?.show !== false && (_jsx("section", { className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-gradient-to-b from-white via-orange-50/30 to-white", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "text-center mb-12 md:mb-20", children: [_jsx("span", { className: "text-orange-500 font-bold tracking-widest uppercase text-xs mb-3 block", children: "Testimonials" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 tracking-tight", children: layoutConfig?.sections?.testimonials?.title || getLayoutText(storeConfig, 'sections.testimonials.title', 'What Our Customers Say') }), _jsx("p", { className: "text-gray-500 text-lg mt-4 max-w-2xl mx-auto", children: layoutConfig?.sections?.testimonials?.subtitle || getLayoutText(storeConfig, 'sections.testimonials.subtitle', 'Real experiences from food lovers who trust us') })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: (() => {
|
|
267
267
|
// Use backend testimonials if available
|
|
268
268
|
const backendTestimonials = layoutConfig?.sections?.testimonials?.items || [];
|
|
269
269
|
const fallbackTestimonials = [
|
|
@@ -13,7 +13,7 @@ export function GenericPageWrapper({ children, storeConfig }) {
|
|
|
13
13
|
// But typically we route those to ElectronicsPageWrapper.
|
|
14
14
|
const needsHeader = customLayouts.includes(storeConfig.layout);
|
|
15
15
|
if (needsHeader) {
|
|
16
|
-
return (_jsxs("div", { className: "min-h-screen flex flex-col", children: [_jsx(StoreHeader, { storeConfig: storeConfig }), _jsx("main", { className: "flex-1
|
|
16
|
+
return (_jsxs("div", { className: "min-h-screen flex flex-col", children: [_jsx(StoreHeader, { storeConfig: storeConfig }), _jsx("main", { className: "flex-1", children: children }), _jsx(StoreFooter, { storeConfig: storeConfig })] }));
|
|
17
17
|
}
|
|
18
18
|
return _jsx(_Fragment, { children: children });
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/AccountPage.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AccountPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/AccountPage.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAyChD,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAAE,WAAW,EAAE,EAAE,gBAAgB,2CA89C5D"}
|
|
@@ -10,16 +10,18 @@ import { AvatarImage } from '../../../components/ui/avatar-image';
|
|
|
10
10
|
import { useState, useEffect } from 'react';
|
|
11
11
|
import { useAuth } from '../../../lib/auth-context';
|
|
12
12
|
import { cn, formatCurrency } from '../../../lib/utils';
|
|
13
|
-
|
|
13
|
+
// Note: orderService and wishlistService removed - these pages are shared and not editable in the editor
|
|
14
|
+
// Using StoreContext for wishlist functionality instead
|
|
14
15
|
import { bookingService } from '../../../lib/services/booking.service';
|
|
15
|
-
import { wishlistService } from '../../../lib/services/wishlist.service';
|
|
16
16
|
import { customerService } from '../../../lib/services/customer.service';
|
|
17
|
+
import { useStore } from '../../../lib/store-context';
|
|
17
18
|
import { useToast } from '../../../components/ui/toast';
|
|
18
19
|
import { useLoading } from '../../../lib/loading-context';
|
|
19
20
|
import { MentorshipProgress } from '../../../components/learning/MentorshipProgress';
|
|
20
21
|
import { CertificateCard } from '../../../components/learning/CertificateTemplates';
|
|
21
22
|
export function AccountPage({ storeConfig }) {
|
|
22
23
|
const { user, isAuthenticated, isLoading, logout, updateUserState } = useAuth();
|
|
24
|
+
const { wishlist, toggleWishlist } = useStore();
|
|
23
25
|
const searchParams = useSearchParams();
|
|
24
26
|
const router = useRouter();
|
|
25
27
|
const { addToast } = useToast();
|
|
@@ -115,15 +117,9 @@ export function AccountPage({ storeConfig }) {
|
|
|
115
117
|
setIsLoadingData(true);
|
|
116
118
|
startBackendLoading();
|
|
117
119
|
try {
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
setOrders(ordersData);
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
console.error('Failed to fetch orders:', error);
|
|
125
|
-
setOrders([]);
|
|
126
|
-
}
|
|
120
|
+
// Note: orderService removed - orders not available in editor preview
|
|
121
|
+
// In production, orders would be fetched from the backend API
|
|
122
|
+
setOrders([]);
|
|
127
123
|
// Fetch bookings
|
|
128
124
|
try {
|
|
129
125
|
const bookingsData = await bookingService.getBookings();
|
|
@@ -133,13 +129,18 @@ export function AccountPage({ storeConfig }) {
|
|
|
133
129
|
console.error('Failed to fetch bookings:', error);
|
|
134
130
|
setBookings([]);
|
|
135
131
|
}
|
|
136
|
-
//
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
// Use wishlist from StoreContext (localStorage-based)
|
|
133
|
+
// Note: wishlistService removed - using StoreContext instead
|
|
134
|
+
if (wishlist && storeConfig?.products) {
|
|
135
|
+
const items = wishlist
|
|
136
|
+
.map(productId => {
|
|
137
|
+
const product = storeConfig.products?.find(p => p.id === productId);
|
|
138
|
+
return product ? { id: productId, productId, product } : null;
|
|
139
|
+
})
|
|
140
|
+
.filter((item) => item !== null);
|
|
141
|
+
setWishlistItems(items);
|
|
140
142
|
}
|
|
141
|
-
|
|
142
|
-
console.error('Failed to fetch wishlist:', error);
|
|
143
|
+
else {
|
|
143
144
|
setWishlistItems([]);
|
|
144
145
|
}
|
|
145
146
|
}
|
|
@@ -527,11 +528,19 @@ export function AccountPage({ storeConfig }) {
|
|
|
527
528
|
const storeSlug = product?.storeSlug || storeConfig?.slug;
|
|
528
529
|
return (_jsxs("div", { className: "group border border-gray-100 rounded-2xl p-4 hover:shadow-md transition-all relative bg-white", children: [_jsx("button", { className: "absolute top-4 right-4 z-10 p-2 bg-white/80 backdrop-blur rounded-full text-red-500 hover:bg-red-50 transition-colors", onClick: async () => {
|
|
529
530
|
try {
|
|
530
|
-
|
|
531
|
+
// Use StoreContext toggleWishlist (localStorage-based)
|
|
532
|
+
await toggleWishlist(item.productId);
|
|
531
533
|
addToast('Removed from wishlist', 'success');
|
|
532
|
-
// Refresh wishlist
|
|
533
|
-
|
|
534
|
-
|
|
534
|
+
// Refresh wishlist from StoreContext
|
|
535
|
+
if (wishlist && storeConfig?.products) {
|
|
536
|
+
const items = wishlist
|
|
537
|
+
.map(productId => {
|
|
538
|
+
const product = storeConfig.products?.find(p => p.id === productId);
|
|
539
|
+
return product ? { id: productId, productId, product } : null;
|
|
540
|
+
})
|
|
541
|
+
.filter((item) => item !== null);
|
|
542
|
+
setWishlistItems(items);
|
|
543
|
+
}
|
|
535
544
|
}
|
|
536
545
|
catch (error) {
|
|
537
546
|
const errorMessage = error instanceof Error ? error.message : 'Failed to remove from wishlist';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrackOrderPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/TrackOrderPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TrackOrderPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/TrackOrderPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD,UAAU,mBAAmB;IAC3B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,EAAE,mBAAmB,2CAgmBlE"}
|
|
@@ -4,7 +4,8 @@ import { Search, Package, Truck, CheckCircle, Clock, AlertCircle, Loader2, XCirc
|
|
|
4
4
|
import { useState, useEffect, useRef } from 'react';
|
|
5
5
|
import { useSearchParams } from 'next/navigation';
|
|
6
6
|
import { Button } from '../../../components/ui/button';
|
|
7
|
-
|
|
7
|
+
// Note: orderService removed - this page is shared and not editable in the editor
|
|
8
|
+
// Order tracking functionality not available in preview mode
|
|
8
9
|
import { useToast } from '../../../components/ui/toast';
|
|
9
10
|
import { useLoading } from '../../../lib/loading-context';
|
|
10
11
|
export function TrackOrderPage({ storeConfig }) {
|
|
@@ -32,8 +33,9 @@ export function TrackOrderPage({ storeConfig }) {
|
|
|
32
33
|
setError(null);
|
|
33
34
|
startBackendLoading();
|
|
34
35
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
// Note: orderService removed - order tracking not available in preview mode
|
|
37
|
+
setError('Order tracking is not available in preview mode. This feature requires the order service.');
|
|
38
|
+
setOrderStatus(null);
|
|
37
39
|
}
|
|
38
40
|
catch (error) {
|
|
39
41
|
handleTrackingError(error);
|
|
@@ -254,9 +256,9 @@ export function TrackOrderPage({ storeConfig }) {
|
|
|
254
256
|
setError(null);
|
|
255
257
|
startBackendLoading();
|
|
256
258
|
try {
|
|
257
|
-
//
|
|
258
|
-
|
|
259
|
-
|
|
259
|
+
// Note: orderService removed - order tracking not available in preview mode
|
|
260
|
+
setError('Order tracking is not available in preview mode. This feature requires the order service.');
|
|
261
|
+
setOrderStatus(null);
|
|
260
262
|
}
|
|
261
263
|
catch (error) {
|
|
262
264
|
handleTrackingError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WishlistPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/WishlistPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"WishlistPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/WishlistPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAsB9D,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,EAAE,iBAAiB,2CA+O9D"}
|