payaza-storefront-layouts 1.0.40 → 1.0.41
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/alert-modal.d.ts +1 -0
- package/dist/components/ui/alert-modal.d.ts.map +1 -1
- package/dist/components/ui/alert-modal.js +1 -1
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +8 -3
- package/dist/layouts/shared/components/BaseStoreLayout.d.ts.map +1 -1
- package/dist/layouts/shared/components/BaseStoreLayout.js +3 -2
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ interface AlertModalContextType {
|
|
|
12
12
|
showAlert: (message: string, type?: AlertType, options?: AlertOptions) => void;
|
|
13
13
|
hideAlert: () => void;
|
|
14
14
|
}
|
|
15
|
+
export declare const AlertModalContext: React.Context<AlertModalContextType>;
|
|
15
16
|
export declare function AlertModalProvider({ children }: {
|
|
16
17
|
children: React.ReactNode;
|
|
17
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-modal.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-modal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAYhF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjE,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AASD,UAAU,qBAAqB;IAC7B,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/E,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"alert-modal.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-modal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAYhF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjE,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AASD,UAAU,qBAAqB;IAC7B,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/E,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,sCAA8D,CAAC;AAE7F,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CA6C7E;AAED,wBAAgB,aAAa,0BAM5B"}
|
|
@@ -4,7 +4,7 @@ import { createContext, useContext, useState, useCallback } from 'react';
|
|
|
4
4
|
import { CheckCircle2, AlertCircle, Info, AlertTriangle } from 'lucide-react';
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
import { Button } from './button';
|
|
7
|
-
const AlertModalContext = createContext(undefined);
|
|
7
|
+
export const AlertModalContext = createContext(undefined);
|
|
8
8
|
export function AlertModalProvider({ children }) {
|
|
9
9
|
const [alert, setAlert] = useState({
|
|
10
10
|
isOpen: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MotivationalHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/motivational-speaker/components/MotivationalHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAahD,UAAU,yBAAyB;IAC/B,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"MotivationalHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/motivational-speaker/components/MotivationalHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAahD,UAAU,yBAAyB;IAC/B,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,yBAAyB,2CAwqB7F"}
|
|
@@ -7,15 +7,20 @@ import Image from 'next/image';
|
|
|
7
7
|
import { formatCurrency, filterActiveServices } from '../../../lib/utils';
|
|
8
8
|
import { getBannerImage, getServiceImage, getTextContent } from '../../../lib/utils/asset-helpers';
|
|
9
9
|
import { motion, useScroll, useTransform } from 'framer-motion';
|
|
10
|
-
import { useRef, useState } from 'react';
|
|
10
|
+
import { useRef, useState, useContext } from 'react';
|
|
11
11
|
import { useAuth } from '../../../lib/auth-context';
|
|
12
12
|
import { useStore } from '../../../lib/store-context';
|
|
13
|
-
import {
|
|
13
|
+
import { AlertModalContext } from '../../../components/ui/alert-modal';
|
|
14
14
|
export function MotivationalHomePage({ storeConfig: initialConfig }) {
|
|
15
15
|
const { store } = useStore();
|
|
16
16
|
const storeConfig = store || initialConfig;
|
|
17
17
|
const { isAuthenticated } = useAuth();
|
|
18
|
-
|
|
18
|
+
// Safely get alert modal context with fallback
|
|
19
|
+
const alertContext = useContext(AlertModalContext);
|
|
20
|
+
const showAlert = alertContext?.showAlert || ((message, type, options) => {
|
|
21
|
+
// Fallback: log to console if provider is not available
|
|
22
|
+
console.log(`[Alert] ${type || 'info'}: ${message}`, options);
|
|
23
|
+
});
|
|
19
24
|
// In preview mode, use mock content if none are available
|
|
20
25
|
const isPreview = (typeof window !== 'undefined' && window.__IS_PREVIEW__) || storeConfig.layoutConfig?.isPreview;
|
|
21
26
|
const rawContent = storeConfig.services || [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseStoreLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/components/BaseStoreLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseStoreLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/components/BaseStoreLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAWvD,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,oBAAoB,2CAgF7F"}
|
|
@@ -8,6 +8,7 @@ import { usePathname } from 'next/navigation';
|
|
|
8
8
|
import { useStore } from '../../../lib/store-context';
|
|
9
9
|
import { useLoading } from '../../../lib/loading-context';
|
|
10
10
|
import { getThemeColor } from '../../../lib/utils/asset-helpers';
|
|
11
|
+
import { AlertModalProvider } from '../../../components/ui/alert-modal';
|
|
11
12
|
export function BaseStoreLayout({ children, storeConfig: initialConfig }) {
|
|
12
13
|
const pathname = usePathname();
|
|
13
14
|
const { store, cartCount } = useStore();
|
|
@@ -54,7 +55,7 @@ export function BaseStoreLayout({ children, storeConfig: initialConfig }) {
|
|
|
54
55
|
...(accentFocus ? { '--theme-accent-focus': accentFocus } : {}),
|
|
55
56
|
};
|
|
56
57
|
if (shouldHideStandardHeader) {
|
|
57
|
-
return (_jsx("div", { className: "min-h-screen flex flex-col", style: cssVariables, children: _jsxs("main", { className: "flex-1 relative", children: [isBackendLoading && _jsx(PageContentLoader, {}), _jsx(PageAnimateWrapper, { children: children })] }) }));
|
|
58
|
+
return (_jsx(AlertModalProvider, { children: _jsx("div", { className: "min-h-screen flex flex-col", style: cssVariables, children: _jsxs("main", { className: "flex-1 relative", children: [isBackendLoading && _jsx(PageContentLoader, {}), _jsx(PageAnimateWrapper, { children: children })] }) }) }));
|
|
58
59
|
}
|
|
59
|
-
return (_jsxs("div", { className: "min-h-screen flex flex-col", style: cssVariables, children: [_jsx(StoreHeader, { storeConfig: storeConfig, cartItemCount: cartCount }), _jsxs("main", { className: "flex-1 relative", children: [isBackendLoading && _jsx(PageContentLoader, {}), _jsx(PageAnimateWrapper, { children: children })] }), _jsx(StoreFooter, { storeConfig: storeConfig })] }));
|
|
60
|
+
return (_jsx(AlertModalProvider, { children: _jsxs("div", { className: "min-h-screen flex flex-col", style: cssVariables, children: [_jsx(StoreHeader, { storeConfig: storeConfig, cartItemCount: cartCount }), _jsxs("main", { className: "flex-1 relative", children: [isBackendLoading && _jsx(PageContentLoader, {}), _jsx(PageAnimateWrapper, { children: children })] }), _jsx(StoreFooter, { storeConfig: storeConfig })] }) }));
|
|
60
61
|
}
|