ublo-lib 1.44.23 → 1.44.25
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/common/hooks/use-account.d.ts.map +1 -1
- package/es/common/hooks/use-account.js +2 -1
- package/es/lbm/components/lumiplan/todays-tips.d.ts.map +1 -1
- package/es/lbm/components/lumiplan/todays-tips.js +14 -1
- package/es/lbm/components/lumiplan/todays-tips.module.css +4 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-account.ts"],"names":[],"mappings":"AAMA,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAMF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,OAAe,EACf,WAAW,EACX,QAAQ,GACT,GAAE,KAAU,
|
|
1
|
+
{"version":3,"file":"use-account.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-account.ts"],"names":[],"mappings":"AAMA,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAMF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,OAAe,EACf,WAAW,EACX,QAAQ,GACT,GAAE,KAAU,QA0BZ"}
|
|
@@ -4,7 +4,7 @@ import { useUbloContext } from "ublo/with-ublo";
|
|
|
4
4
|
import * as Plausible from "../components/plausible";
|
|
5
5
|
import { loadJS } from "../utils/load-js";
|
|
6
6
|
const { publicRuntimeConfig } = getConfig();
|
|
7
|
-
const { langPrefix, resort } = publicRuntimeConfig;
|
|
7
|
+
const { langPrefix, resort, merchant } = publicRuntimeConfig;
|
|
8
8
|
const hasLangPrefix = langPrefix.links;
|
|
9
9
|
export default function useAccount({ channel = "ESF", integration, cartPath, } = {}) {
|
|
10
10
|
const { lang } = useUbloContext();
|
|
@@ -20,6 +20,7 @@ export default function useAccount({ channel = "ESF", integration, cartPath, } =
|
|
|
20
20
|
groundedTo: "#msem-account",
|
|
21
21
|
analytics: Plausible.callback,
|
|
22
22
|
resort,
|
|
23
|
+
merchant,
|
|
23
24
|
cartUrl,
|
|
24
25
|
});
|
|
25
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todays-tips.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/todays-tips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"todays-tips.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/todays-tips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,KAAK,GAAG;IACX,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,QAAA,MAAM,UAAU,8EAsDf,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
3
4
|
import { useUbloContext } from "ublo/with-ublo";
|
|
4
5
|
import Loader from "dt-design-system/es/loader";
|
|
5
6
|
import { t } from "./i18n/translations";
|
|
6
7
|
import css from "./todays-tips.module.css";
|
|
7
8
|
const TodaysTips = React.forwardRef(({ resortOpening }, ref) => {
|
|
9
|
+
const textRef = React.useRef(null);
|
|
8
10
|
const { lang } = useUbloContext();
|
|
11
|
+
const [isEmpty, setIsEmpty] = React.useState(true);
|
|
9
12
|
const todaysTips = resortOpening?.resortInfos?.find(({ type }) => type === "RESORT_TIP_OF_THE_DAY");
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
const textContainer = textRef.current;
|
|
15
|
+
if (textContainer) {
|
|
16
|
+
const isEmpty = textContainer.textContent?.trim() === "";
|
|
17
|
+
setIsEmpty(isEmpty);
|
|
18
|
+
}
|
|
19
|
+
}, [todaysTips]);
|
|
10
20
|
if (todaysTips === undefined) {
|
|
11
21
|
return (_jsx("div", { ref: ref, className: css.loader, children: _jsx(Loader, { variant: "overlay" }) }));
|
|
12
22
|
}
|
|
@@ -17,7 +27,10 @@ const TodaysTips = React.forwardRef(({ resortOpening }, ref) => {
|
|
|
17
27
|
if (!text?.data) {
|
|
18
28
|
return null;
|
|
19
29
|
}
|
|
20
|
-
|
|
30
|
+
const classes = classNames(css.tips, {
|
|
31
|
+
[css.empty]: isEmpty,
|
|
32
|
+
});
|
|
33
|
+
return (_jsxs("div", { ref: ref, className: classes, children: [_jsx("div", { className: css.title, dangerouslySetInnerHTML: { __html: t(lang, "todays-tips.title") } }), _jsx("div", { ref: textRef, className: css.text, dangerouslySetInnerHTML: { __html: text.data } })] }));
|
|
21
34
|
});
|
|
22
35
|
TodaysTips.displayName = "TodaysTips";
|
|
23
36
|
export default TodaysTips;
|