@logora/debate 0.4.82 → 0.4.84
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,102 +1,107 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useAuthInterceptor as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { jsx as A, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useEffect as C } from "react";
|
|
3
|
+
import { useConfig as T } from "../../data/config_provider/useConfig.js";
|
|
4
|
+
import { useAuthInterceptor as I } from "../use_auth/useAuthInterceptor.js";
|
|
5
|
+
import { useAuth as S } from "../use_auth/useAuth.js";
|
|
6
|
+
import { authTokenHandler as q } from "../use_auth/authTokenHandler.js";
|
|
7
|
+
import { useAuthActions as B } from "../use_auth/useAuthActions.js";
|
|
8
|
+
import { useAuthRequired as D } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
8
9
|
import { AuthProviderFactory as F } from "../providers/AuthProviderFactory.js";
|
|
9
10
|
import { OnboardingModal as J } from "../../user/onboarding_modal/OnboardingModal.js";
|
|
10
11
|
import { saveOnboardingBeforeLogin as M } from "../../user/onboarding_modal/useOnboarding.js";
|
|
11
|
-
import { httpClient as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return atob(
|
|
15
|
-
},
|
|
16
|
-
if (!
|
|
12
|
+
import { httpClient as d } from "../../data/axios_client/httpClient.js";
|
|
13
|
+
const j = (e) => {
|
|
14
|
+
const t = e.replace(/-/g, "+").replace(/_/g, "/"), a = t.padEnd(t.length + (4 - t.length % 4) % 4, "=");
|
|
15
|
+
return new TextDecoder().decode(Uint8Array.from(atob(a), (r) => r.charCodeAt(0)));
|
|
16
|
+
}, x = (e) => {
|
|
17
|
+
if (!e || typeof e != "string")
|
|
17
18
|
return null;
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
19
|
+
const t = e.split(".");
|
|
20
|
+
if (t.length < 2)
|
|
20
21
|
return null;
|
|
21
22
|
try {
|
|
22
|
-
return JSON.parse(
|
|
23
|
+
return JSON.parse(j(t[1]));
|
|
23
24
|
} catch {
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
26
|
-
}, z = (
|
|
27
|
-
if (!
|
|
27
|
+
}, z = (e, t) => {
|
|
28
|
+
if (!e || typeof e != "object")
|
|
28
29
|
return {};
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
return typeof
|
|
30
|
+
const a = t || {}, r = (u) => {
|
|
31
|
+
const o = a[u];
|
|
32
|
+
return typeof o == "string" && o.length > 0 ? o.split(".").reduce((i, c) => i == null ? i : i[c], e) : e[u];
|
|
32
33
|
};
|
|
33
34
|
return {
|
|
34
|
-
first_name:
|
|
35
|
-
last_name:
|
|
36
|
-
image_url:
|
|
35
|
+
first_name: r("first_name"),
|
|
36
|
+
last_name: r("last_name"),
|
|
37
|
+
image_url: r("image_url")
|
|
37
38
|
};
|
|
38
|
-
},
|
|
39
|
-
const u = "logora_user_token",
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
), [
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
}, ee = ({ authUrl: e, authType: t, provider: a, assertion: r }) => {
|
|
40
|
+
const u = "logora_user_token", o = T();
|
|
41
|
+
I(d, e, u);
|
|
42
|
+
const i = z(
|
|
43
|
+
x(r),
|
|
44
|
+
o.auth?.userProfileMapping
|
|
45
|
+
), [c, m] = k(!1), { setAuthError: b } = S(), { getToken: P, removeToken: U, fetchToken: y } = q(
|
|
46
|
+
d,
|
|
47
|
+
e,
|
|
47
48
|
u
|
|
48
|
-
), { loginUser: g, logoutUser:
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
), { loginUser: g, logoutUser: E, fetchUser: p } = B(
|
|
50
|
+
d,
|
|
51
|
+
e,
|
|
51
52
|
u
|
|
52
|
-
),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}, []),
|
|
53
|
+
), w = D();
|
|
54
|
+
C(() => {
|
|
55
|
+
h();
|
|
56
|
+
}, []), C(() => {
|
|
56
57
|
if (typeof window < "u")
|
|
57
|
-
return window.addEventListener("logora:authentication:require",
|
|
58
|
-
window.removeEventListener("logora:authentication:require",
|
|
58
|
+
return window.addEventListener("logora:authentication:require", w), window.addEventListener("logora:authentication:refresh", h), () => {
|
|
59
|
+
window.removeEventListener("logora:authentication:require", w), window.removeEventListener("logora:authentication:refresh", h);
|
|
59
60
|
};
|
|
60
61
|
}, []);
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
|
|
62
|
+
const h = () => {
|
|
63
|
+
const s = v(), n = P();
|
|
64
|
+
if (n) {
|
|
65
|
+
const f = n.session_id;
|
|
66
|
+
s.isSameUser(f) ? p() : (U(), _(s));
|
|
66
67
|
} else
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
if (
|
|
73
|
-
|
|
68
|
+
_(s);
|
|
69
|
+
}, _ = (s) => {
|
|
70
|
+
if (s.shouldInitAuth()) {
|
|
71
|
+
const n = s.getAuthorizationParams();
|
|
72
|
+
if (n) {
|
|
73
|
+
if (t !== "social" && t !== "oauth2_server" && o.auth?.showOnboardingBeforeLogin === !0) {
|
|
74
|
+
y({ ...n, create_user: !1 }).then(() => p()).catch((l) => {
|
|
75
|
+
l?.response?.data?.error_description === "user_not_found" ? m(!0) : b(l);
|
|
76
|
+
});
|
|
74
77
|
return;
|
|
75
78
|
}
|
|
76
|
-
g(
|
|
79
|
+
g(n);
|
|
77
80
|
}
|
|
78
81
|
} else
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
const
|
|
82
|
-
M(
|
|
83
|
-
},
|
|
84
|
-
return /* @__PURE__ */
|
|
82
|
+
E();
|
|
83
|
+
}, L = (s, n) => {
|
|
84
|
+
const l = v().getAuthorizationParams();
|
|
85
|
+
M(o.shortname, n), m(!1), g(l);
|
|
86
|
+
}, v = () => F.create(t, a, r);
|
|
87
|
+
return /* @__PURE__ */ A(O, { children: c && /* @__PURE__ */ A(
|
|
85
88
|
J,
|
|
86
89
|
{
|
|
87
90
|
pendingAuth: !0,
|
|
88
|
-
onConsentConfirmed:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
onConsentConfirmed: L,
|
|
92
|
+
showCloseButton: o.auth?.allowCloseOnboardingBeforeLogin === !0,
|
|
93
|
+
onClose: () => m(!1),
|
|
94
|
+
showTerms: o.auth?.hideCgu !== !0,
|
|
95
|
+
showEmailConsent: o.auth?.showEmailConsent,
|
|
96
|
+
initialFirstName: i.first_name,
|
|
97
|
+
initialLastName: i.last_name,
|
|
98
|
+
initialImageUrl: i.image_url,
|
|
99
|
+
termsUrl: o.provider?.cguUrl || "https://www.logora.com/blog-posts/cgu",
|
|
100
|
+
privacyUrl: o.provider?.privacyUrl || "https://www.logora.com/blog-posts/privacy-policy"
|
|
96
101
|
}
|
|
97
102
|
) });
|
|
98
103
|
};
|
|
99
104
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
ee as AuthInitializer,
|
|
106
|
+
x as decodeJwtPayload
|
|
102
107
|
};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import r from "classnames";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useIntl as
|
|
3
|
+
import { useRef as b, useEffect as C } from "react";
|
|
4
|
+
import { useIntl as M } from "react-intl";
|
|
5
5
|
import e from "./Modal.module.scss.js";
|
|
6
|
-
import { useModal as
|
|
7
|
-
import { Icon as
|
|
8
|
-
const
|
|
6
|
+
import { useModal as x } from "./useModal.js";
|
|
7
|
+
import { Icon as E } from "../../icons/icon/Icon.js";
|
|
8
|
+
const I = ({
|
|
9
9
|
title: t,
|
|
10
|
-
showCloseButton:
|
|
11
|
-
fullScreen:
|
|
12
|
-
children:
|
|
13
|
-
disableClickOutside:
|
|
14
|
-
|
|
10
|
+
showCloseButton: c = !1,
|
|
11
|
+
fullScreen: m,
|
|
12
|
+
children: f,
|
|
13
|
+
disableClickOutside: u = !1,
|
|
14
|
+
onClose: a = null,
|
|
15
|
+
...h
|
|
15
16
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const o =
|
|
17
|
+
const n = b(), w = M(), { hideModal: v } = x();
|
|
18
|
+
C(() => {
|
|
19
|
+
const o = n.current;
|
|
19
20
|
if (!o) return;
|
|
20
|
-
const
|
|
21
|
-
return document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden", o.open || o.showModal(), o.focus(), window.scrollTo(0,
|
|
22
|
-
document.documentElement.style.overflow =
|
|
21
|
+
const s = window.scrollY, y = document.documentElement.style.overflow, g = document.body.style.overflow;
|
|
22
|
+
return document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden", o.open || o.showModal(), o.focus(), window.scrollTo(0, s), () => {
|
|
23
|
+
document.documentElement.style.overflow = y, document.body.style.overflow = g, o.open && o.close(), window.scrollTo(0, s);
|
|
23
24
|
};
|
|
24
25
|
}, []);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
26
|
+
const p = (o) => {
|
|
27
|
+
u || o.currentTarget === o.target && d();
|
|
28
|
+
}, d = () => {
|
|
29
|
+
a ? a() : v();
|
|
29
30
|
};
|
|
30
31
|
return /* @__PURE__ */ l(
|
|
31
32
|
"dialog",
|
|
32
33
|
{
|
|
33
|
-
ref:
|
|
34
|
+
ref: n,
|
|
34
35
|
className: r(e.modalDialog, {
|
|
35
|
-
[e.modalDialogFullScreen]:
|
|
36
|
+
[e.modalDialogFullScreen]: m
|
|
36
37
|
}),
|
|
37
38
|
"aria-labelledby": t ? "modal-title" : void 0,
|
|
38
|
-
onClick:
|
|
39
|
-
onClose:
|
|
40
|
-
...
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
39
|
+
onClick: p,
|
|
40
|
+
onClose: d,
|
|
41
|
+
...h,
|
|
42
|
+
children: /* @__PURE__ */ i("div", { className: r(e.modalContainer), children: [
|
|
43
|
+
/* @__PURE__ */ i(
|
|
43
44
|
"div",
|
|
44
45
|
{
|
|
45
46
|
className: r(e.modalHeader, {
|
|
@@ -47,19 +48,19 @@ const D = ({
|
|
|
47
48
|
}),
|
|
48
49
|
children: [
|
|
49
50
|
t && /* @__PURE__ */ l("div", { id: "modal-title", children: t }),
|
|
50
|
-
|
|
51
|
+
c && /* @__PURE__ */ l(
|
|
51
52
|
"button",
|
|
52
53
|
{
|
|
53
54
|
type: "button",
|
|
54
55
|
className: e.modalExitButton,
|
|
55
56
|
onClick: d,
|
|
56
|
-
"aria-label":
|
|
57
|
+
"aria-label": w.formatMessage({
|
|
57
58
|
id: "dialog.modal.aria_label",
|
|
58
59
|
defaultMessage: "Close dialog"
|
|
59
60
|
}),
|
|
60
61
|
"data-testid": "close-button",
|
|
61
62
|
children: /* @__PURE__ */ l(
|
|
62
|
-
|
|
63
|
+
E,
|
|
63
64
|
{
|
|
64
65
|
name: "close",
|
|
65
66
|
height: 18,
|
|
@@ -73,11 +74,11 @@ const D = ({
|
|
|
73
74
|
]
|
|
74
75
|
}
|
|
75
76
|
),
|
|
76
|
-
/* @__PURE__ */ l("div", { className: e.modalContent, children:
|
|
77
|
+
/* @__PURE__ */ l("div", { className: e.modalContent, children: f })
|
|
77
78
|
] })
|
|
78
79
|
}
|
|
79
80
|
);
|
|
80
81
|
};
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
+
I as Modal
|
|
83
84
|
};
|
|
@@ -1,72 +1,74 @@
|
|
|
1
1
|
import { jsx as a, jsxs as d, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useState as l } from "react";
|
|
3
|
-
import { useIntl as
|
|
3
|
+
import { useIntl as le, FormattedMessage as oe } from "react-intl";
|
|
4
4
|
import s from "./OnboardingModal.module.scss.js";
|
|
5
|
-
import { useAuth as
|
|
6
|
-
import { useDataProvider as
|
|
7
|
-
import { useConfig as
|
|
8
|
-
import { useResponsive as
|
|
9
|
-
import { useFormValidation as
|
|
10
|
-
import { useModal as
|
|
11
|
-
import { Modal as
|
|
12
|
-
import { Loader as
|
|
13
|
-
import { AvatarSelector as
|
|
14
|
-
import { Icon as
|
|
5
|
+
import { useAuth as ne } from "../../auth/use_auth/useAuth.js";
|
|
6
|
+
import { useDataProvider as de } from "../../data/data_provider/useDataProvider.js";
|
|
7
|
+
import { useConfig as ce } from "../../data/config_provider/useConfig.js";
|
|
8
|
+
import { useResponsive as me } from "../../hooks/use_responsive/useResponsive.js";
|
|
9
|
+
import { useFormValidation as ue } from "../../forms/use_form_validation/useFormValidation.js";
|
|
10
|
+
import { useModal as fe } from "../../dialog/modal/useModal.js";
|
|
11
|
+
import { Modal as pe } from "../../dialog/modal/Modal.js";
|
|
12
|
+
import { Loader as ge } from "../../progress/loader/Loader.js";
|
|
13
|
+
import { AvatarSelector as _e } from "../avatar_selector/AvatarSelector.js";
|
|
14
|
+
import { Icon as he } from "../../icons/icon/Icon.js";
|
|
15
15
|
import { Button as F } from "../../action/button/Button.js";
|
|
16
|
-
import { TextInput as
|
|
17
|
-
import { Select as
|
|
18
|
-
import { Toggle as
|
|
19
|
-
const
|
|
20
|
-
termsUrl:
|
|
21
|
-
privacyUrl:
|
|
16
|
+
import { TextInput as D } from "../../input/text_input/TextInput.js";
|
|
17
|
+
import { Select as ve } from "../../input/select/Select.js";
|
|
18
|
+
import { Toggle as L } from "../../input/toggle/Toggle.js";
|
|
19
|
+
const je = ({
|
|
20
|
+
termsUrl: A,
|
|
21
|
+
privacyUrl: B,
|
|
22
22
|
showEmailConsent: y = !1,
|
|
23
23
|
showTerms: g = !1,
|
|
24
24
|
pendingAuth: n = !1,
|
|
25
|
-
onConsentConfirmed:
|
|
25
|
+
onConsentConfirmed: x = null,
|
|
26
26
|
initialFirstName: j = "",
|
|
27
27
|
initialLastName: $ = "",
|
|
28
|
-
initialImageUrl:
|
|
28
|
+
initialImageUrl: C = null,
|
|
29
|
+
showCloseButton: R = !1,
|
|
30
|
+
onClose: q = null
|
|
29
31
|
}) => {
|
|
30
|
-
const o =
|
|
32
|
+
const o = ne(), E = de(), r = le(), i = ce(), z = [...Array(i.avatars?.maxFileName || 0).keys()].map(
|
|
31
33
|
(e) => `${i.avatars?.baseUrl}/${e + 1}.${i.avatars?.fileExtension}`
|
|
32
|
-
), [m,
|
|
34
|
+
), [m, T] = l(
|
|
33
35
|
j || o.currentUser.first_name || ""
|
|
34
|
-
), [_,
|
|
36
|
+
), [_, V] = l(
|
|
35
37
|
o.currentUser.description || ""
|
|
36
|
-
), [u,
|
|
38
|
+
), [u, W] = l(
|
|
37
39
|
$ || o.currentUser.last_name || ""
|
|
38
|
-
), [h,
|
|
39
|
-
|
|
40
|
-
), [f,
|
|
40
|
+
), [h, G] = l(o.currentUser.language), [H, v] = l(!1), [b, k] = l(
|
|
41
|
+
C || o.currentUser.image_url
|
|
42
|
+
), [f, J] = l(C || null), K = [m, u].filter(Boolean).join(" ") || o.currentUser?.full_name, [P, w] = l(!1), [Q, X] = l(!1), { isMobile: I } = me(), { errors: c, validate: Y } = ue(), { hideModal: O } = fe(), [M, Z] = l(!1), [N, ee] = l(!1), ae = (e) => {
|
|
41
43
|
const t = new FileReader();
|
|
42
44
|
t.onloadend = () => {
|
|
43
45
|
k(t.result);
|
|
44
46
|
}, t.readAsDataURL(e);
|
|
45
|
-
},
|
|
47
|
+
}, te = [
|
|
46
48
|
{ first_name: ["required", null] },
|
|
47
49
|
{ first_name: ["minChar", 2] },
|
|
48
50
|
{ last_name: ["required", null] },
|
|
49
51
|
{ last_name: ["minChar", 2] },
|
|
50
52
|
...n ? [] : [{ language: ["required", null] }],
|
|
51
53
|
...g ? [{ accepts_terms: ["enforceValue", !0] }] : []
|
|
52
|
-
],
|
|
54
|
+
], se = (e) => {
|
|
53
55
|
e.preventDefault();
|
|
54
56
|
const t = {};
|
|
55
|
-
if (m && (t.first_name = m), u && (t.last_name = u), h && (t.language = h), f && P && (t.image = n ? b : f), f && !P && (t.origin_image_url = f), _ && (t.description = _), y && (t.accepts_provider_email = N), g && (t.accepts_terms = M), t.is_onboarded = !0,
|
|
56
|
-
|
|
57
|
+
if (m && (t.first_name = m), u && (t.last_name = u), h && (t.language = h), f && P && (t.image = n ? b : f), f && !P && (t.origin_image_url = f), _ && (t.description = _), y && (t.accepts_provider_email = N), g && (t.accepts_terms = M), t.is_onboarded = !0, Y(t, te)) {
|
|
58
|
+
X(!0);
|
|
57
59
|
const U = new FormData();
|
|
58
|
-
Object.entries(t).forEach(([p,
|
|
59
|
-
U.append(p,
|
|
60
|
-
}), n &&
|
|
60
|
+
Object.entries(t).forEach(([p, ie]) => {
|
|
61
|
+
U.append(p, ie);
|
|
62
|
+
}), n && x ? x(U, t) : E.update("users", o.currentUser.slug, U).then((p) => {
|
|
61
63
|
p.data.success && o.setCurrentUser(p.data.data.resource), O();
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
|
-
},
|
|
66
|
+
}, re = (e) => {
|
|
65
67
|
const t = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i;
|
|
66
|
-
|
|
68
|
+
J(e), v(!1), t.test(e) ? (k(e), w(!1)) : (w(!0), ae(e));
|
|
67
69
|
};
|
|
68
70
|
return /* @__PURE__ */ a(
|
|
69
|
-
|
|
71
|
+
pe,
|
|
70
72
|
{
|
|
71
73
|
"data-vid": "update_user_info_modal",
|
|
72
74
|
title: n ? r.formatMessage({
|
|
@@ -81,15 +83,16 @@ const Le = ({
|
|
|
81
83
|
minWidth: I ? "unset" : "500px",
|
|
82
84
|
maxWidth: "800px"
|
|
83
85
|
},
|
|
84
|
-
showCloseButton:
|
|
86
|
+
showCloseButton: R,
|
|
87
|
+
onClose: q,
|
|
85
88
|
disableClickOutside: !0,
|
|
86
|
-
children:
|
|
89
|
+
children: Q ? /* @__PURE__ */ a(ge, {}) : H ? /* @__PURE__ */ d(S, { children: [
|
|
87
90
|
/* @__PURE__ */ a(
|
|
88
|
-
|
|
91
|
+
_e,
|
|
89
92
|
{
|
|
90
|
-
onChooseAvatar:
|
|
91
|
-
avatarUrlList:
|
|
92
|
-
userName:
|
|
93
|
+
onChooseAvatar: re,
|
|
94
|
+
avatarUrlList: z,
|
|
95
|
+
userName: K,
|
|
93
96
|
allowUserImage: i.avatars?.allowUserImage
|
|
94
97
|
}
|
|
95
98
|
),
|
|
@@ -118,7 +121,7 @@ const Le = ({
|
|
|
118
121
|
})
|
|
119
122
|
}
|
|
120
123
|
) : /* @__PURE__ */ a("div", { className: s.userPictureUpload, children: /* @__PURE__ */ a(
|
|
121
|
-
|
|
124
|
+
he,
|
|
122
125
|
{
|
|
123
126
|
name: "camera",
|
|
124
127
|
height: 20,
|
|
@@ -146,7 +149,7 @@ const Le = ({
|
|
|
146
149
|
/* @__PURE__ */ d("div", { className: s.inputsContainer, children: [
|
|
147
150
|
/* @__PURE__ */ d("div", { className: s.nameContainer, children: [
|
|
148
151
|
/* @__PURE__ */ a("div", { className: s.updateProfileInput, children: /* @__PURE__ */ a(
|
|
149
|
-
|
|
152
|
+
D,
|
|
150
153
|
{
|
|
151
154
|
type: "text",
|
|
152
155
|
name: "first_name",
|
|
@@ -158,7 +161,7 @@ const Le = ({
|
|
|
158
161
|
id: "auth_signup_form_first_name_placeholder",
|
|
159
162
|
defaultMessage: "First name"
|
|
160
163
|
}),
|
|
161
|
-
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null :
|
|
164
|
+
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null : T(e.target.value),
|
|
162
165
|
value: m,
|
|
163
166
|
error: !!c.first_name,
|
|
164
167
|
message: c.first_name,
|
|
@@ -167,7 +170,7 @@ const Le = ({
|
|
|
167
170
|
}
|
|
168
171
|
) }),
|
|
169
172
|
/* @__PURE__ */ a("div", { className: s.updateProfileInput, children: /* @__PURE__ */ a(
|
|
170
|
-
|
|
173
|
+
D,
|
|
171
174
|
{
|
|
172
175
|
type: "text",
|
|
173
176
|
name: "last_name",
|
|
@@ -179,7 +182,7 @@ const Le = ({
|
|
|
179
182
|
id: "auth_signup_form_last_name_placeholder",
|
|
180
183
|
defaultMessage: "Last name"
|
|
181
184
|
}),
|
|
182
|
-
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null :
|
|
185
|
+
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null : W(e.target.value),
|
|
183
186
|
value: u,
|
|
184
187
|
error: !!c.last_name,
|
|
185
188
|
message: c.last_name,
|
|
@@ -193,7 +196,7 @@ const Le = ({
|
|
|
193
196
|
defaultMessage: "last name"
|
|
194
197
|
}) }),
|
|
195
198
|
!n && i.translation?.translationMethods && Object.keys(i.translation.translationMethods).length > 0 && /* @__PURE__ */ a(
|
|
196
|
-
|
|
199
|
+
ve,
|
|
197
200
|
{
|
|
198
201
|
selectClassName: s.langSelect,
|
|
199
202
|
options: Object.keys(
|
|
@@ -204,7 +207,7 @@ const Le = ({
|
|
|
204
207
|
text: `${e.toUpperCase()}`
|
|
205
208
|
})),
|
|
206
209
|
defaultOption: h,
|
|
207
|
-
onChange: (e) =>
|
|
210
|
+
onChange: (e) => G(e.value)
|
|
208
211
|
}
|
|
209
212
|
),
|
|
210
213
|
!n && /* @__PURE__ */ a("div", { className: s.userDescription, children: /* @__PURE__ */ a(
|
|
@@ -216,7 +219,7 @@ const Le = ({
|
|
|
216
219
|
defaultMessage: "Describe yourself in a few words"
|
|
217
220
|
}),
|
|
218
221
|
value: _,
|
|
219
|
-
onChange: (e) =>
|
|
222
|
+
onChange: (e) => V(e.target.value),
|
|
220
223
|
maxLength: 500,
|
|
221
224
|
"data-testid": "description"
|
|
222
225
|
}
|
|
@@ -224,14 +227,14 @@ const Le = ({
|
|
|
224
227
|
] })
|
|
225
228
|
] }),
|
|
226
229
|
g && /* @__PURE__ */ a("div", { className: s.toggle, children: /* @__PURE__ */ a(
|
|
227
|
-
|
|
230
|
+
L,
|
|
228
231
|
{
|
|
229
232
|
type: "checkbox",
|
|
230
233
|
name: "accepts_terms",
|
|
231
234
|
style: { fontSize: 18 },
|
|
232
235
|
checked: M,
|
|
233
236
|
label: /* @__PURE__ */ a(
|
|
234
|
-
|
|
237
|
+
oe,
|
|
235
238
|
{
|
|
236
239
|
id: "modal.update_user_info_modal.accepts_terms",
|
|
237
240
|
defaultMessage: "I declare I have read the <var1>General Conditions of Use</var1> and the <var2>Privacy policy</var2> of the debate space and accept them.",
|
|
@@ -241,7 +244,7 @@ const Le = ({
|
|
|
241
244
|
{
|
|
242
245
|
className: s.cgu,
|
|
243
246
|
target: "_blank",
|
|
244
|
-
href:
|
|
247
|
+
href: A,
|
|
245
248
|
rel: "noreferrer",
|
|
246
249
|
children: e
|
|
247
250
|
}
|
|
@@ -251,7 +254,7 @@ const Le = ({
|
|
|
251
254
|
{
|
|
252
255
|
className: s.cgu,
|
|
253
256
|
target: "_blank",
|
|
254
|
-
href:
|
|
257
|
+
href: B,
|
|
255
258
|
rel: "noreferrer",
|
|
256
259
|
children: e
|
|
257
260
|
}
|
|
@@ -259,13 +262,13 @@ const Le = ({
|
|
|
259
262
|
}
|
|
260
263
|
}
|
|
261
264
|
),
|
|
262
|
-
onInputChanged: (e) =>
|
|
265
|
+
onInputChanged: (e) => Z(!M),
|
|
263
266
|
message: c.accepts_terms,
|
|
264
267
|
"data-testid": "accepts-terms-input"
|
|
265
268
|
}
|
|
266
269
|
) }),
|
|
267
270
|
y && /* @__PURE__ */ a("div", { className: s.toggle, children: /* @__PURE__ */ a(
|
|
268
|
-
|
|
271
|
+
L,
|
|
269
272
|
{
|
|
270
273
|
type: "checkbox",
|
|
271
274
|
name: "accepts_provider_email",
|
|
@@ -278,7 +281,7 @@ const Le = ({
|
|
|
278
281
|
},
|
|
279
282
|
{ provider: i.provider?.companyName }
|
|
280
283
|
),
|
|
281
|
-
onInputChanged: (e) =>
|
|
284
|
+
onInputChanged: (e) => ee(!N),
|
|
282
285
|
"data-testid": "accepts-email-input"
|
|
283
286
|
}
|
|
284
287
|
) }),
|
|
@@ -287,7 +290,7 @@ const Le = ({
|
|
|
287
290
|
{
|
|
288
291
|
"data-testid": "save-button",
|
|
289
292
|
"data-tid": "action_save_profile",
|
|
290
|
-
onClick: (e) =>
|
|
293
|
+
onClick: (e) => se(e),
|
|
291
294
|
children: r.formatMessage({
|
|
292
295
|
id: "user.user_edit.save",
|
|
293
296
|
defaultMessage: "Save"
|
|
@@ -299,5 +302,5 @@ const Le = ({
|
|
|
299
302
|
);
|
|
300
303
|
};
|
|
301
304
|
export {
|
|
302
|
-
|
|
305
|
+
je as OnboardingModal
|
|
303
306
|
};
|