@logora/debate 0.4.40 → 0.4.42
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/dist/assets/components/action/back_link/BackLink.module-nMAM5nvb.css +1 -0
- package/dist/assets/components/action/button/Button.module-BXkLuURK.css +1 -0
- package/dist/assets/components/action/icon_text_link/IconTextLink.module-B5PF-MMK.css +1 -0
- package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +1 -0
- package/dist/assets/components/argument/argument/ReplyFooter.module-x9Xlkt3Z.css +1 -0
- package/dist/assets/components/auth/sso_form/SSOForm.module-D5v2TrOv.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +1 -0
- package/dist/assets/components/debate/debate_box/DebateBox.module-DTLafpl4.css +1 -0
- package/dist/assets/components/dialog/dialog_box/DialogBox.module-DKztqqmb.css +1 -0
- package/dist/assets/components/dialog/dropdown/Dropdown.module-FG2Sqrqs.css +1 -0
- package/dist/assets/components/dialog/modal/Modal.module-CIj-xCzY.css +1 -0
- package/dist/assets/components/dialog/toast/Toast.module-DJ2wSlJT.css +1 -0
- package/dist/assets/components/dialog/tooltip/Tooltip.module-zMXumgnX.css +1 -0
- package/dist/assets/components/embed/embed_header/EmbedHeader.module-CoyRY_jw.css +1 -0
- package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +1 -0
- package/dist/assets/components/gamification/badge_box/BadgeBox.module-BnskGH9b.css +1 -0
- package/dist/assets/components/gamification/point_box/{PointBox.module-Dj6cCgSB.css → PointBox.module-BlHdQyht.css} +1 -1
- package/dist/assets/components/information/information_box/InformationBox.module-B_MiEPn7.css +1 -0
- package/dist/assets/components/input/text_editor/TextEditor.module-CxuSL3l3.css +1 -0
- package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-CbPmMciY.css +1 -0
- package/dist/assets/components/input/toggle_position/TogglePosition.module-DDIigbfA.css +1 -0
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +1 -0
- package/dist/assets/components/navigation/tabs/Tabs.module-CtDi0tAd.css +1 -0
- package/dist/assets/components/notification/notification_item/NotificationItem.module-BWdhgSy4.css +1 -0
- package/dist/assets/components/notification/notification_menu/NotificationMenu.module-BQwbvRIV.css +1 -0
- package/dist/assets/components/progress/progress_bar/ProgressBar.module-Dy-27Wf9.css +1 -0
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +1 -0
- package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
- package/dist/assets/components/share/share_button/{ShareButton.module-BnVEYTzr.css → ShareButton.module-BS6STEUD.css} +1 -1
- package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-DhZm1xTr.css +1 -0
- package/dist/assets/components/source/context_source_box/ContextSourceBox.module-78Gxjx0w.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
- package/dist/assets/components/source/source_box/SourceBox.module-Cu_m3E85.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
- package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-D37NVZLS.css +1 -0
- package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-DHxoF0oe.css +1 -0
- package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-BsEj7sF3.css +1 -0
- package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-DLcsyMSD.css +1 -0
- package/dist/assets/components/summary/keyword_box/KeywordBox.module-DHkYfW0l.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
- package/dist/assets/components/text/read_more/ReadMore.module-Ni_Mm8o8.css +1 -0
- package/dist/assets/components/user/author_box/AuthorBox.module-CbH2S-MT.css +1 -0
- package/dist/assets/components/user/update_user_info_modal/UpdateUserInfoModal.module-DJym6u4r.css +1 -0
- package/dist/assets/components/user/user_box/UserBox.module-DGKK1afI.css +1 -0
- package/dist/assets/components/user/user_box_small/UserBoxSmall.module-ibAw9gGE.css +1 -0
- package/dist/assets/components/user_content/content_footer/ContentFooter.module-ax3j7VNT.css +1 -0
- package/dist/assets/components/user_content/content_header/ContentHeader.module-B0VwpU-R.css +1 -0
- package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-DdzWnPjq.css +1 -0
- package/dist/assets/components/user_content/use_report_content/ReportModal.module-BxF-D5C5.css +1 -0
- package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CZeQKWIw.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +1 -0
- package/dist/assets/components/vote/vote_button/VoteButton.module-aP9ZrGSd.css +1 -0
- package/dist/components/action/back_link/BackLink.module.scss.js +1 -1
- package/dist/components/action/button/Button.module.scss.js +9 -9
- package/dist/components/action/icon_text_link/IconTextLink.module.scss.js +2 -2
- package/dist/components/argument/argument/Argument.js +112 -120
- package/dist/components/argument/argument/Argument.module.scss.js +40 -40
- package/dist/components/argument/argument/ReplyFooter.module.scss.js +8 -8
- package/dist/components/auth/auth_initializer/AuthInitializer.js +41 -59
- package/dist/components/auth/auth_modal/AuthModal.js +5 -6
- package/dist/components/auth/providers/FormAuth.js +3 -6
- package/dist/components/auth/providers/PasswordAuth.js +6 -6
- package/dist/components/auth/sso_form/SSOForm.js +88 -91
- package/dist/components/auth/sso_form/SSOForm.module.scss.js +20 -20
- package/dist/components/auth/use_auth/useAuthActions.js +24 -24
- package/dist/components/consultation/consultation_box/ConsultationBox.js +3 -4
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +25 -25
- package/dist/components/debate/debate_box/DebateBox.module.scss.js +20 -20
- package/dist/components/dialog/dialog_box/DialogBox.module.scss.js +14 -14
- package/dist/components/dialog/dropdown/Dropdown.js +17 -19
- package/dist/components/dialog/dropdown/Dropdown.module.scss.js +13 -17
- package/dist/components/dialog/modal/Modal.module.scss.js +9 -9
- package/dist/components/dialog/toast/Toast.module.scss.js +18 -18
- package/dist/components/dialog/tooltip/Tooltip.module.scss.js +8 -8
- package/dist/components/embed/embed_header/EmbedHeader.module.scss.js +18 -18
- package/dist/components/follow/follow_button/FollowButton.module.scss.js +1 -1
- package/dist/components/forms/use_form_validation/useFormValidation.js +1 -1
- package/dist/components/gamification/badge_box/BadgeBox.module.scss.js +18 -18
- package/dist/components/gamification/point_box/PointBox.module.scss.js +1 -1
- package/dist/components/information/information_box/InformationBox.module.scss.js +4 -4
- package/dist/components/input/argument_input/ArgumentInput.js +167 -172
- package/dist/components/input/text_editor/TextEditor.js +47 -49
- package/dist/components/input/text_editor/TextEditor.module.scss.js +28 -28
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +94 -143
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.module.scss.js +19 -19
- package/dist/components/input/toggle_position/TogglePosition.module.scss.js +4 -4
- package/dist/components/list/paginated_list/PaginatedList.js +124 -134
- package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +12 -12
- package/dist/components/navbar/navbar_modal/NavbarModal.js +14 -14
- package/dist/components/navigation/tabs/Tabs.js +24 -85
- package/dist/components/navigation/tabs/Tabs.module.scss.js +9 -19
- package/dist/components/notification/notification_item/NotificationItem.module.scss.js +5 -5
- package/dist/components/notification/notification_menu/NotificationMenu.module.scss.js +2 -2
- package/dist/components/progress/progress_bar/ProgressBar.module.scss.js +10 -10
- package/dist/components/proposal/proposal_box/ProposalBox.js +56 -58
- package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +1 -1
- package/dist/components/section/section_box/SectionBox.module.scss.js +12 -12
- package/dist/components/share/share_button/ShareButton.js +24 -26
- package/dist/components/share/share_button/ShareButton.module.scss.js +3 -5
- package/dist/components/skeleton/user_content_skeleton/UserContentSkeleton.module.scss.js +4 -4
- package/dist/components/source/context_source_box/ContextSourceBox.module.scss.js +4 -4
- package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +5 -5
- package/dist/components/source/source_box/SourceBox.module.scss.js +8 -8
- package/dist/components/source/source_list_item/SourceListItem.module.scss.js +5 -7
- package/dist/components/suggestion/suggestion_banner/SuggestionBanner.module.scss.js +5 -5
- package/dist/components/suggestion/suggestion_box/SuggestionBox.module.scss.js +1 -1
- package/dist/components/suggestion/suggestion_input/SuggestionInput.module.scss.js +9 -9
- package/dist/components/summary/argument_summary_box/ArgumentSummaryBox.module.scss.js +10 -10
- package/dist/components/summary/keyword_box/KeywordBox.module.scss.js +1 -1
- package/dist/components/summary/summary_box/SummaryBox.module.scss.js +8 -8
- package/dist/components/text/read_more/ReadMore.module.scss.js +4 -4
- package/dist/components/user/author_box/AuthorBox.js +17 -18
- package/dist/components/user/author_box/AuthorBox.module.scss.js +24 -24
- package/dist/components/user/{onboarding_modal/OnboardingModal.js → update_user_info_modal/UpdateUserInfoModal.js} +110 -115
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.module.scss.js +29 -0
- package/dist/components/user/update_user_info_modal/useUpdateUserInfo.js +27 -0
- package/dist/components/user/user_box/UserBox.js +38 -48
- package/dist/components/user/user_box/UserBox.module.scss.js +9 -9
- package/dist/components/user/user_box_small/UserBoxSmall.js +18 -19
- package/dist/components/user/user_box_small/UserBoxSmall.module.scss.js +6 -6
- package/dist/components/user_content/content_footer/ContentFooter.js +92 -95
- package/dist/components/user_content/content_footer/ContentFooter.module.scss.js +11 -11
- package/dist/components/user_content/content_header/ContentHeader.module.scss.js +22 -22
- package/dist/components/user_content/summary_content_box/SummaryContentBox.module.scss.js +1 -1
- package/dist/components/user_content/use_report_content/ReportModal.module.scss.js +8 -8
- package/dist/components/vote/suggestion_vote_box/SuggestionVoteBox.module.scss.js +1 -1
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +42 -42
- package/dist/components/vote/vote_button/VoteButton.module.scss.js +5 -5
- package/dist/index.js +320 -324
- package/package.json +1 -1
- package/dist/assets/components/action/back_link/BackLink.module-B9Ok2t4H.css +0 -1
- package/dist/assets/components/action/button/Button.module-D7nbgOES.css +0 -1
- package/dist/assets/components/action/icon_text_link/IconTextLink.module-CZKufK9Y.css +0 -1
- package/dist/assets/components/argument/argument/Argument.module-CC40BY1L.css +0 -1
- package/dist/assets/components/argument/argument/ReplyFooter.module-CoC9dY8T.css +0 -1
- package/dist/assets/components/auth/sso_form/SSOForm.module-DOw9cmCF.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-97r47y_e.css +0 -1
- package/dist/assets/components/debate/debate_box/DebateBox.module-emnqIGNF.css +0 -1
- package/dist/assets/components/dialog/dialog_box/DialogBox.module-ZoM8d2Ly.css +0 -1
- package/dist/assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css +0 -1
- package/dist/assets/components/dialog/modal/Modal.module-Dt4SWx6U.css +0 -1
- package/dist/assets/components/dialog/toast/Toast.module-CW6j5xe7.css +0 -1
- package/dist/assets/components/dialog/tooltip/Tooltip.module-bQbmPiMf.css +0 -1
- package/dist/assets/components/embed/embed_header/EmbedHeader.module-C8RPiVBp.css +0 -1
- package/dist/assets/components/follow/follow_button/FollowButton.module-BjwLVTeb.css +0 -1
- package/dist/assets/components/gamification/badge_box/BadgeBox.module-DWqqtICw.css +0 -1
- package/dist/assets/components/information/information_box/InformationBox.module-DJLT957y.css +0 -1
- package/dist/assets/components/input/text_editor/TextEditor.module-KPtqT1Y6.css +0 -1
- package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css +0 -1
- package/dist/assets/components/input/toggle_position/TogglePosition.module-H4gGmJ0V.css +0 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-BDMBrj2Y.css +0 -1
- package/dist/assets/components/navigation/tabs/Tabs.module-50P6bk0B.css +0 -1
- package/dist/assets/components/notification/notification_item/NotificationItem.module-BQcDopYB.css +0 -1
- package/dist/assets/components/notification/notification_menu/NotificationMenu.module-DrCrfzVk.css +0 -1
- package/dist/assets/components/progress/progress_bar/ProgressBar.module-DoCH9Qoo.css +0 -1
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-D1ccjSLm.css +0 -1
- package/dist/assets/components/section/section_box/SectionBox.module-DF7k7Vxq.css +0 -1
- package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-d4r3QpYe.css +0 -1
- package/dist/assets/components/source/context_source_box/ContextSourceBox.module-doiSb_NR.css +0 -1
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-Df4z4DN-.css +0 -1
- package/dist/assets/components/source/source_box/SourceBox.module-CQOBgJ5n.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-C5YDjksb.css +0 -1
- package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-P95xqaUA.css +0 -1
- package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-CE_Wvk-K.css +0 -1
- package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-r5N57bDp.css +0 -1
- package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-EDxcqwRa.css +0 -1
- package/dist/assets/components/summary/keyword_box/KeywordBox.module-yNHAvcRh.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Bu-AnMIG.css +0 -1
- package/dist/assets/components/text/read_more/ReadMore.module-Bs-YaspR.css +0 -1
- package/dist/assets/components/user/author_box/AuthorBox.module-B8Sl2v33.css +0 -1
- package/dist/assets/components/user/onboarding_modal/OnboardingModal.module-CTpt3xSh.css +0 -1
- package/dist/assets/components/user/user_box/UserBox.module-DMFhZDAH.css +0 -1
- package/dist/assets/components/user/user_box_small/UserBoxSmall.module-D4Ut5xmS.css +0 -1
- package/dist/assets/components/user_content/content_footer/ContentFooter.module-9A9E8k5l.css +0 -1
- package/dist/assets/components/user_content/content_header/ContentHeader.module-CXO2IRui.css +0 -1
- package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-CBlL2Xii.css +0 -1
- package/dist/assets/components/user_content/use_report_content/ReportModal.module-mjFuOdmL.css +0 -1
- package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CKFriPV5.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-Bv7WY_vr.css +0 -1
- package/dist/assets/components/vote/vote_button/VoteButton.module-DqD79xv_.css +0 -1
- package/dist/components/auth/use_auth/base64.js +0 -4
- package/dist/components/icons/clarin_icons/Alarm.js +0 -6
- package/dist/components/icons/clarin_icons/Announcement.js +0 -6
- package/dist/components/icons/clarin_icons/Chat.js +0 -6
- package/dist/components/icons/clarin_icons/CheckCircle.js +0 -9
- package/dist/components/icons/clarin_icons/Clock.js +0 -6
- package/dist/components/icons/clarin_icons/Follow.js +0 -6
- package/dist/components/icons/clarin_icons/MobileClose.js +0 -9
- package/dist/components/icons/clarin_icons/Question.js +0 -6
- package/dist/components/icons/clarin_icons/Search.js +0 -6
- package/dist/components/icons/clarin_icons/Send.js +0 -6
- package/dist/components/icons/clarin_icons/Share.js +0 -6
- package/dist/components/icons/clarin_icons/Upvote.js +0 -9
- package/dist/components/icons/clarin_icons/User.js +0 -9
- package/dist/components/icons/clarin_icons/index.js +0 -106
- package/dist/components/input/text_editor/plugins/IOSInsertParagraphFallbackPlugin.js +0 -34
- package/dist/components/user/onboarding_modal/OnboardingModal.module.scss.js +0 -29
- package/dist/components/user/onboarding_modal/useOnboarding.js +0 -27
|
@@ -1,70 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { httpClient as u } from "../../data/axios_client/httpClient.js";
|
|
13
|
-
const X = ({ authUrl: n, authType: i, provider: p, assertion: w }) => {
|
|
14
|
-
const s = "logora_user_token", e = L(), v = O();
|
|
15
|
-
q(u, n, s);
|
|
16
|
-
const [A, c] = I(!1), { getToken: C, removeToken: P } = S(
|
|
17
|
-
u,
|
|
1
|
+
import { useEffect as u } from "react";
|
|
2
|
+
import { useAuthInterceptor as v } from "../use_auth/useAuthInterceptor.js";
|
|
3
|
+
import { authTokenHandler as w } from "../use_auth/authTokenHandler.js";
|
|
4
|
+
import { useAuthActions as q } from "../use_auth/useAuthActions.js";
|
|
5
|
+
import { useAuthRequired as I } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
6
|
+
import { AuthProviderFactory as P } from "../providers/AuthProviderFactory.js";
|
|
7
|
+
import { httpClient as n } from "../../data/axios_client/httpClient.js";
|
|
8
|
+
const U = ({ authUrl: o, authType: c, provider: a, assertion: m }) => {
|
|
9
|
+
const r = "logora_user_token";
|
|
10
|
+
v(n, o, r);
|
|
11
|
+
const { getToken: f, removeToken: h } = w(
|
|
18
12
|
n,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
o,
|
|
14
|
+
r
|
|
15
|
+
), { loginUser: d, logoutUser: l, fetchUser: A } = q(
|
|
22
16
|
n,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
o,
|
|
18
|
+
r
|
|
19
|
+
), i = I();
|
|
20
|
+
u(() => {
|
|
21
|
+
p();
|
|
22
|
+
}, []), u(() => {
|
|
28
23
|
if (typeof window < "u")
|
|
29
|
-
return window.addEventListener(
|
|
30
|
-
|
|
24
|
+
return window.addEventListener(
|
|
25
|
+
"logora:authentication:require",
|
|
26
|
+
i
|
|
27
|
+
), () => {
|
|
28
|
+
window.removeEventListener(
|
|
29
|
+
"logora:authentication:require",
|
|
30
|
+
i
|
|
31
|
+
);
|
|
31
32
|
};
|
|
32
33
|
}, []);
|
|
33
|
-
const
|
|
34
|
-
const
|
|
34
|
+
const p = () => {
|
|
35
|
+
const e = g(), t = f();
|
|
35
36
|
if (t) {
|
|
36
|
-
const
|
|
37
|
-
|
|
37
|
+
const k = t.session_id;
|
|
38
|
+
e.isSameUser(k) ? A() : (h(), s(e));
|
|
38
39
|
} else
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
if (
|
|
42
|
-
const t =
|
|
43
|
-
|
|
44
|
-
if (i !== "social" && i !== "oauth2_server" && e.auth?.showOnboardingBeforeLogin === !0) {
|
|
45
|
-
c(!0);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
m(t);
|
|
49
|
-
}
|
|
40
|
+
s(e);
|
|
41
|
+
}, s = (e) => {
|
|
42
|
+
if (e.shouldInitAuth()) {
|
|
43
|
+
const t = e.getAuthorizationParams();
|
|
44
|
+
t && d(t);
|
|
50
45
|
} else
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
await m(r), await v.update("users", E.slug, o), c(!1);
|
|
55
|
-
}, f = () => M.create(i, p, w);
|
|
56
|
-
return /* @__PURE__ */ l(y, { children: A && /* @__PURE__ */ l(
|
|
57
|
-
j,
|
|
58
|
-
{
|
|
59
|
-
pendingAuth: !0,
|
|
60
|
-
onConsentConfirmed: U,
|
|
61
|
-
showTerms: e.auth?.hideCgu !== !0,
|
|
62
|
-
showEmailConsent: e.auth?.showEmailConsent,
|
|
63
|
-
termsUrl: e.provider?.cguUrl || "https://www.logora.com/blog-posts/cgu",
|
|
64
|
-
privacyUrl: e.provider?.privacyUrl || "https://www.logora.com/blog-posts/privacy-policy"
|
|
65
|
-
}
|
|
66
|
-
) });
|
|
46
|
+
l();
|
|
47
|
+
}, g = () => P.create(c, a, m);
|
|
48
|
+
return null;
|
|
67
49
|
};
|
|
68
50
|
export {
|
|
69
|
-
|
|
51
|
+
U as AuthInitializer
|
|
70
52
|
};
|
|
@@ -5,15 +5,15 @@ import { useConfig as I } from "../../data/config_provider/useConfig.js";
|
|
|
5
5
|
import { useModal as y } from "../../dialog/modal/useModal.js";
|
|
6
6
|
import { useAuth as C } from "../use_auth/useAuth.js";
|
|
7
7
|
import { useAuthActions as E } from "../use_auth/useAuthActions.js";
|
|
8
|
-
import { httpClient as
|
|
9
|
-
import { Modal as
|
|
8
|
+
import { httpClient as P } from "../../data/axios_client/httpClient.js";
|
|
9
|
+
import { Modal as T } from "../../dialog/modal/Modal.js";
|
|
10
10
|
import { Loader as R } from "../../progress/loader/Loader.js";
|
|
11
11
|
import { SocialAuthForm as B } from "../social_auth_form/SocialAuthForm.js";
|
|
12
12
|
import { SSOForm as L } from "../sso_form/SSOForm.js";
|
|
13
13
|
import { AuthProviderFactory as M } from "../providers/AuthProviderFactory.js";
|
|
14
14
|
const $ = ({ onHideModal: s = null }) => {
|
|
15
15
|
const o = I(), { hideModal: c } = y(), { isLoggedIn: l, authError: r } = C(), [p, n] = h(!1), [e, d] = h(null), { loginUser: g } = E(
|
|
16
|
-
|
|
16
|
+
P,
|
|
17
17
|
process.env.API_AUTH_URL,
|
|
18
18
|
"logora_user_token"
|
|
19
19
|
);
|
|
@@ -35,7 +35,7 @@ const $ = ({ onHideModal: s = null }) => {
|
|
|
35
35
|
).getAuthorizationParams();
|
|
36
36
|
g(v);
|
|
37
37
|
};
|
|
38
|
-
return /* @__PURE__ */ t(
|
|
38
|
+
return /* @__PURE__ */ t(T, { "data-vid": "login_modal", children: /* @__PURE__ */ t("div", { className: w.loginModalBody, children: p ? /* @__PURE__ */ t(R, {}) : /* @__PURE__ */ t(_, { children: o.auth.type === "form" || o.auth.type === "social" ? /* @__PURE__ */ t(
|
|
39
39
|
B,
|
|
40
40
|
{
|
|
41
41
|
onSubmit: A,
|
|
@@ -69,8 +69,7 @@ const $ = ({ onHideModal: s = null }) => {
|
|
|
69
69
|
hideLoginButton: o.auth.hideModalLoginButton,
|
|
70
70
|
showEmailConsent: o.auth.showEmailConsent,
|
|
71
71
|
showTerms: o.auth.hideCgu !== !0,
|
|
72
|
-
hideBelowButton: o.auth.hideBelowButton
|
|
73
|
-
hideTerms: o.auth.hideTerms
|
|
72
|
+
hideBelowButton: o.auth.hideBelowButton
|
|
74
73
|
}
|
|
75
74
|
) }) }) });
|
|
76
75
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AuthProvider as s } from "./AuthProvider.js";
|
|
2
|
-
|
|
3
|
-
class u extends s {
|
|
2
|
+
class o extends s {
|
|
4
3
|
constructor(t, r) {
|
|
5
4
|
super(), this.providerName = t, this.userData = r;
|
|
6
5
|
}
|
|
@@ -12,10 +11,8 @@ class u extends s {
|
|
|
12
11
|
return !0;
|
|
13
12
|
}
|
|
14
13
|
getAssertion() {
|
|
15
|
-
if (!this.userData || typeof this.userData != "object")
|
|
16
|
-
return null;
|
|
17
14
|
const t = JSON.stringify(this.userData);
|
|
18
|
-
return
|
|
15
|
+
return btoa(t);
|
|
19
16
|
}
|
|
20
17
|
getAuthorizationParams() {
|
|
21
18
|
return {
|
|
@@ -28,5 +25,5 @@ class u extends s {
|
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
27
|
export {
|
|
31
|
-
|
|
28
|
+
o as FormAuth
|
|
32
29
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { AuthProvider as
|
|
2
|
-
class i extends
|
|
3
|
-
constructor(
|
|
4
|
-
super(), this.providerName =
|
|
1
|
+
import { AuthProvider as e } from "./AuthProvider.js";
|
|
2
|
+
class i extends e {
|
|
3
|
+
constructor(r, s) {
|
|
4
|
+
super(), this.providerName = r, this.userData = s;
|
|
5
5
|
}
|
|
6
6
|
shouldInitAuth() {
|
|
7
7
|
return !!this.userData;
|
|
8
8
|
}
|
|
9
9
|
getSessionId = () => null;
|
|
10
|
-
isSameUser(
|
|
10
|
+
isSameUser(r) {
|
|
11
11
|
return !0;
|
|
12
12
|
}
|
|
13
13
|
getAuthorizationParams() {
|
|
14
|
-
return
|
|
14
|
+
return {
|
|
15
15
|
grant_type: "password",
|
|
16
16
|
username: this.userData.email,
|
|
17
17
|
password: this.userData.password,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import G from "@rooks/use-sessionstorage-state";
|
|
3
|
+
import D from "classnames";
|
|
4
4
|
import "react";
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useLocation as
|
|
5
|
+
import { useIntl as Y, FormattedMessage as w } from "react-intl";
|
|
6
|
+
import { useLocation as z } from "react-router";
|
|
7
7
|
import a from "./SSOForm.module.scss.js";
|
|
8
|
-
import { EMAIL_CONSENT_STORAGE_KEY as
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Toggle as
|
|
12
|
-
const
|
|
8
|
+
import { EMAIL_CONSENT_STORAGE_KEY as H } from "../use_auth/useAuthActions.js";
|
|
9
|
+
import { Icon as K } from "../../icons/icon/Icon.js";
|
|
10
|
+
import { Button as V } from "../../action/button/Button.js";
|
|
11
|
+
import { Toggle as W } from "../../input/toggle/Toggle.js";
|
|
12
|
+
const oe = ({
|
|
13
13
|
authType: v,
|
|
14
|
-
providerName:
|
|
14
|
+
providerName: d,
|
|
15
15
|
loginUrl: M,
|
|
16
16
|
signupUrl: b,
|
|
17
17
|
termsUrl: N,
|
|
@@ -26,27 +26,26 @@ const ne = ({
|
|
|
26
26
|
showEmailConsent: g = !1,
|
|
27
27
|
showTerms: L = !1,
|
|
28
28
|
hideBelowButton: R = !1,
|
|
29
|
-
|
|
30
|
-
error: A = !1
|
|
29
|
+
error: x = !1
|
|
31
30
|
}) => {
|
|
32
|
-
const [h,
|
|
33
|
-
}],
|
|
31
|
+
const [h, A] = g ? G(H, !1) : [!1, () => {
|
|
32
|
+
}], o = Y(), c = z(), C = (t) => {
|
|
34
33
|
if (typeof window < "u") {
|
|
35
|
-
const s = t === "CURRENT_LOCATION" ? window.location : t, i = new URL(s, window.location.origin), l = i.searchParams,
|
|
34
|
+
const s = t === "CURRENT_LOCATION" ? window.location : t, i = new URL(s, window.location.origin), l = i.searchParams, E = new URLSearchParams(c.search);
|
|
36
35
|
l.has("code") && l.delete("code"), f && l.append(f, window.location.toString());
|
|
37
|
-
for (const [_,
|
|
38
|
-
let r =
|
|
36
|
+
for (const [_, F] of Object.entries(U)) {
|
|
37
|
+
let r = F;
|
|
39
38
|
if (r) {
|
|
40
|
-
const
|
|
39
|
+
const j = c.pathname.slice(
|
|
41
40
|
0,
|
|
42
|
-
|
|
41
|
+
c.pathname.lastIndexOf("/")
|
|
43
42
|
);
|
|
44
43
|
r = r.replace(
|
|
45
44
|
"{{UTM_CAMPAIGN}}",
|
|
46
|
-
|
|
45
|
+
E.get("utm_campaign")
|
|
47
46
|
), r = r.replace(
|
|
48
47
|
"{{CURRENT_PATH}}",
|
|
49
|
-
decodeURIComponent(
|
|
48
|
+
decodeURIComponent(j)
|
|
50
49
|
);
|
|
51
50
|
}
|
|
52
51
|
_ === "metadata" && r && (r = window.btoa(r)), l.append(_, encodeURIComponent(r));
|
|
@@ -54,15 +53,15 @@ const ne = ({
|
|
|
54
53
|
return i.search = l.toString(), i.toString();
|
|
55
54
|
}
|
|
56
55
|
return "";
|
|
57
|
-
},
|
|
56
|
+
}, T = (t) => {
|
|
58
57
|
const s = new URL(t);
|
|
59
58
|
if (s.searchParams.delete("code"), s.searchParams.append("client_id", S), s.searchParams.append("redirect_uri", y), s.searchParams.append("scope", I), s.searchParams.append("response_type", "code"), typeof window < "u") {
|
|
60
59
|
const i = new URL(window.location.href);
|
|
61
60
|
i.searchParams.delete("code"), s.searchParams.append("state", window.btoa(i.toString()));
|
|
62
61
|
}
|
|
63
62
|
return s.href;
|
|
64
|
-
}, p = (t) => v === "oauth2_server" ?
|
|
65
|
-
return /* @__PURE__ */
|
|
63
|
+
}, p = (t) => v === "oauth2_server" ? T(t) : C(t), O = p(M), B = p(b);
|
|
64
|
+
return /* @__PURE__ */ n("div", { className: a.ssoForm, children: [
|
|
66
65
|
/* @__PURE__ */ e("div", { className: a.logo, children: u ? /* @__PURE__ */ e(
|
|
67
66
|
"img",
|
|
68
67
|
{
|
|
@@ -70,10 +69,10 @@ const ne = ({
|
|
|
70
69
|
width: 100,
|
|
71
70
|
className: a.logoImage,
|
|
72
71
|
src: u,
|
|
73
|
-
alt: `Logo ${
|
|
72
|
+
alt: `Logo ${d}`
|
|
74
73
|
}
|
|
75
74
|
) : /* @__PURE__ */ e(
|
|
76
|
-
|
|
75
|
+
K,
|
|
77
76
|
{
|
|
78
77
|
name: "next",
|
|
79
78
|
"aria-hidden": "true",
|
|
@@ -82,41 +81,41 @@ const ne = ({
|
|
|
82
81
|
className: a.loginIcon
|
|
83
82
|
}
|
|
84
83
|
) }),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
84
|
+
/* @__PURE__ */ n("div", { className: a.mainText, children: [
|
|
85
|
+
/* @__PURE__ */ n("div", { className: a.title, children: [
|
|
86
|
+
o.formatMessage({
|
|
88
87
|
id: "auth.sso_form.title",
|
|
89
88
|
defaultMessage: "Debate now !"
|
|
90
89
|
}),
|
|
91
90
|
/* @__PURE__ */ e("br", {})
|
|
92
91
|
] }),
|
|
93
|
-
|
|
92
|
+
o.formatMessage(
|
|
94
93
|
{
|
|
95
94
|
id: "auth.sso_form.subtitle",
|
|
96
95
|
defaultMessage: "Sign up right now and receive alerts by email."
|
|
97
96
|
},
|
|
98
|
-
{ provider:
|
|
97
|
+
{ provider: d }
|
|
99
98
|
)
|
|
100
99
|
] }),
|
|
101
|
-
P ? null : /* @__PURE__ */
|
|
100
|
+
P ? null : /* @__PURE__ */ n(m, { children: [
|
|
102
101
|
/* @__PURE__ */ e(
|
|
103
|
-
|
|
102
|
+
V,
|
|
104
103
|
{
|
|
105
104
|
"data-tid": "link_signup",
|
|
106
105
|
"data-testid": "signup-button",
|
|
107
106
|
className: a.loginButton,
|
|
108
|
-
to:
|
|
107
|
+
to: B,
|
|
109
108
|
external: !0,
|
|
110
109
|
border: !1,
|
|
111
|
-
children:
|
|
110
|
+
children: o.formatMessage({
|
|
112
111
|
id: "auth.sso_form.signup",
|
|
113
112
|
defaultMessage: "Sign up"
|
|
114
113
|
})
|
|
115
114
|
}
|
|
116
115
|
),
|
|
117
|
-
R ? null : /* @__PURE__ */
|
|
118
|
-
k === !0 ? null : /* @__PURE__ */
|
|
119
|
-
|
|
116
|
+
R ? null : /* @__PURE__ */ n(m, { children: [
|
|
117
|
+
k === !0 ? null : /* @__PURE__ */ n("div", { className: a.cgu, children: [
|
|
118
|
+
o.formatMessage({
|
|
120
119
|
id: "auth.sso_form.already_account",
|
|
121
120
|
defaultMessage: "Already have an account ?"
|
|
122
121
|
}),
|
|
@@ -127,70 +126,68 @@ const ne = ({
|
|
|
127
126
|
"data-testid": "signin-link",
|
|
128
127
|
"data-tid": "link_login",
|
|
129
128
|
rel: "nofollow",
|
|
130
|
-
href:
|
|
131
|
-
children:
|
|
129
|
+
href: O,
|
|
130
|
+
children: o.formatMessage({
|
|
132
131
|
id: "auth.sso_form.signin",
|
|
133
132
|
defaultMessage: "Sign in"
|
|
134
133
|
})
|
|
135
134
|
}
|
|
136
135
|
)
|
|
137
136
|
] }),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
label: n.formatMessage(
|
|
147
|
-
{
|
|
148
|
-
id: "auth.sso_form.consent_label",
|
|
149
|
-
defaultMessage: "I agree to receive emails from the editor"
|
|
150
|
-
},
|
|
151
|
-
{ variable: c }
|
|
152
|
-
),
|
|
153
|
-
onInputChanged: (t) => C(!h),
|
|
154
|
-
"data-testid": "accepts-email-input"
|
|
155
|
-
}
|
|
156
|
-
) }) : null,
|
|
157
|
-
A ? /* @__PURE__ */ e("div", { className: a.error, children: n.formatMessage({
|
|
158
|
-
id: "auth.sso_form.error",
|
|
159
|
-
defaultMessage: "An error occurred during sign in. Please try again in a few moments."
|
|
160
|
-
}) }) : null,
|
|
161
|
-
L && /* @__PURE__ */ o(d, { children: [
|
|
162
|
-
/* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
|
|
163
|
-
w,
|
|
164
|
-
{
|
|
165
|
-
id: "auth.sso_form.terms",
|
|
166
|
-
defaultMessage: "By clicking on « Sign up », I declare that I have read the <var1> General Conditions of Use </var1> of the debate space and accept them",
|
|
167
|
-
values: {
|
|
168
|
-
var1: (t) => /* @__PURE__ */ e(
|
|
169
|
-
"a",
|
|
170
|
-
{
|
|
171
|
-
className: a.termsTarget,
|
|
172
|
-
target: "_blank",
|
|
173
|
-
href: N,
|
|
174
|
-
rel: "noreferrer",
|
|
175
|
-
children: t
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
) }),
|
|
181
|
-
/* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
|
|
182
|
-
w,
|
|
137
|
+
g ? /* @__PURE__ */ e("div", { className: D(a.switchBox), children: /* @__PURE__ */ e(
|
|
138
|
+
W,
|
|
139
|
+
{
|
|
140
|
+
type: "checkbox",
|
|
141
|
+
name: "accepts_provider_email",
|
|
142
|
+
style: { fontSize: 18 },
|
|
143
|
+
checked: h,
|
|
144
|
+
label: o.formatMessage(
|
|
183
145
|
{
|
|
184
|
-
id: "auth.sso_form.
|
|
185
|
-
defaultMessage: "
|
|
146
|
+
id: "auth.sso_form.consent_label",
|
|
147
|
+
defaultMessage: "I agree to receive emails from the editor"
|
|
148
|
+
},
|
|
149
|
+
{ variable: d }
|
|
150
|
+
),
|
|
151
|
+
onInputChanged: (t) => A(!h),
|
|
152
|
+
"data-testid": "accepts-email-input"
|
|
153
|
+
}
|
|
154
|
+
) }) : null,
|
|
155
|
+
x ? /* @__PURE__ */ e("div", { className: a.error, children: o.formatMessage({
|
|
156
|
+
id: "auth.sso_form.error",
|
|
157
|
+
defaultMessage: "An error occurred during sign in. Please try again in a few moments."
|
|
158
|
+
}) }) : null,
|
|
159
|
+
L && /* @__PURE__ */ n(m, { children: [
|
|
160
|
+
/* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
|
|
161
|
+
w,
|
|
162
|
+
{
|
|
163
|
+
id: "auth.sso_form.terms",
|
|
164
|
+
defaultMessage: "By clicking on « Sign up », I declare that I have read the <var1> General Conditions of Use </var1> of the debate space and accept them",
|
|
165
|
+
values: {
|
|
166
|
+
var1: (t) => /* @__PURE__ */ e(
|
|
167
|
+
"a",
|
|
168
|
+
{
|
|
169
|
+
className: a.termsTarget,
|
|
170
|
+
target: "_blank",
|
|
171
|
+
href: N,
|
|
172
|
+
rel: "noreferrer",
|
|
173
|
+
children: t
|
|
174
|
+
}
|
|
175
|
+
)
|
|
186
176
|
}
|
|
187
|
-
|
|
188
|
-
|
|
177
|
+
}
|
|
178
|
+
) }),
|
|
179
|
+
/* @__PURE__ */ e("div", { className: a.cguButton, children: /* @__PURE__ */ e(
|
|
180
|
+
w,
|
|
181
|
+
{
|
|
182
|
+
id: "auth.sso_form.data_terms",
|
|
183
|
+
defaultMessage: "Your personal data are being processed by the Editor. For more information and to exercise your rights, see our personal data policy available on the site."
|
|
184
|
+
}
|
|
185
|
+
) })
|
|
189
186
|
] })
|
|
190
187
|
] })
|
|
191
188
|
] })
|
|
192
189
|
] });
|
|
193
190
|
};
|
|
194
191
|
export {
|
|
195
|
-
|
|
192
|
+
oe as SSOForm
|
|
196
193
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import '../../../assets/components/auth/sso_form/SSOForm.module-
|
|
1
|
+
import '../../../assets/components/auth/sso_form/SSOForm.module-D5v2TrOv.css';const o = "_ssoForm_p3zvc_3", t = "_logo_p3zvc_9", c = "_logoImage_p3zvc_21", _ = "_loginIcon_p3zvc_27", n = "_mainText_p3zvc_41", s = "_title_p3zvc_65", g = "_loginButton_p3zvc_70", e = "_cgu_p3zvc_75", r = "_signupButton_p3zvc_99", u = "_cguButton_p3zvc_106", i = "_switchBox_p3zvc_118", l = "_error_p3zvc_123", p = "_termsTarget_p3zvc_128", v = {
|
|
2
2
|
ssoForm: o,
|
|
3
3
|
logo: t,
|
|
4
|
-
logoImage:
|
|
5
|
-
loginIcon:
|
|
6
|
-
mainText:
|
|
7
|
-
title:
|
|
4
|
+
logoImage: c,
|
|
5
|
+
loginIcon: _,
|
|
6
|
+
mainText: n,
|
|
7
|
+
title: s,
|
|
8
8
|
loginButton: g,
|
|
9
|
-
cgu:
|
|
10
|
-
signupButton:
|
|
11
|
-
cguButton:
|
|
12
|
-
switchBox:
|
|
9
|
+
cgu: e,
|
|
10
|
+
signupButton: r,
|
|
11
|
+
cguButton: u,
|
|
12
|
+
switchBox: i,
|
|
13
13
|
error: l,
|
|
14
|
-
termsTarget:
|
|
14
|
+
termsTarget: p
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
e as cgu,
|
|
18
|
+
u as cguButton,
|
|
19
|
+
v as default,
|
|
20
20
|
l as error,
|
|
21
21
|
g as loginButton,
|
|
22
|
-
|
|
22
|
+
_ as loginIcon,
|
|
23
23
|
t as logo,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
c as logoImage,
|
|
25
|
+
n as mainText,
|
|
26
|
+
r as signupButton,
|
|
27
27
|
o as ssoForm,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
i as switchBox,
|
|
29
|
+
p as termsTarget,
|
|
30
|
+
s as title
|
|
31
31
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { authTokenHandler as E } from "./authTokenHandler.js";
|
|
2
2
|
import { useAuth as w } from "./useAuth.js";
|
|
3
3
|
import { useDataProvider as v } from "../../data/data_provider/useDataProvider.js";
|
|
4
|
-
const
|
|
5
|
-
const { removeToken:
|
|
6
|
-
|
|
4
|
+
const I = "logora:emailConsent", L = (i, u, d) => {
|
|
5
|
+
const { removeToken: r, fetchToken: f } = E(
|
|
6
|
+
i,
|
|
7
7
|
u,
|
|
8
|
-
|
|
9
|
-
), { setCurrentUser:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return d(e).then((o) => i()).catch((o) => {
|
|
15
|
-
r(o);
|
|
8
|
+
d
|
|
9
|
+
), { setCurrentUser: o, setIsLoggedIn: n, setIsLoggingIn: s, setAuthError: a } = w(), h = v(), l = (e) => {
|
|
10
|
+
f(e).then((t) => {
|
|
11
|
+
c();
|
|
12
|
+
}).catch((t) => {
|
|
13
|
+
a(t);
|
|
16
14
|
});
|
|
17
15
|
}, g = () => {
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
n(!1), s(!1), o({}), r(), p();
|
|
17
|
+
}, c = () => {
|
|
18
|
+
h.getOneWithToken("me", "").then((e) => {
|
|
19
|
+
if (e.data.success) {
|
|
20
|
+
const t = e.data.data.resource;
|
|
21
|
+
o(t), n(!0), s(!1), m(t);
|
|
22
|
+
} else
|
|
23
|
+
a(!0), n(!1), s(!1), o({}), r();
|
|
24
|
+
}).catch((e) => {
|
|
25
|
+
a(!0), n(!1), s(!1), o({}), r();
|
|
26
|
+
});
|
|
27
|
+
}, m = (e) => {
|
|
28
28
|
typeof window < "u" && window.dispatchEvent(
|
|
29
29
|
new CustomEvent("logora:authentication:success", {
|
|
30
30
|
detail: {
|
|
@@ -36,12 +36,12 @@ const A = "logora:emailConsent", L = (c, u, f) => {
|
|
|
36
36
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("logora:authentication:logout"));
|
|
37
37
|
};
|
|
38
38
|
return {
|
|
39
|
-
loginUser:
|
|
39
|
+
loginUser: l,
|
|
40
40
|
logoutUser: g,
|
|
41
|
-
fetchUser:
|
|
41
|
+
fetchUser: c
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
I as EMAIL_CONSENT_STORAGE_KEY,
|
|
46
46
|
L as useAuthActions
|
|
47
47
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, Fragment as g, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import i from "classnames";
|
|
3
3
|
import { useMemo as p } from "react";
|
|
4
|
-
import { useIntl as
|
|
4
|
+
import { useIntl as f, FormattedMessage as h } from "react-intl";
|
|
5
5
|
import o from "./ConsultationBox.module.scss.js";
|
|
6
6
|
import { useRoutes as v } from "../../data/config_provider/useRoutes.js";
|
|
7
7
|
import { useResponsive as N } from "../../hooks/use_responsive/useResponsive.js";
|
|
@@ -11,7 +11,7 @@ import { Tooltip as m } from "../../dialog/tooltip/Tooltip.js";
|
|
|
11
11
|
import { Icon as d } from "../../icons/icon/Icon.js";
|
|
12
12
|
import { ProgressBar as x } from "../../progress/progress_bar/ProgressBar.js";
|
|
13
13
|
const P = ({ consultation: e, showVoteProgress: u = !0 }) => {
|
|
14
|
-
const a =
|
|
14
|
+
const a = f(), l = p(() => /* @__PURE__ */ new Date()), c = new Date(e.ends_at), n = v(), { isMobile: I } = N();
|
|
15
15
|
return /* @__PURE__ */ t(g, { children: /* @__PURE__ */ s("div", { className: o.container, children: [
|
|
16
16
|
/* @__PURE__ */ s("div", { className: o.consultationImageBox, children: [
|
|
17
17
|
/* @__PURE__ */ t(
|
|
@@ -26,7 +26,6 @@ const P = ({ consultation: e, showVoteProgress: u = !0 }) => {
|
|
|
26
26
|
loading: "lazy",
|
|
27
27
|
className: o.consultationImage,
|
|
28
28
|
src: e.image_url,
|
|
29
|
-
height: 200,
|
|
30
29
|
alt: a.formatMessage({
|
|
31
30
|
id: "consultation.consultation_box.alt",
|
|
32
31
|
defaultMessage: "Presentation image for the consultation"
|
|
@@ -36,7 +35,7 @@ const P = ({ consultation: e, showVoteProgress: u = !0 }) => {
|
|
|
36
35
|
}
|
|
37
36
|
),
|
|
38
37
|
e.ends_at && c < l && /* @__PURE__ */ t("div", { className: i(o.consultationTime, o.ended), children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
39
|
-
|
|
38
|
+
h,
|
|
40
39
|
{
|
|
41
40
|
id: "consultation.consultation_box.consultation_ended",
|
|
42
41
|
defaultMessage: "Consultation ended"
|