ublo-lib 1.37.17 → 1.37.19
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":";
|
|
1
|
+
{"version":3,"file":"cart-dialog-inner.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/cart-dialog-inner.js"],"names":[],"mappings":";AAWA;;;;;;;;;;;;;;4CAuGC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import Image from "next/image";
|
|
4
|
+
import Link from "ublo/link";
|
|
4
5
|
import { useUbloContext } from "ublo/with-ublo";
|
|
5
6
|
import Button from "dt-design-system/es/button";
|
|
6
7
|
import classNames from "classnames";
|
|
@@ -10,7 +11,8 @@ import CrossSellingOffers from "./cross-selling-offers";
|
|
|
10
11
|
import styles from "./cart-dialog-inner.module.css";
|
|
11
12
|
const CartDialogInner = ({ kind, title, image, thumbnail, price, label, contentTitle, paxPlan, closeDialog, goToCart, cart, zoneId, zonePath, }) => {
|
|
12
13
|
const [stay, setStay] = React.useState({ from: "", to: "" });
|
|
13
|
-
const { lang } = useUbloContext();
|
|
14
|
+
const { lang, config } = useUbloContext();
|
|
15
|
+
const hasLangPrefix = config.langPrefix.links;
|
|
14
16
|
React.useEffect(() => {
|
|
15
17
|
const sessionStay = sessionStorage.getItem("stay");
|
|
16
18
|
setStay(JSON.parse(sessionStay));
|
|
@@ -19,6 +21,6 @@ const CartDialogInner = ({ kind, title, image, thumbnail, price, label, contentT
|
|
|
19
21
|
const formattedStayFrom = new Date(stay.from).toLocaleDateString(lang, formatOptions);
|
|
20
22
|
const formattedStayTo = new Date(stay.to).toLocaleDateString(lang, formatOptions);
|
|
21
23
|
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 }))] }));
|
|
24
|
+
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
25
|
};
|
|
24
26
|
export default CartDialogInner;
|