ublo-lib 1.45.6 → 1.45.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/es/esf/components/magic-box/magic-box.d.ts.map +1 -1
- package/es/esf/components/magic-box/magic-box.js +10 -1
- package/es/esf/components/magic-box/magic-box.module.css +9 -0
- package/es/esf/components/magic-box/messages.d.ts.map +1 -1
- package/es/esf/components/magic-box/messages.js +4 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-box.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/magic-box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"magic-box.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/magic-box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,KAAK,cAAc,GACf,0BAA0B,GAC1B,sCAAsC,GACtC,8BAA8B,CAAC;AACnC,KAAK,WAAW,GACZ,oCAAoC,GACpC,gDAAgD,GAChD,wCAAwC,CAAC;AAC7C,KAAK,aAAa,GACd,oDAAoD,GACpD,gEAAgE,GAChE,wDAAwD,CAAC;AAE7D,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH,CAAC;;AAIF,wBAAoC;AAEpC,iBAAS,QAAQ,CAAC,EAChB,IAAI,EACJ,OAAO,EACP,OAAe,EACf,SAAS,EACT,YAAY,EACZ,aAAa,EACb,OAAW,EACX,OAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,cAA2C,EAC3C,WAAkD,EAClD,aAAoE,EACpE,YAAY,EACZ,QAAQ,GACT,EAAE,KAAK,2CAsPP"}
|
|
@@ -6,8 +6,10 @@ import { useUbloContext } from "ublo/with-ublo";
|
|
|
6
6
|
import Button from "dt-design-system/es/button";
|
|
7
7
|
import Information from "dt-design-system/es/information";
|
|
8
8
|
import * as Icons from "dt-design-system/es/icons";
|
|
9
|
+
import Dialog from "dt-design-system/es/dialog";
|
|
9
10
|
import Filters from "./filters";
|
|
10
11
|
import Booking from "./booking";
|
|
12
|
+
import GescoContactForm from "../../../common/components/gesco-contact-form";
|
|
11
13
|
import { message } from "./messages";
|
|
12
14
|
import * as API from "./services/api";
|
|
13
15
|
import css from "./magic-box.module.css";
|
|
@@ -19,6 +21,7 @@ function MagicBox({ stay, cartUrl, channel = "ESF", className, alignContent, max
|
|
|
19
21
|
const [VELClosed, setVELClosed] = React.useState(false);
|
|
20
22
|
const [jmoins, setJmoins] = React.useState();
|
|
21
23
|
const [customSubmitChecked, setCustomSubmitChecked] = React.useState(false);
|
|
24
|
+
const [contactDialogOpened, setContactDialogOpened] = React.useState(false);
|
|
22
25
|
const { lang: ubloLang, config } = useUbloContext();
|
|
23
26
|
const { resort, merchant } = config;
|
|
24
27
|
const lang = ubloLang === "fr" ? "fr" : "en";
|
|
@@ -141,10 +144,16 @@ function MagicBox({ stay, cartUrl, channel = "ESF", className, alignContent, max
|
|
|
141
144
|
React.useEffect(() => {
|
|
142
145
|
refreshFilters();
|
|
143
146
|
}, [refreshFilters, stay]);
|
|
147
|
+
const openContactDialog = () => {
|
|
148
|
+
setContactDialogOpened(true);
|
|
149
|
+
};
|
|
150
|
+
const closeContactDialog = () => {
|
|
151
|
+
setContactDialogOpened(false);
|
|
152
|
+
};
|
|
144
153
|
const showFilter = stay && filters && values;
|
|
145
154
|
const SubmitIcon = customSubmitChecked ? Icons.ArrowRight : Icons.Search;
|
|
146
155
|
const classes = classNames(css.root, className);
|
|
147
|
-
return (
|
|
156
|
+
return (_jsxs("div", { className: classes, "data-align": alignContent, children: [_jsxs("div", { className: css.top, children: [children, VELClosed && !jmoins && (_jsxs(Information, { type: "error", className: css.errorMessage, children: [message(lang, "vel-closed"), _jsx(Button, { className: css.contact, onClick: openContactDialog, children: message(lang, "contact-us") })] })), jmoins && (_jsxs(Information, { type: "warning", className: css.errorMessage, children: [message(lang, "booking-block-day-minus-start"), " ", jmoins, message(lang, "booking-block-day-minus-end")] })), !VELClosed && currentStep === 0 && (_jsxs(_Fragment, { children: [!filters && _jsx("div", { className: css.loader }), showFilter && (_jsx(Filters, { filters: filters, values: values, setValues: setValues, customSubmit: customSubmit, customSubmitChecked: customSubmitChecked, setCustomSubmitChecked: setCustomSubmitChecked }))] })), _jsxs(Button, { className: css.confirm, onClick: submit, disabled: VELClosed || !isValid, children: [message(lang, customSubmitChecked ? "proceed" : "confirm"), _jsx(SubmitIcon, {})] }), currentStep === 1 && (_jsx(Booking, { stay: stay, cartUrl: cartUrl, channel: channel, values: values, maxCPDuration: maxCPDuration, setCurrentStep: setCurrentStep, msemWidgetHost: msemWidgetHost }))] }), _jsx(Dialog, { className: css.dialog, isOpened: contactDialogOpened, close: closeContactDialog, children: _jsx("div", { className: css.dialogInner, children: _jsx(GescoContactForm, { lang: lang, channel: channel, resort: resort, merchant: merchant }) }) })] }));
|
|
148
157
|
}
|
|
149
158
|
function getDefaultValues(filters) {
|
|
150
159
|
return Object.keys(filters || {}).reduce((acc, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/messages.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/messages.js"],"names":[],"mappings":"AAuCO,iDAIN"}
|
|
@@ -9,10 +9,11 @@ const locales = {
|
|
|
9
9
|
days: " pendant ",
|
|
10
10
|
durations: " sur des cours de ",
|
|
11
11
|
categories: " à ",
|
|
12
|
-
"vel-closed": "La demande de réservation d'un moniteur est indisponible. Merci de nous contacter par email
|
|
12
|
+
"vel-closed": "La demande de réservation d'un moniteur est indisponible. Merci de nous contacter par email.",
|
|
13
13
|
proceed: "Finaliser ma demande",
|
|
14
14
|
"booking-block-day-minus-start": "Nous sommes à moins de ",
|
|
15
15
|
"booking-block-day-minus-end": " jours de la date de début de votre séjour. La demande de réservation d'un moniteur n'est plus disponible. Vous pouvez venir au bureau esf à votre arrivée pour voir nos disponibilités de dernière minute.",
|
|
16
|
+
"contact-us": "Nous contacter",
|
|
16
17
|
},
|
|
17
18
|
en: {
|
|
18
19
|
confirm: "Find an instructor",
|
|
@@ -24,10 +25,11 @@ const locales = {
|
|
|
24
25
|
days: " for ",
|
|
25
26
|
durations: " with lessons of ",
|
|
26
27
|
categories: " at ",
|
|
27
|
-
"vel-closed": "The request for booking an instructor is unavailable. Please contact us by email
|
|
28
|
+
"vel-closed": "The request for booking an instructor is unavailable. Please contact us by email.",
|
|
28
29
|
proceed: "Finalize my request",
|
|
29
30
|
"booking-block-day-minus-start": "We are less than ",
|
|
30
31
|
"booking-block-day-minus-end": " days from the start date of your stay. The request for booking an instructor is no longer available. You can come to the esf office upon arrival to see our last minute availability.",
|
|
32
|
+
"contact-us": "Contact us",
|
|
31
33
|
},
|
|
32
34
|
};
|
|
33
35
|
export const message = (lang, id) => {
|