ublo-lib 1.17.8 → 1.18.1
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/components/msem-preset-editor/editor-dialog.d.ts +2 -1
- package/es/common/components/msem-preset-editor/editor-dialog.d.ts.map +1 -1
- package/es/common/components/msem-preset-editor/editor-dialog.js +2 -2
- package/es/common/components/msem-preset-editor/editors/lodgings.d.ts +2 -1
- package/es/common/components/msem-preset-editor/editors/lodgings.d.ts.map +1 -1
- package/es/common/components/msem-preset-editor/editors/lodgings.js +2 -2
- package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts +2 -1
- package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts.map +1 -1
- package/es/common/components/msem-preset-editor/msem-preset-editor.js +2 -2
- package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts +2 -1
- package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts.map +1 -1
- package/es/common/components/msem-preset-linker/msem-preset-linker.js +2 -2
- package/es/esf/components/{instructors-book-v2 → instructors-book}/api.js +12 -8
- package/es/esf/components/{instructors-book-v2 → instructors-book}/book.js +1 -1
- package/es/esf/components/{instructors-book-v2 → instructors-book}/filters.js +2 -2
- package/es/esf/components/instructors-book/index.js +6 -3
- package/es/esf/components/{instructors-book-v2 → instructors-book}/instructor.js +6 -6
- package/es/esf/components/instructors-book/list.js +39 -170
- package/es/esf/components/instructors-book/messages.js +36 -37
- package/es/esf/components/{instructors-book-v2 → instructors-book}/sheet.js +17 -17
- package/es/esf/components/instructors-book/utils.js +48 -2
- package/package.json +1 -1
- package/es/esf/components/instructor-suggestions/fetcher.js +0 -16
- package/es/esf/components/instructor-suggestions/icons.js +0 -266
- package/es/esf/components/instructor-suggestions/index.js +0 -2
- package/es/esf/components/instructor-suggestions/instructor-suggestions.js +0 -180
- package/es/esf/components/instructor-suggestions/loader.js +0 -8
- package/es/esf/components/instructor-suggestions/messages.js +0 -16
- package/es/esf/components/instructors-book/container.js +0 -18
- package/es/esf/components/instructors-book/details.js +0 -117
- package/es/esf/components/instructors-book/icons.js +0 -266
- package/es/esf/components/instructors-book/inner.js +0 -15
- package/es/esf/components/instructors-book/instructors-book.js +0 -111
- package/es/esf/components/instructors-book/link.js +0 -17
- package/es/esf/components/instructors-book/list-utils.js +0 -18
- package/es/esf/components/instructors-book/loader.js +0 -8
- package/es/esf/components/instructors-book-v2/index.js +0 -6
- package/es/esf/components/instructors-book-v2/list.js +0 -47
- package/es/esf/components/instructors-book-v2/messages.js +0 -41
- package/es/esf/components/instructors-book-v2/utils.js +0 -51
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/book.module.css +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/filters.module.css +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/flags.js +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/instructor.module.css +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/list.module.css +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/prefixes.js +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/sheet.module.css +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/suggestions.js +0 -0
- /package/es/esf/components/{instructors-book-v2 → instructors-book}/suggestions.module.css +0 -0
|
@@ -21,11 +21,11 @@ export default function Sheet({
|
|
|
21
21
|
bookUrl
|
|
22
22
|
}) {
|
|
23
23
|
const {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
prenom,
|
|
25
|
+
nom,
|
|
26
26
|
photo,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
langues,
|
|
28
|
+
disciplines,
|
|
29
29
|
introduction,
|
|
30
30
|
description,
|
|
31
31
|
uri
|
|
@@ -65,7 +65,7 @@ export default function Sheet({
|
|
|
65
65
|
loading: "lazy",
|
|
66
66
|
src: picture,
|
|
67
67
|
className: css.imageBackground,
|
|
68
|
-
alt: `${
|
|
68
|
+
alt: `${prenom} ${nom}`,
|
|
69
69
|
width: "170",
|
|
70
70
|
height: "220"
|
|
71
71
|
}), picture ? _jsxs(_Fragment, {
|
|
@@ -75,7 +75,7 @@ export default function Sheet({
|
|
|
75
75
|
loading: "lazy",
|
|
76
76
|
src: picture,
|
|
77
77
|
className: css.image,
|
|
78
|
-
alt: `${
|
|
78
|
+
alt: `${prenom} ${nom}`,
|
|
79
79
|
onLoad: stopLoading,
|
|
80
80
|
onError: setFallbackPicture,
|
|
81
81
|
width: "190",
|
|
@@ -93,24 +93,24 @@ export default function Sheet({
|
|
|
93
93
|
className: css.name,
|
|
94
94
|
children: [_jsxs("span", {
|
|
95
95
|
className: css.firstName,
|
|
96
|
-
children: [Utils.formatNames(
|
|
96
|
+
children: [Utils.formatNames(prenom), " "]
|
|
97
97
|
}), _jsx("span", {
|
|
98
98
|
className: css.lastName,
|
|
99
|
-
children: Utils.formatNames(
|
|
99
|
+
children: Utils.formatNames(nom)
|
|
100
100
|
})]
|
|
101
|
-
}),
|
|
101
|
+
}), disciplines && _jsxs("div", {
|
|
102
102
|
className: css.activities,
|
|
103
103
|
children: [_jsx("div", {
|
|
104
104
|
className: css.activitiesTitle,
|
|
105
105
|
children: message(lang, "activities")
|
|
106
106
|
}), _jsx("div", {
|
|
107
107
|
className: css.activitiesList,
|
|
108
|
-
children:
|
|
108
|
+
children: disciplines.map((discipline, i) => {
|
|
109
109
|
const {
|
|
110
110
|
code,
|
|
111
111
|
label
|
|
112
|
-
} =
|
|
113
|
-
const length =
|
|
112
|
+
} = discipline;
|
|
113
|
+
const length = disciplines.length;
|
|
114
114
|
return _jsxs("span", {
|
|
115
115
|
className: css.activity,
|
|
116
116
|
children: [_jsx("span", {
|
|
@@ -119,19 +119,19 @@ export default function Sheet({
|
|
|
119
119
|
}, code);
|
|
120
120
|
})
|
|
121
121
|
})]
|
|
122
|
-
}),
|
|
122
|
+
}), langues && _jsxs("div", {
|
|
123
123
|
className: css.languages,
|
|
124
124
|
children: [_jsx("div", {
|
|
125
125
|
className: css.languagesTitle,
|
|
126
126
|
children: message(lang, "languages")
|
|
127
127
|
}), _jsx("div", {
|
|
128
128
|
className: css.languagesList,
|
|
129
|
-
children:
|
|
129
|
+
children: langues.map((langue, i) => {
|
|
130
130
|
const {
|
|
131
131
|
code,
|
|
132
132
|
label
|
|
133
|
-
} =
|
|
134
|
-
const length =
|
|
133
|
+
} = langue;
|
|
134
|
+
const length = langues.length;
|
|
135
135
|
return _jsxs("span", {
|
|
136
136
|
className: css.language,
|
|
137
137
|
children: [label, " ", i < length - 1 ? " - " : ""]
|
|
@@ -171,7 +171,7 @@ export default function Sheet({
|
|
|
171
171
|
fields: formFields,
|
|
172
172
|
className: css.form,
|
|
173
173
|
innerClassName: css.formInner,
|
|
174
|
-
customSend: formSendFunction(
|
|
174
|
+
customSend: formSendFunction(prenom, nom)
|
|
175
175
|
})]
|
|
176
176
|
})]
|
|
177
177
|
});
|
|
@@ -1,5 +1,51 @@
|
|
|
1
|
+
const SLASH = "/";
|
|
2
|
+
export function truncate(input, lenght = 140) {
|
|
3
|
+
return input.length > lenght ? `${input.substring(0, lenght)}...` : input;
|
|
4
|
+
}
|
|
5
|
+
export function sanitizeHTML(text) {
|
|
6
|
+
const element = document.createElement("div");
|
|
7
|
+
element.innerHTML = text;
|
|
8
|
+
return element.textContent;
|
|
9
|
+
}
|
|
10
|
+
export function propsFromQueryString() {
|
|
11
|
+
if (typeof window === "undefined") return {};
|
|
12
|
+
const params = new URLSearchParams(document.location.search);
|
|
13
|
+
const activity = params.get("activity") || undefined;
|
|
14
|
+
const language = params.get("language") || undefined;
|
|
15
|
+
return {
|
|
16
|
+
activity,
|
|
17
|
+
language
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function hasTrailingSlash(path) {
|
|
21
|
+
return path.length > 1 && path.endsWith(SLASH);
|
|
22
|
+
}
|
|
1
23
|
export const formatNames = name => {
|
|
2
24
|
const lowercasedName = name && name.toLowerCase();
|
|
3
|
-
return lowercasedName.charAt(0).toUpperCase() + lowercasedName.slice(1);
|
|
25
|
+
return lowercasedName ? lowercasedName.charAt(0).toUpperCase() + lowercasedName.slice(1) : "";
|
|
4
26
|
};
|
|
5
|
-
export
|
|
27
|
+
export function includesString(source, included) {
|
|
28
|
+
source.toLowerCase().includes(included.toLowerCase());
|
|
29
|
+
}
|
|
30
|
+
function strStartWith(str1, str2) {
|
|
31
|
+
return str1.toLowerCase().trim().startsWith(str2.toLowerCase().trim());
|
|
32
|
+
}
|
|
33
|
+
function strEquals(str1, str2) {
|
|
34
|
+
return str1.toLowerCase().trim() === str2.toLowerCase().trim();
|
|
35
|
+
}
|
|
36
|
+
function match(searchingArray, entries) {
|
|
37
|
+
return searchingArray.reduce((acc, str, index) => {
|
|
38
|
+
const matched = index === searchingArray.length - 1 ? strStartWith : strEquals;
|
|
39
|
+
return acc && entries.some(entry => matched(entry, str));
|
|
40
|
+
}, true);
|
|
41
|
+
}
|
|
42
|
+
export function filter(array, search = "") {
|
|
43
|
+
const searchingArray = search.split(" ");
|
|
44
|
+
const filtered = array.all ? array.all.filter(uri => {
|
|
45
|
+
const instructor = array.byUri[uri];
|
|
46
|
+
const firstnameWords = instructor.prenom.split(" ");
|
|
47
|
+
const lastnameWords = instructor.nom.split(" ");
|
|
48
|
+
return match(searchingArray, [...firstnameWords, ...lastnameWords]);
|
|
49
|
+
}) : [];
|
|
50
|
+
return filtered.reduce((acc, uri) => [...acc, array.byUri[uri]], []);
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const buildHost = env => env === "dev" ? "http://localhost:9002" : env === "uat" ? "https://instructors-book-server-uat.carnet-rouge-esf.com" : "https://instructors-book-server.carnet-rouge-esf.com";
|
|
2
|
-
export const fetchRandomInstructors = async (school, lang, tags, nbInstructor, env) => {
|
|
3
|
-
const res = await fetch(`${buildHost(env)}/api/instructors-book/${school}/${lang}/byTags`, {
|
|
4
|
-
method: "POST",
|
|
5
|
-
headers: {
|
|
6
|
-
"content-type": "application/json;charset=utf-8",
|
|
7
|
-
Authorization: "00q2qa545018261l252gg3414t3qa2",
|
|
8
|
-
schoolcode: school
|
|
9
|
-
},
|
|
10
|
-
body: JSON.stringify({
|
|
11
|
-
tags,
|
|
12
|
-
size: nbInstructor
|
|
13
|
-
})
|
|
14
|
-
});
|
|
15
|
-
return res.json();
|
|
16
|
-
};
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
const SvgIcon = ({
|
|
5
|
-
title,
|
|
6
|
-
...props
|
|
7
|
-
}) => _jsxs("svg", {
|
|
8
|
-
viewBox: "0 0 24 24",
|
|
9
|
-
...props,
|
|
10
|
-
children: [title && _jsx("title", {
|
|
11
|
-
children: title
|
|
12
|
-
}), props.children]
|
|
13
|
-
});
|
|
14
|
-
export const PersonIcon = props => _jsx(SvgIcon, {
|
|
15
|
-
...props,
|
|
16
|
-
children: _jsx("path", {
|
|
17
|
-
d: "M12 4c2.7614 0 5 2.23858 5 5 0 2.7614-2.2386 5-5 5-2.76142 0-5-2.2386-5-5 0-2.76142 2.23858-5 5-5m0 12.5c5.525 0 10 2.2375 10 5V24H2v-2.5c0-2.7625 4.475-5 10-5z"
|
|
18
|
-
})
|
|
19
|
-
});
|
|
20
|
-
export const ArrowDownIcon = props => _jsx(SvgIcon, {
|
|
21
|
-
...props,
|
|
22
|
-
children: _jsx("path", {
|
|
23
|
-
d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
export const CloseIcon = props => _jsx(SvgIcon, {
|
|
27
|
-
...props,
|
|
28
|
-
children: _jsx("path", {
|
|
29
|
-
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
const ArFlag = props => _jsxs(SvgIcon, {
|
|
33
|
-
...props,
|
|
34
|
-
children: [_jsx("path", {
|
|
35
|
-
d: "M0 3h24v6H0V3z",
|
|
36
|
-
fill: "#000"
|
|
37
|
-
}), _jsx("path", {
|
|
38
|
-
d: "M0 9h24v6H0V9z",
|
|
39
|
-
fill: "#fff"
|
|
40
|
-
}), _jsx("path", {
|
|
41
|
-
d: "M0 15h24v6H0v-6z",
|
|
42
|
-
fill: "#00732F"
|
|
43
|
-
})]
|
|
44
|
-
});
|
|
45
|
-
const CnFlag = props => _jsxs(SvgIcon, {
|
|
46
|
-
...props,
|
|
47
|
-
children: [_jsx("path", {
|
|
48
|
-
d: "M0 3h24v18H0V3z",
|
|
49
|
-
fill: "#DE2910"
|
|
50
|
-
}), _jsx("path", {
|
|
51
|
-
d: "M2.91 9.69L4.5 4.8l1.59 4.89-4.16-3.03h5.14L2.91 9.7zM9.9 4.88l-1.66.38 1.12-1.29-.15 1.7-.88-1.46 1.58.67zM11.6 7.01l-1.7-.3 1.55-.74-.8 1.51-.25-1.7 1.2 1.23zM11.35 10.01l-1.42-.96L11.64 9l-1.35 1.06.48-1.65.58 1.61zM9.24 11.97l-.95-1.43 1.6.6-1.65.46 1.08-1.34-.08 1.71z",
|
|
52
|
-
fill: "#FFDE00"
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
const DeFlag = props => _jsxs(SvgIcon, {
|
|
56
|
-
...props,
|
|
57
|
-
children: [_jsx("path", {
|
|
58
|
-
d: "M0 15h24v6H0v-6z",
|
|
59
|
-
fill: "#FFCE00"
|
|
60
|
-
}), _jsx("path", {
|
|
61
|
-
d: "M0 3h24v6H0V3z",
|
|
62
|
-
fill: "#000"
|
|
63
|
-
}), _jsx("path", {
|
|
64
|
-
d: "M0 9h24v6H0V9z",
|
|
65
|
-
fill: "#D00"
|
|
66
|
-
})]
|
|
67
|
-
});
|
|
68
|
-
const DkFlag = props => _jsxs(SvgIcon, {
|
|
69
|
-
...props,
|
|
70
|
-
children: [_jsx("path", {
|
|
71
|
-
d: "M0 3h24v18H0V3z",
|
|
72
|
-
fill: "#C60C30"
|
|
73
|
-
}), _jsx("path", {
|
|
74
|
-
d: "M7.7 3h2.6v18H7.7V3z",
|
|
75
|
-
fill: "#fff"
|
|
76
|
-
}), _jsx("path", {
|
|
77
|
-
d: "M0 10.7h24v2.6H0v-2.6z",
|
|
78
|
-
fill: "#fff"
|
|
79
|
-
})]
|
|
80
|
-
});
|
|
81
|
-
const EsFlag = props => _jsxs(SvgIcon, {
|
|
82
|
-
...props,
|
|
83
|
-
children: [_jsx("path", {
|
|
84
|
-
d: "M0 3h24v18H0V3z",
|
|
85
|
-
fill: "#C60B1E"
|
|
86
|
-
}), _jsx("path", {
|
|
87
|
-
d: "M0 7.5h24v9H0v-9z",
|
|
88
|
-
fill: "#FFC400"
|
|
89
|
-
})]
|
|
90
|
-
});
|
|
91
|
-
const FrFlag = props => _jsxs(SvgIcon, {
|
|
92
|
-
...props,
|
|
93
|
-
children: [_jsx("path", {
|
|
94
|
-
fillRule: "evenodd",
|
|
95
|
-
clipRule: "evenodd",
|
|
96
|
-
d: "M0 3h24v18H0V3z",
|
|
97
|
-
fill: "#fff"
|
|
98
|
-
}), _jsx("path", {
|
|
99
|
-
fillRule: "evenodd",
|
|
100
|
-
clipRule: "evenodd",
|
|
101
|
-
d: "M0 3h8v18H0V3z",
|
|
102
|
-
fill: "#00267F"
|
|
103
|
-
}), _jsx("path", {
|
|
104
|
-
fillRule: "evenodd",
|
|
105
|
-
clipRule: "evenodd",
|
|
106
|
-
d: "M16 3h8v18h-8V3z",
|
|
107
|
-
fill: "#F31830"
|
|
108
|
-
})]
|
|
109
|
-
});
|
|
110
|
-
const EnFlag = props => _jsxs(SvgIcon, {
|
|
111
|
-
...props,
|
|
112
|
-
children: [_jsx("path", {
|
|
113
|
-
d: "M-6 3h36v18H-6V3z",
|
|
114
|
-
fill: "#006"
|
|
115
|
-
}), _jsx("path", {
|
|
116
|
-
d: "M-6 3v2l32 16h4v-2L-2 3h-4zm36 0v2L-2 21h-4v-2L26 3h4z",
|
|
117
|
-
fill: "#fff"
|
|
118
|
-
}), _jsx("path", {
|
|
119
|
-
d: "M9 3v18h6V3H9zM-6 9v6h36V9H-6z",
|
|
120
|
-
fill: "#fff"
|
|
121
|
-
}), _jsx("path", {
|
|
122
|
-
d: "M-6 10.2v3.6h36v-3.6H-6zM10.2 3v18h3.6V3h-3.6zM-7 21l11-6h3l-11 6h-3zm1-18.5L7 9H4.5L-6 4V2.5zM16.5 9l12-6H31L19 9h-2.5zM30 21.5L17 15h3l10 5v1.5z",
|
|
123
|
-
fill: "#C00"
|
|
124
|
-
})]
|
|
125
|
-
});
|
|
126
|
-
const IlFlag = props => _jsxs(SvgIcon, {
|
|
127
|
-
...props,
|
|
128
|
-
children: [_jsx("path", {
|
|
129
|
-
d: "M25 21H-1V3H25v18z",
|
|
130
|
-
fill: "#fff"
|
|
131
|
-
}), _jsx("path", {
|
|
132
|
-
d: "M25 7H-1V4.8H25V7zm0 12.4H-1V17H25v2.4zM7.8 9.7l3.9 6.8 4-6.7h-8z",
|
|
133
|
-
fill: "#00C"
|
|
134
|
-
}), _jsx("path", {
|
|
135
|
-
d: "M11 14.2l.8 1.3.7-1.3H11z",
|
|
136
|
-
fill: "#fff"
|
|
137
|
-
}), _jsx("path", {
|
|
138
|
-
d: "M7.9 14.3l3.9-6.8 4 6.8h-8z",
|
|
139
|
-
fill: "#00C"
|
|
140
|
-
}), _jsx("path", {
|
|
141
|
-
d: "M11 9.8l.8-1.3.7 1.2H11zm-1.5 2.8l-.8 1.2h1.5l-.7-1.2zm-.8-2.4h1.5l-.7 1.3-.8-1.3zm5.4 2.4l.7 1.2h-1.5l.8-1.2zm.7-2.4h-1.5l.7 1.3.8-1.3zm-4 0l-1 1.8 1 1.8h1.8l1.2-1.8-1-1.8h-2z",
|
|
142
|
-
fill: "#fff"
|
|
143
|
-
})]
|
|
144
|
-
});
|
|
145
|
-
const ItFlag = props => _jsxs(SvgIcon, {
|
|
146
|
-
...props,
|
|
147
|
-
children: [_jsx("path", {
|
|
148
|
-
fillRule: "evenodd",
|
|
149
|
-
clipRule: "evenodd",
|
|
150
|
-
d: "M0 3h24v18H0V3z",
|
|
151
|
-
fill: "#fff"
|
|
152
|
-
}), _jsx("path", {
|
|
153
|
-
fillRule: "evenodd",
|
|
154
|
-
clipRule: "evenodd",
|
|
155
|
-
d: "M0 3h8v18H0V3z",
|
|
156
|
-
fill: "#009246"
|
|
157
|
-
}), _jsx("path", {
|
|
158
|
-
fillRule: "evenodd",
|
|
159
|
-
clipRule: "evenodd",
|
|
160
|
-
d: "M16 3h8v18h-8V3z",
|
|
161
|
-
fill: "#CE2B37"
|
|
162
|
-
})]
|
|
163
|
-
});
|
|
164
|
-
const JpFlag = props => _jsxs(SvgIcon, {
|
|
165
|
-
...props,
|
|
166
|
-
children: [_jsx("path", {
|
|
167
|
-
fillRule: "evenodd",
|
|
168
|
-
clipRule: "evenodd",
|
|
169
|
-
d: "M-1.5 3h27v18h-27V3z",
|
|
170
|
-
fill: "#fff"
|
|
171
|
-
}), _jsx("path", {
|
|
172
|
-
d: "M12 17.6a5.6 5.6 0 100-11.2 5.6 5.6 0 000 11.2z",
|
|
173
|
-
fill: "#D30000"
|
|
174
|
-
})]
|
|
175
|
-
});
|
|
176
|
-
const NlFlag = props => _jsxs(SvgIcon, {
|
|
177
|
-
...props,
|
|
178
|
-
children: [_jsx("path", {
|
|
179
|
-
d: "M24 3H0v18h24V3z",
|
|
180
|
-
fill: "#fff"
|
|
181
|
-
}), _jsx("path", {
|
|
182
|
-
d: "M24 15H0v6h24v-6z",
|
|
183
|
-
fill: "#21468B"
|
|
184
|
-
}), _jsx("path", {
|
|
185
|
-
fillRule: "evenodd",
|
|
186
|
-
clipRule: "evenodd",
|
|
187
|
-
d: "M0 3h24v6H0V3z",
|
|
188
|
-
fill: "#AE1C28"
|
|
189
|
-
})]
|
|
190
|
-
});
|
|
191
|
-
const PlFlag = props => _jsxs(SvgIcon, {
|
|
192
|
-
...props,
|
|
193
|
-
children: [_jsx("path", {
|
|
194
|
-
fillRule: "evenodd",
|
|
195
|
-
clipRule: "evenodd",
|
|
196
|
-
d: "M24 21H0V3h24v18z",
|
|
197
|
-
fill: "#fff"
|
|
198
|
-
}), _jsx("path", {
|
|
199
|
-
fillRule: "evenodd",
|
|
200
|
-
clipRule: "evenodd",
|
|
201
|
-
d: "M24 21H0v-9h24v9z",
|
|
202
|
-
fill: "#DC143C"
|
|
203
|
-
})]
|
|
204
|
-
});
|
|
205
|
-
const PtFlag = props => _jsxs(SvgIcon, {
|
|
206
|
-
...props,
|
|
207
|
-
children: [_jsx("path", {
|
|
208
|
-
d: "M9.6 3H24v18H9.6V3z",
|
|
209
|
-
fill: "red"
|
|
210
|
-
}), _jsx("path", {
|
|
211
|
-
d: "M0 3h9.6v18H0V3z",
|
|
212
|
-
fill: "#060"
|
|
213
|
-
})]
|
|
214
|
-
});
|
|
215
|
-
const RuFlag = props => _jsxs(SvgIcon, {
|
|
216
|
-
...props,
|
|
217
|
-
children: [_jsx("path", {
|
|
218
|
-
fillRule: "evenodd",
|
|
219
|
-
clipRule: "evenodd",
|
|
220
|
-
d: "M0 3h24v18H0V3z",
|
|
221
|
-
fill: "#fff"
|
|
222
|
-
}), _jsx("path", {
|
|
223
|
-
fillRule: "evenodd",
|
|
224
|
-
clipRule: "evenodd",
|
|
225
|
-
d: "M0 9h24v12H0V9z",
|
|
226
|
-
fill: "#0039A6"
|
|
227
|
-
}), _jsx("path", {
|
|
228
|
-
fillRule: "evenodd",
|
|
229
|
-
clipRule: "evenodd",
|
|
230
|
-
d: "M0 15h24v6H0v-6z",
|
|
231
|
-
fill: "#D52B1E"
|
|
232
|
-
})]
|
|
233
|
-
});
|
|
234
|
-
const SeFlag = props => _jsxs(SvgIcon, {
|
|
235
|
-
...props,
|
|
236
|
-
children: [_jsx("path", {
|
|
237
|
-
d: "M-2.4 3h9v7.2h-9V3zm0 10.8h9V21h-9v-7.2z",
|
|
238
|
-
fill: "#006AA7"
|
|
239
|
-
}), _jsx("path", {
|
|
240
|
-
d: "M-2.4 10.2h9v3.6h-9v-3.6zM6.6 3h3.6v18H6.6V3z",
|
|
241
|
-
fill: "#FECC00"
|
|
242
|
-
}), _jsx("path", {
|
|
243
|
-
d: "M10 10.2h16.3v3.6H10v-3.6z",
|
|
244
|
-
fill: "#FECC00"
|
|
245
|
-
}), _jsx("path", {
|
|
246
|
-
d: "M10.2 13.8h16.2V21H10.2v-7.2zm0-10.8h16.2v7.2H10.2V3z",
|
|
247
|
-
fill: "#006AA7"
|
|
248
|
-
})]
|
|
249
|
-
});
|
|
250
|
-
export const flags = {
|
|
251
|
-
ar: ArFlag,
|
|
252
|
-
cn: CnFlag,
|
|
253
|
-
de: DeFlag,
|
|
254
|
-
dk: DkFlag,
|
|
255
|
-
en: EnFlag,
|
|
256
|
-
es: EsFlag,
|
|
257
|
-
fr: FrFlag,
|
|
258
|
-
il: IlFlag,
|
|
259
|
-
it: ItFlag,
|
|
260
|
-
jp: JpFlag,
|
|
261
|
-
nl: NlFlag,
|
|
262
|
-
pl: PlFlag,
|
|
263
|
-
pt: PtFlag,
|
|
264
|
-
ru: RuFlag,
|
|
265
|
-
se: SeFlag
|
|
266
|
-
};
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useEffect, useState, useMemo } from "react";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import { useUbloContext } from "ublo/with-ublo";
|
|
5
|
-
import { fetchRandomInstructors } from "./fetcher";
|
|
6
|
-
import { PersonIcon, ArrowDownIcon, CloseIcon, flags } from "./icons";
|
|
7
|
-
import Loader from "./loader";
|
|
8
|
-
import messages from "./messages";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
-
const InstructorSuggestions = ({
|
|
13
|
-
size,
|
|
14
|
-
buildHref,
|
|
15
|
-
env
|
|
16
|
-
}) => {
|
|
17
|
-
const {
|
|
18
|
-
seo,
|
|
19
|
-
lang,
|
|
20
|
-
config
|
|
21
|
-
} = useUbloContext();
|
|
22
|
-
const {
|
|
23
|
-
resort: school
|
|
24
|
-
} = config;
|
|
25
|
-
const tags = useMemo(() => seo && seo.keywords && seo.keywords.trim() !== "" ? seo.keywords.split(",") : undefined, [seo]);
|
|
26
|
-
const [instructors, setInstructors] = useState();
|
|
27
|
-
const [instructor, setInstructor] = useState();
|
|
28
|
-
const texts = messages(lang);
|
|
29
|
-
const selectInstructor = instructor => () => {
|
|
30
|
-
setInstructor(instructor);
|
|
31
|
-
};
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
const fetchInstructors = async () => {
|
|
34
|
-
if (school && lang && tags) {
|
|
35
|
-
const instructors = await fetchRandomInstructors(school, lang, tags, size, env);
|
|
36
|
-
setInstructors(instructors);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
fetchInstructors();
|
|
40
|
-
}, [school, lang, tags, size, env]);
|
|
41
|
-
const renderDetails = () => {
|
|
42
|
-
const {
|
|
43
|
-
firstname,
|
|
44
|
-
lastname,
|
|
45
|
-
languages,
|
|
46
|
-
activities,
|
|
47
|
-
introduction,
|
|
48
|
-
description,
|
|
49
|
-
uri
|
|
50
|
-
} = instructor;
|
|
51
|
-
return _jsxs(_Fragment, {
|
|
52
|
-
children: [_jsx("div", {
|
|
53
|
-
className: "instructor-suggestions__details-close",
|
|
54
|
-
onClick: selectInstructor(),
|
|
55
|
-
children: _jsx(CloseIcon, {
|
|
56
|
-
className: "instructor-suggestions__details-close-icon"
|
|
57
|
-
})
|
|
58
|
-
}), _jsxs("div", {
|
|
59
|
-
className: "instructor-suggestions__details-data",
|
|
60
|
-
children: [_jsxs("div", {
|
|
61
|
-
className: "instructor-suggestions__details-name",
|
|
62
|
-
children: [_jsx("span", {
|
|
63
|
-
className: "instructor-suggestions__details-firstname",
|
|
64
|
-
children: firstname
|
|
65
|
-
}), " ", _jsx("span", {
|
|
66
|
-
className: "instructor-suggestions__details-lastname",
|
|
67
|
-
children: lastname
|
|
68
|
-
})]
|
|
69
|
-
}), _jsx("div", {
|
|
70
|
-
className: "instructor-suggestions__details-langs",
|
|
71
|
-
children: languages && languages.map(({
|
|
72
|
-
code,
|
|
73
|
-
label
|
|
74
|
-
}) => {
|
|
75
|
-
const Flag = flags[code];
|
|
76
|
-
return Flag ? _jsx(Flag, {
|
|
77
|
-
className: "instructor-suggestions__details-lang",
|
|
78
|
-
title: label
|
|
79
|
-
}, code) : _jsx("div", {
|
|
80
|
-
className: "instructor-suggestions__details-langtext",
|
|
81
|
-
children: label
|
|
82
|
-
}, code);
|
|
83
|
-
})
|
|
84
|
-
}), activities && _jsxs("div", {
|
|
85
|
-
className: "instructor-suggestions__details-skills",
|
|
86
|
-
children: ["Mes sp\xE9cialit\xE9s sont :", " ", activities.map(({
|
|
87
|
-
code,
|
|
88
|
-
label
|
|
89
|
-
}, index) => {
|
|
90
|
-
const length = activities.length;
|
|
91
|
-
return _jsxs("div", {
|
|
92
|
-
className: "instructor-suggestions__details-skill",
|
|
93
|
-
children: [_jsx("span", {
|
|
94
|
-
className: "instructor-suggestions__details-skillspan",
|
|
95
|
-
children: label
|
|
96
|
-
}), index < length - 2 ? ", " : index < length - 1 ? texts["instructor-suggestions-and"] : ""]
|
|
97
|
-
}, code);
|
|
98
|
-
})]
|
|
99
|
-
})]
|
|
100
|
-
}), _jsxs("div", {
|
|
101
|
-
className: "instructor-suggestions__details-description",
|
|
102
|
-
children: [_jsx("div", {
|
|
103
|
-
className: "instructor-suggestions__details-mojo",
|
|
104
|
-
dangerouslySetInnerHTML: {
|
|
105
|
-
__html: introduction
|
|
106
|
-
}
|
|
107
|
-
}), description && description.trim() !== "" && _jsxs(_Fragment, {
|
|
108
|
-
children: [_jsx("div", {
|
|
109
|
-
className: "instructor-suggestions__details-description-title",
|
|
110
|
-
children: texts["instructor-suggestions-about"]
|
|
111
|
-
}), _jsx("div", {
|
|
112
|
-
className: "instructor-suggestions__details-text",
|
|
113
|
-
dangerouslySetInnerHTML: {
|
|
114
|
-
__html: description
|
|
115
|
-
}
|
|
116
|
-
})]
|
|
117
|
-
})]
|
|
118
|
-
}), buildHref && _jsx("div", {
|
|
119
|
-
className: "instructor-suggestions__details-bottom",
|
|
120
|
-
children: _jsx("a", {
|
|
121
|
-
className: "instructor-suggestions__details-see-more",
|
|
122
|
-
href: buildHref(uri),
|
|
123
|
-
children: texts["instructor-suggestions-see-full-version"]
|
|
124
|
-
})
|
|
125
|
-
})]
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
const renderInstructors = () => {
|
|
129
|
-
return instructors.map(instructor => {
|
|
130
|
-
const {
|
|
131
|
-
uri,
|
|
132
|
-
photo,
|
|
133
|
-
firstname,
|
|
134
|
-
lastname
|
|
135
|
-
} = instructor;
|
|
136
|
-
return _jsx("div", {
|
|
137
|
-
className: "instructor-suggestions__instructor",
|
|
138
|
-
onClick: selectInstructor(instructor),
|
|
139
|
-
children: _jsxs("div", {
|
|
140
|
-
className: "instructor-suggestions__instructor-inner",
|
|
141
|
-
children: [_jsx("div", {
|
|
142
|
-
className: "instructor-suggestions__instructor-image-container",
|
|
143
|
-
children: photo ? _jsx("img", {
|
|
144
|
-
src: photo,
|
|
145
|
-
className: "instructor-suggestions__instructor-image",
|
|
146
|
-
alt: `${firstname}-${lastname}`
|
|
147
|
-
}) : _jsx(PersonIcon, {
|
|
148
|
-
className: "instructor-suggestions__instructor-imageplaceholder"
|
|
149
|
-
})
|
|
150
|
-
}), _jsx("div", {
|
|
151
|
-
className: "instructor-suggestions__instructor-firstname",
|
|
152
|
-
children: firstname
|
|
153
|
-
}), _jsx("div", {
|
|
154
|
-
className: "instructor-suggestions__instructor-lastname",
|
|
155
|
-
children: lastname
|
|
156
|
-
}), _jsx("div", {
|
|
157
|
-
className: "instructor-suggestions__instructor-arrow-container",
|
|
158
|
-
children: _jsx(ArrowDownIcon, {
|
|
159
|
-
className: "instructor-suggestions__instructor-arrow"
|
|
160
|
-
})
|
|
161
|
-
})]
|
|
162
|
-
})
|
|
163
|
-
}, uri);
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
const detailsClasses = classNames("instructor-suggestions__details", {
|
|
167
|
-
"instructor-suggestions__details__open": instructor
|
|
168
|
-
});
|
|
169
|
-
return _jsxs("div", {
|
|
170
|
-
className: "instructor-suggestions",
|
|
171
|
-
children: [_jsx("div", {
|
|
172
|
-
className: "instructor-suggestions__instructors",
|
|
173
|
-
children: instructors ? renderInstructors() : _jsx(Loader, {})
|
|
174
|
-
}), _jsx("div", {
|
|
175
|
-
className: detailsClasses,
|
|
176
|
-
children: instructor ? renderDetails() : ""
|
|
177
|
-
})]
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
export default InstructorSuggestions;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const messages = {
|
|
2
|
-
fr: {
|
|
3
|
-
"instructor-suggestions-about": "À propos",
|
|
4
|
-
"instructor-suggestions-and": " et ",
|
|
5
|
-
"instructor-suggestions-see-full-version": "Voir la version complète"
|
|
6
|
-
},
|
|
7
|
-
en: {
|
|
8
|
-
"instructor-suggestions-about": "About",
|
|
9
|
-
"instructor-suggestions-and": " and ",
|
|
10
|
-
"instructor-suggestions-see-full-version": "See full version"
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export default (lang => {
|
|
14
|
-
const l = messages[lang] === undefined ? "en" : lang;
|
|
15
|
-
return messages[l];
|
|
16
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import Link from "./link";
|
|
3
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const Container = ({
|
|
6
|
-
trombi,
|
|
7
|
-
children,
|
|
8
|
-
...props
|
|
9
|
-
}) => {
|
|
10
|
-
return trombi ? _jsxs("div", {
|
|
11
|
-
...props,
|
|
12
|
-
children: [" ", children]
|
|
13
|
-
}) : _jsx(Link, {
|
|
14
|
-
...props,
|
|
15
|
-
children: children
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export default Container;
|