ublo-lib 1.37.16 → 1.37.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"cart-dialog-inner.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/cart-dialog-inner.js"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;4CAoGC"}
1
+ {"version":3,"file":"cart-dialog-inner.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/cart-dialog-inner.js"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;4CAuGC"}
@@ -10,7 +10,8 @@ import CrossSellingOffers from "./cross-selling-offers";
10
10
  import styles from "./cart-dialog-inner.module.css";
11
11
  const CartDialogInner = ({ kind, title, image, thumbnail, price, label, contentTitle, paxPlan, closeDialog, goToCart, cart, zoneId, zonePath, }) => {
12
12
  const [stay, setStay] = React.useState({ from: "", to: "" });
13
- const { lang } = useUbloContext();
13
+ const { lang, config } = useUbloContext();
14
+ const hasLangPrefix = config.langPrefix.links;
14
15
  React.useEffect(() => {
15
16
  const sessionStay = sessionStorage.getItem("stay");
16
17
  setStay(JSON.parse(sessionStay));
@@ -19,6 +20,6 @@ const CartDialogInner = ({ kind, title, image, thumbnail, price, label, contentT
19
20
  const formattedStayFrom = new Date(stay.from).toLocaleDateString(lang, formatOptions);
20
21
  const formattedStayTo = new Date(stay.to).toLocaleDateString(lang, formatOptions);
21
22
  const buttonClasses = classNames(styles.contentButton, styles.contentButtonContinue);
22
- return (_jsxs("div", { className: styles.inner, children: [_jsxs("div", { className: styles.title, children: [_jsx(Icons.CheckCircle, { className: styles.titleIcon }), _jsx("div", { className: styles.titleText, children: title })] }), _jsxs("div", { className: styles.content, children: [image && (_jsx("div", { className: styles.contentLeft, children: _jsx(Image, { className: styles.productImage, src: image, width: 320, height: 200, placeholder: thumbnail ? "blur" : undefined, blurDataURL: thumbnail, alt: "" }) })), _jsxs("div", { className: styles.contentRight, children: [_jsxs("div", { className: styles.wrapper, children: [label && (_jsx("div", { className: styles.contentLabel, dangerouslySetInnerHTML: { __html: label } })), price && _jsxs("div", { className: styles.price, children: [price, " \u20AC"] })] }), contentTitle && (_jsx("div", { className: styles.contentTitle, children: contentTitle })), _jsxs("div", { className: styles.stay, children: [formattedStayFrom, " \uA537 ", formattedStayTo] }), paxPlan && _jsx("div", { className: styles.paxPlan, children: paxPlan }), _jsxs("div", { className: styles.contentButtons, children: [_jsx(Button, { className: buttonClasses, variant: "secondary", onClick: closeDialog, children: message(lang, "cart-dialog-continue") }), _jsx(Button, { className: styles.contentButton, onClick: goToCart, children: message(lang, "cart-dialog-go-to-cart") })] })] })] }), kind && (_jsx(CrossSellingOffers, { kind: kind, cart: cart, closeDialog: closeDialog, zoneId: zoneId, zonePath: zonePath }))] }));
23
+ return (_jsxs("div", { className: styles.inner, children: [_jsxs("div", { className: styles.title, children: [_jsx(Icons.CheckCircle, { className: styles.titleIcon }), _jsx("div", { className: styles.titleText, children: title })] }), _jsxs("div", { className: styles.content, children: [image && (_jsx("div", { className: styles.contentLeft, children: _jsx(Image, { className: styles.productImage, src: image, width: 320, height: 200, placeholder: thumbnail ? "blur" : undefined, blurDataURL: thumbnail, alt: "" }) })), _jsxs("div", { className: styles.contentRight, children: [_jsxs("div", { className: styles.wrapper, children: [label && (_jsx("div", { className: styles.contentLabel, dangerouslySetInnerHTML: { __html: label } })), price && _jsxs("div", { className: styles.price, children: [price, " \u20AC"] })] }), contentTitle && (_jsx("div", { className: styles.contentTitle, children: contentTitle })), _jsxs("div", { className: styles.stay, children: [formattedStayFrom, " \uA537 ", formattedStayTo] }), paxPlan && _jsx("div", { className: styles.paxPlan, children: paxPlan }), _jsxs("div", { className: styles.contentButtons, children: [_jsx(Button, { tag: Link, href: hasLangPrefix ? `/${lang}/` : "/", className: buttonClasses, variant: "secondary", onClick: closeDialog, children: message(lang, "cart-dialog-continue") }), _jsx(Button, { className: styles.contentButton, onClick: goToCart, children: message(lang, "cart-dialog-go-to-cart") })] })] })] }), kind && (_jsx(CrossSellingOffers, { kind: kind, cart: cart, closeDialog: closeDialog, zoneId: zoneId, zonePath: zonePath }))] }));
23
24
  };
24
25
  export default CartDialogInner;
@@ -1 +1 @@
1
- {"version":3,"file":"cart-dialog.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/cart-dialog.js"],"names":[],"mappings":";AAsBA;;;;;;;;;4CA6DC"}
1
+ {"version":3,"file":"cart-dialog.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/cart-dialog.js"],"names":[],"mappings":";AAuBA;;;;;;;;;4CAmEC"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Router from "next/router";
2
3
  import Dialog from "dt-design-system/es/dialog";
3
4
  import ESF from "./esf";
4
5
  import ESFCustom from "./esf-custom";
@@ -35,10 +36,15 @@ const CartDialog = ({ cart, setCart, shortcuts, paxPlan, facet, zoneId, zonePath
35
36
  setCart(undefined);
36
37
  document.body.removeAttribute("style");
37
38
  };
39
+ const closeDialogAndReload = () => {
40
+ closeDialog();
41
+ Router.reload();
42
+ };
38
43
  const goToCart = () => {
39
- window.location.href = cartUrl;
44
+ closeDialog();
45
+ Router.push(cartUrl);
40
46
  };
41
47
  const Component = isSupported ? products[kind] : products.DEFAULT;
42
- return (_jsx(Dialog, { className: styles.cartDialog, isOpened: Boolean(cart), close: closeDialog, closeButtonVariant: "link", children: _jsx(Component, { kind: kind, item: newItem, data: data, closeDialog: closeDialog, goToCart: goToCart, cart: cart, paxPlan: paxPlan, facet: facet, zoneId: zoneId, zonePath: zonePath, hasImage: hasImage }) }));
48
+ return (_jsx(Dialog, { className: styles.cartDialog, isOpened: Boolean(cart), close: closeDialogAndReload, closeButtonVariant: "link", children: _jsx(Component, { kind: kind, item: newItem, data: data, closeDialog: closeDialog, goToCart: goToCart, cart: cart, paxPlan: paxPlan, facet: facet, zoneId: zoneId, zonePath: zonePath, hasImage: hasImage }) }));
43
49
  };
44
50
  export default CartDialog;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.37.16",
3
+ "version": "1.37.18",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.9.9",
6
6
  "leaflet": "^1.9.1",