ublo-lib 1.21.1 → 1.21.3
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.
|
@@ -2,32 +2,32 @@ import getConfig from "next/config";
|
|
|
2
2
|
// import * as Fetcher from "ublo-lib/es/common/utils/fetcher";
|
|
3
3
|
import * as Fetcher from "../../../common/utils/fetcher";
|
|
4
4
|
const { publicRuntimeConfig } = getConfig();
|
|
5
|
-
const {
|
|
5
|
+
const { lumiplanApi } = publicRuntimeConfig;
|
|
6
6
|
export async function getResortOpening(resort) {
|
|
7
|
-
const endpoint = `${
|
|
7
|
+
const endpoint = `${lumiplanApi}/resort-opening`;
|
|
8
8
|
return Fetcher.get(endpoint, { resort });
|
|
9
9
|
}
|
|
10
10
|
export async function getWeather(resort) {
|
|
11
|
-
const endpoint = `${
|
|
11
|
+
const endpoint = `${lumiplanApi}/weather`;
|
|
12
12
|
return Fetcher.get(endpoint, { resort });
|
|
13
13
|
}
|
|
14
14
|
export async function getSnow(resort) {
|
|
15
|
-
const endpoint = `${
|
|
15
|
+
const endpoint = `${lumiplanApi}/snow`;
|
|
16
16
|
return Fetcher.get(endpoint, { resort });
|
|
17
17
|
}
|
|
18
18
|
export async function getResortAccess(resort) {
|
|
19
|
-
const endpoint = `${
|
|
19
|
+
const endpoint = `${lumiplanApi}/resort-access`;
|
|
20
20
|
return Fetcher.get(endpoint, { resort });
|
|
21
21
|
}
|
|
22
22
|
export async function getSlopes(resort) {
|
|
23
|
-
const endpoint = `${
|
|
23
|
+
const endpoint = `${lumiplanApi}/slopes`;
|
|
24
24
|
return Fetcher.get(endpoint, { resort });
|
|
25
25
|
}
|
|
26
26
|
export async function getLifts(resort) {
|
|
27
|
-
const endpoint = `${
|
|
27
|
+
const endpoint = `${lumiplanApi}/lifts`;
|
|
28
28
|
return Fetcher.get(endpoint, { resort });
|
|
29
29
|
}
|
|
30
30
|
export async function getPois(resort) {
|
|
31
|
-
const endpoint = `${
|
|
31
|
+
const endpoint = `${lumiplanApi}/pois`;
|
|
32
32
|
return Fetcher.get(endpoint, { resort });
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pois.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/pois.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAyB,QAAQ,EAAQ,MAAM,SAAS,CAAC;AAwDrE,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AASF,QAAA,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"pois.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/pois.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAyB,QAAQ,EAAQ,MAAM,SAAS,CAAC;AAwDrE,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AASF,QAAA,MAAM,IAAI,8EAgLR,CAAC;AAIH,eAAe,IAAI,CAAC"}
|
|
@@ -61,12 +61,12 @@ const TRAIL_ICONS = {
|
|
|
61
61
|
DEFAULT: TrailIcons.SkiAlpin,
|
|
62
62
|
};
|
|
63
63
|
const { publicRuntimeConfig } = getConfig();
|
|
64
|
-
const {
|
|
64
|
+
const { lumiplanApi } = publicRuntimeConfig;
|
|
65
65
|
const SPECIAL_TRAILS = {
|
|
66
|
-
"Labell'glisse": `${
|
|
67
|
-
Waouland: `${
|
|
68
|
-
Opoualand: `${
|
|
69
|
-
"The Flying Donuts": `${
|
|
66
|
+
"Labell'glisse": `${lumiplanApi}/pistes-ludiques/labell-glisse.png`,
|
|
67
|
+
Waouland: `${lumiplanApi}/pistes-ludiques/waouland.png`,
|
|
68
|
+
Opoualand: `${lumiplanApi}/pistes-ludiques/opoualand.png`,
|
|
69
|
+
"The Flying Donuts": `${lumiplanApi}/pistes-ludiques/flying-donuts.png`,
|
|
70
70
|
};
|
|
71
71
|
const Pois = React.forwardRef(({ pois }, ref) => {
|
|
72
72
|
const { lang } = useUbloContext();
|
|
@@ -107,26 +107,10 @@ const Pois = React.forwardRef(({ pois }, ref) => {
|
|
|
107
107
|
? `(${t(lang, `pois.trailLevels.${trailLevel}`)})`
|
|
108
108
|
: null;
|
|
109
109
|
const specialTrail = Object.keys(SPECIAL_TRAILS).find((key) => name.includes(key));
|
|
110
|
-
// TMP
|
|
111
|
-
const isEven = Number(id) % 2 === 0;
|
|
112
|
-
const mockMessage = {
|
|
113
|
-
id: "mock",
|
|
114
|
-
type: "TEXT",
|
|
115
|
-
title: "messagePoi",
|
|
116
|
-
data: [
|
|
117
|
-
{
|
|
118
|
-
language: "fr_FR",
|
|
119
|
-
data: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
};
|
|
123
|
-
// TMP
|
|
124
110
|
const message = messagePoi?.data?.find(({ language }) => {
|
|
125
111
|
const _lang = lang === "fr" ? "fr_FR" : "en_US";
|
|
126
112
|
return language === _lang;
|
|
127
|
-
})
|
|
128
|
-
? mockMessage.data[0]
|
|
129
|
-
: undefined;
|
|
113
|
+
});
|
|
130
114
|
const hasGroomingStatus = groomingStatus !== undefined && groomingStatus !== "UNDEF";
|
|
131
115
|
const hasSnowQuality = snowQuality !== undefined && snowQuality !== "UNDEF";
|
|
132
116
|
const classes = classNames(css.poi, {
|
|
@@ -4,9 +4,9 @@ import getConfig from "next/config";
|
|
|
4
4
|
import T from "../i18n/translations";
|
|
5
5
|
import css from "./avalanche-risk.module.css";
|
|
6
6
|
const { publicRuntimeConfig } = getConfig();
|
|
7
|
-
const {
|
|
7
|
+
const { lumiplanApi } = publicRuntimeConfig;
|
|
8
8
|
export default function AvalancheRisk({ avalancheRisk }) {
|
|
9
9
|
if (!avalancheRisk || avalancheRisk === "UNDEF")
|
|
10
10
|
return null;
|
|
11
|
-
return (_jsxs("div", { className: css.avalancheRisk, children: [_jsxs("b", { children: [_jsx(T, { id: "weather.avalanche-risk.title" }), " :"] }), _jsx(Image, { src: `${
|
|
11
|
+
return (_jsxs("div", { className: css.avalancheRisk, children: [_jsxs("b", { children: [_jsx(T, { id: "weather.avalanche-risk.title" }), " :"] }), _jsx(Image, { src: `${lumiplanApi}/avalanche/${avalancheRisk}.svg`, width: 20, height: 20, alt: "" }), _jsx("span", { children: _jsx(T, { id: `weather.avalanche-risk.states.${avalancheRisk}` }) })] }));
|
|
12
12
|
}
|