ublo-lib 1.25.19 → 1.25.21
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.
|
@@ -42,14 +42,14 @@ export default function CrossSellingEditor({
|
|
|
42
42
|
section: titleZoneProps.section,
|
|
43
43
|
maxSections: 1,
|
|
44
44
|
tooltip: "Zone d'edition : Titre des offres",
|
|
45
|
-
"data-title-zone": ""
|
|
45
|
+
"data-title-zone": titleZoneProps.dataAttributeValue || ""
|
|
46
46
|
}), contentZoneProps.enabled && _jsx(Zone, {
|
|
47
47
|
ref: ref,
|
|
48
48
|
id: contentZoneProps.id || "tunnel-offers",
|
|
49
49
|
className: classNames(styles.contentZone, contentZoneProps.className),
|
|
50
50
|
section: contentZoneProps.section,
|
|
51
51
|
tooltip: "Zone d'edition : Offres",
|
|
52
|
-
"data-content-zone": ""
|
|
52
|
+
"data-content-zone": contentZoneProps.dataAttributeValue || ""
|
|
53
53
|
})]
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -2,15 +2,18 @@ import * as React from "react";
|
|
|
2
2
|
import { useUbloContext } from "ublo/with-ublo";
|
|
3
3
|
import * as API from "../services/api";
|
|
4
4
|
import * as Utils from "../services/utils";
|
|
5
|
-
export default function useCustomOffers(
|
|
5
|
+
export default function useCustomOffers({
|
|
6
|
+
titleSelector,
|
|
7
|
+
contentSelector
|
|
8
|
+
} = {}) {
|
|
6
9
|
const {
|
|
7
10
|
lang,
|
|
8
11
|
path
|
|
9
12
|
} = useUbloContext();
|
|
10
13
|
const [offers, setOffers] = React.useState();
|
|
11
14
|
React.useEffect(() => {
|
|
12
|
-
const titleZone = document.querySelector("[data-title-zone]");
|
|
13
|
-
const contentZone = document.querySelector("[data-content-zone]");
|
|
15
|
+
const titleZone = document.querySelector(titleSelector || "[data-title-zone]");
|
|
16
|
+
const contentZone = document.querySelector(contentSelector || "[data-content-zone]");
|
|
14
17
|
const getOffers = async () => {
|
|
15
18
|
const cartId = window.sessionStorage.getItem("cartId");
|
|
16
19
|
let items = {};
|
|
@@ -26,8 +29,7 @@ export default function useCustomOffers() {
|
|
|
26
29
|
items = Utils.formatCartContent(cart);
|
|
27
30
|
merchants = Utils.getMerchantsFromCart(cart);
|
|
28
31
|
stay = Utils.getStayFromCart(cart);
|
|
29
|
-
skiPassDurations = await Utils.getSkiPassDurationFromCart(cart);
|
|
30
|
-
durationTags = await Utils.getDurationTagsFromCart(cart);
|
|
32
|
+
[skiPassDurations, durationTags] = await Promise.all([Utils.getSkiPassDurationFromCart(cart), Utils.getDurationTagsFromCart(cart)]);
|
|
31
33
|
} catch (e) {}
|
|
32
34
|
}
|
|
33
35
|
const content = {
|
|
@@ -50,6 +52,6 @@ export default function useCustomOffers() {
|
|
|
50
52
|
setOffers(customOffers);
|
|
51
53
|
};
|
|
52
54
|
getOffers();
|
|
53
|
-
}, [lang, path]);
|
|
55
|
+
}, [contentSelector, lang, path, titleSelector]);
|
|
54
56
|
return offers;
|
|
55
57
|
}
|
|
@@ -67,7 +67,7 @@ export default function StandardProducts({
|
|
|
67
67
|
});
|
|
68
68
|
}, [onChange, selectedProductCategory, setPreset]);
|
|
69
69
|
return _jsx(Form, {
|
|
70
|
-
title: "Presets activit\xE9s
|
|
70
|
+
title: "Presets activit\xE9s autres produits",
|
|
71
71
|
width: 420,
|
|
72
72
|
preset: preset,
|
|
73
73
|
buttonsActions: {
|