@logora/debate 0.4.42 → 0.4.43
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-B9Ok2t4H.css +1 -0
- package/dist/assets/components/action/button/Button.module-D7nbgOES.css +1 -0
- package/dist/assets/components/action/icon_text_link/IconTextLink.module-CZKufK9Y.css +1 -0
- package/dist/assets/components/argument/argument/Argument.module-CC40BY1L.css +1 -0
- package/dist/assets/components/argument/argument/ReplyFooter.module-CoC9dY8T.css +1 -0
- package/dist/assets/components/auth/sso_form/SSOForm.module-DOw9cmCF.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-97r47y_e.css +1 -0
- package/dist/assets/components/debate/debate_box/DebateBox.module-emnqIGNF.css +1 -0
- package/dist/assets/components/dialog/dialog_box/DialogBox.module-ZoM8d2Ly.css +1 -0
- package/dist/assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css +1 -0
- package/dist/assets/components/dialog/modal/Modal.module-Dt4SWx6U.css +1 -0
- package/dist/assets/components/dialog/toast/Toast.module-CW6j5xe7.css +1 -0
- package/dist/assets/components/dialog/tooltip/Tooltip.module-bQbmPiMf.css +1 -0
- package/dist/assets/components/embed/embed_header/EmbedHeader.module-C8RPiVBp.css +1 -0
- package/dist/assets/components/follow/follow_button/FollowButton.module-BjwLVTeb.css +1 -0
- package/dist/assets/components/gamification/badge_box/BadgeBox.module-DWqqtICw.css +1 -0
- package/dist/assets/components/gamification/point_box/{PointBox.module-BlHdQyht.css → PointBox.module-Dj6cCgSB.css} +1 -1
- package/dist/assets/components/information/information_box/InformationBox.module-DJLT957y.css +1 -0
- package/dist/assets/components/input/text_editor/TextEditor.module-KPtqT1Y6.css +1 -0
- package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css +1 -0
- package/dist/assets/components/input/toggle_position/TogglePosition.module-H4gGmJ0V.css +1 -0
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-BDMBrj2Y.css +1 -0
- package/dist/assets/components/navigation/tabs/Tabs.module-50P6bk0B.css +1 -0
- package/dist/assets/components/notification/notification_item/NotificationItem.module-BQcDopYB.css +1 -0
- package/dist/assets/components/notification/notification_menu/NotificationMenu.module-DrCrfzVk.css +1 -0
- package/dist/assets/components/progress/progress_bar/ProgressBar.module-DoCH9Qoo.css +1 -0
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-D1ccjSLm.css +1 -0
- package/dist/assets/components/section/section_box/SectionBox.module-DF7k7Vxq.css +1 -0
- package/dist/assets/components/share/share_button/{ShareButton.module-BS6STEUD.css → ShareButton.module-BnVEYTzr.css} +1 -1
- package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-d4r3QpYe.css +1 -0
- package/dist/assets/components/source/context_source_box/ContextSourceBox.module-doiSb_NR.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-Df4z4DN-.css +1 -0
- package/dist/assets/components/source/source_box/SourceBox.module-CQOBgJ5n.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-C5YDjksb.css +1 -0
- package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-P95xqaUA.css +1 -0
- package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-CE_Wvk-K.css +1 -0
- package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-r5N57bDp.css +1 -0
- package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-EDxcqwRa.css +1 -0
- package/dist/assets/components/summary/keyword_box/KeywordBox.module-yNHAvcRh.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Bu-AnMIG.css +1 -0
- package/dist/assets/components/text/read_more/ReadMore.module-Bs-YaspR.css +1 -0
- package/dist/assets/components/user/author_box/AuthorBox.module-B8Sl2v33.css +1 -0
- package/dist/assets/components/user/onboarding_modal/OnboardingModal.module-CTpt3xSh.css +1 -0
- package/dist/assets/components/user/user_box/UserBox.module-DMFhZDAH.css +1 -0
- package/dist/assets/components/user/user_box_small/UserBoxSmall.module-D4Ut5xmS.css +1 -0
- package/dist/assets/components/user_content/content_footer/ContentFooter.module-9A9E8k5l.css +1 -0
- package/dist/assets/components/user_content/content_header/ContentHeader.module-CXO2IRui.css +1 -0
- package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-CBlL2Xii.css +1 -0
- package/dist/assets/components/user_content/use_report_content/ReportModal.module-mjFuOdmL.css +1 -0
- package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CKFriPV5.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-Bv7WY_vr.css +1 -0
- package/dist/assets/components/vote/vote_button/VoteButton.module-DqD79xv_.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 +120 -112
- 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 +58 -41
- package/dist/components/auth/providers/FormAuth.js +6 -3
- package/dist/components/auth/providers/PasswordAuth.js +6 -6
- package/dist/components/auth/sso_form/SSOForm.module.scss.js +20 -20
- package/dist/components/auth/use_auth/base64.js +4 -0
- package/dist/components/auth/use_auth/useAuthActions.js +24 -24
- package/dist/components/consultation/consultation_box/ConsultationBox.js +4 -3
- 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 +19 -17
- package/dist/components/dialog/dropdown/Dropdown.module.scss.js +17 -13
- 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/icons/clarin_icons/Alarm.js +6 -0
- package/dist/components/icons/clarin_icons/Announcement.js +6 -0
- package/dist/components/icons/clarin_icons/Chat.js +6 -0
- package/dist/components/icons/clarin_icons/CheckCircle.js +9 -0
- package/dist/components/icons/clarin_icons/Clock.js +6 -0
- package/dist/components/icons/clarin_icons/Follow.js +6 -0
- package/dist/components/icons/clarin_icons/MobileClose.js +9 -0
- package/dist/components/icons/clarin_icons/Question.js +6 -0
- package/dist/components/icons/clarin_icons/Search.js +6 -0
- package/dist/components/icons/clarin_icons/Send.js +6 -0
- package/dist/components/icons/clarin_icons/Share.js +6 -0
- package/dist/components/icons/clarin_icons/Upvote.js +9 -0
- package/dist/components/icons/clarin_icons/User.js +9 -0
- package/dist/components/icons/clarin_icons/index.js +106 -0
- package/dist/components/information/information_box/InformationBox.module.scss.js +4 -4
- package/dist/components/input/argument_input/ArgumentInput.js +172 -167
- package/dist/components/input/text_editor/TextEditor.js +49 -47
- package/dist/components/input/text_editor/TextEditor.module.scss.js +28 -28
- package/dist/components/input/text_editor/plugins/IOSInsertParagraphFallbackPlugin.js +34 -0
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +143 -94
- 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 +134 -124
- 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 +85 -24
- package/dist/components/navigation/tabs/Tabs.module.scss.js +19 -9
- 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 +58 -56
- 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 +26 -24
- package/dist/components/share/share_button/ShareButton.module.scss.js +5 -3
- 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 +7 -5
- 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 +18 -17
- package/dist/components/user/author_box/AuthorBox.module.scss.js +24 -24
- package/dist/components/user/onboarding_modal/OnboardingModal.js +296 -0
- package/dist/components/user/onboarding_modal/OnboardingModal.module.scss.js +29 -0
- package/dist/components/user/onboarding_modal/useOnboarding.js +80 -0
- package/dist/components/user/user_box/UserBox.js +48 -38
- package/dist/components/user/user_box/UserBox.module.scss.js +9 -9
- package/dist/components/user/user_box_small/UserBoxSmall.js +19 -18
- package/dist/components/user/user_box_small/UserBoxSmall.module.scss.js +6 -6
- package/dist/components/user_content/content_footer/ContentFooter.js +95 -92
- 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 +319 -312
- package/package.json +3 -2
- package/dist/assets/components/action/back_link/BackLink.module-nMAM5nvb.css +0 -1
- package/dist/assets/components/action/button/Button.module-BXkLuURK.css +0 -1
- package/dist/assets/components/action/icon_text_link/IconTextLink.module-B5PF-MMK.css +0 -1
- package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +0 -1
- package/dist/assets/components/argument/argument/ReplyFooter.module-x9Xlkt3Z.css +0 -1
- package/dist/assets/components/auth/sso_form/SSOForm.module-D5v2TrOv.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +0 -1
- package/dist/assets/components/debate/debate_box/DebateBox.module-DTLafpl4.css +0 -1
- package/dist/assets/components/dialog/dialog_box/DialogBox.module-DKztqqmb.css +0 -1
- package/dist/assets/components/dialog/dropdown/Dropdown.module-FG2Sqrqs.css +0 -1
- package/dist/assets/components/dialog/modal/Modal.module-CIj-xCzY.css +0 -1
- package/dist/assets/components/dialog/toast/Toast.module-DJ2wSlJT.css +0 -1
- package/dist/assets/components/dialog/tooltip/Tooltip.module-zMXumgnX.css +0 -1
- package/dist/assets/components/embed/embed_header/EmbedHeader.module-CoyRY_jw.css +0 -1
- package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +0 -1
- package/dist/assets/components/gamification/badge_box/BadgeBox.module-BnskGH9b.css +0 -1
- package/dist/assets/components/information/information_box/InformationBox.module-B_MiEPn7.css +0 -1
- package/dist/assets/components/input/text_editor/TextEditor.module-CxuSL3l3.css +0 -1
- package/dist/assets/components/input/text_editor/plugins/ToolbarPlugin.module-CbPmMciY.css +0 -1
- package/dist/assets/components/input/toggle_position/TogglePosition.module-DDIigbfA.css +0 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +0 -1
- package/dist/assets/components/navigation/tabs/Tabs.module-CtDi0tAd.css +0 -1
- package/dist/assets/components/notification/notification_item/NotificationItem.module-BWdhgSy4.css +0 -1
- package/dist/assets/components/notification/notification_menu/NotificationMenu.module-BQwbvRIV.css +0 -1
- package/dist/assets/components/progress/progress_bar/ProgressBar.module-Dy-27Wf9.css +0 -1
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +0 -1
- package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +0 -1
- package/dist/assets/components/skeleton/user_content_skeleton/UserContentSkeleton.module-DhZm1xTr.css +0 -1
- package/dist/assets/components/source/context_source_box/ContextSourceBox.module-78Gxjx0w.css +0 -1
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +0 -1
- package/dist/assets/components/source/source_box/SourceBox.module-Cu_m3E85.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +0 -1
- package/dist/assets/components/suggestion/suggestion_banner/SuggestionBanner.module-D37NVZLS.css +0 -1
- package/dist/assets/components/suggestion/suggestion_box/SuggestionBox.module-DHxoF0oe.css +0 -1
- package/dist/assets/components/suggestion/suggestion_input/SuggestionInput.module-BsEj7sF3.css +0 -1
- package/dist/assets/components/summary/argument_summary_box/ArgumentSummaryBox.module-DLcsyMSD.css +0 -1
- package/dist/assets/components/summary/keyword_box/KeywordBox.module-DHkYfW0l.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +0 -1
- package/dist/assets/components/text/read_more/ReadMore.module-Ni_Mm8o8.css +0 -1
- package/dist/assets/components/user/author_box/AuthorBox.module-CbH2S-MT.css +0 -1
- package/dist/assets/components/user/update_user_info_modal/UpdateUserInfoModal.module-DJym6u4r.css +0 -1
- package/dist/assets/components/user/user_box/UserBox.module-DGKK1afI.css +0 -1
- package/dist/assets/components/user/user_box_small/UserBoxSmall.module-ibAw9gGE.css +0 -1
- package/dist/assets/components/user_content/content_footer/ContentFooter.module-ax3j7VNT.css +0 -1
- package/dist/assets/components/user_content/content_header/ContentHeader.module-B0VwpU-R.css +0 -1
- package/dist/assets/components/user_content/summary_content_box/SummaryContentBox.module-DdzWnPjq.css +0 -1
- package/dist/assets/components/user_content/use_report_content/ReportModal.module-BxF-D5C5.css +0 -1
- package/dist/assets/components/vote/suggestion_vote_box/SuggestionVoteBox.module-CZeQKWIw.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +0 -1
- package/dist/assets/components/vote/vote_button/VoteButton.module-aP9ZrGSd.css +0 -1
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.js +0 -291
- package/dist/components/user/update_user_info_modal/UpdateUserInfoModal.module.scss.js +0 -29
- package/dist/components/user/update_user_info_modal/useUpdateUserInfo.js +0 -27
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as o, Fragment as w } from "react/jsx-runtime";
|
|
2
|
-
import { useState as n } from "react";
|
|
3
|
-
import { useIntl as Y, FormattedMessage as Z } from "react-intl";
|
|
4
|
-
import t from "./UpdateUserInfoModal.module.scss.js";
|
|
5
|
-
import { useAuth as ee } from "../../auth/use_auth/useAuth.js";
|
|
6
|
-
import { useDataProvider as ae } from "../../data/data_provider/useDataProvider.js";
|
|
7
|
-
import { useConfig as te } from "../../data/config_provider/useConfig.js";
|
|
8
|
-
import { useResponsive as se } from "../../hooks/use_responsive/useResponsive.js";
|
|
9
|
-
import { useFormValidation as re } from "../../forms/use_form_validation/useFormValidation.js";
|
|
10
|
-
import { useModal as ie } from "../../dialog/modal/useModal.js";
|
|
11
|
-
import { Modal as ne } from "../../dialog/modal/Modal.js";
|
|
12
|
-
import { Loader as le } from "../../progress/loader/Loader.js";
|
|
13
|
-
import { Icon as oe } from "../../icons/icon/Icon.js";
|
|
14
|
-
import { Button as I } from "../../action/button/Button.js";
|
|
15
|
-
import { TextInput as A } from "../../input/text_input/TextInput.js";
|
|
16
|
-
import { Select as de } from "../../input/select/Select.js";
|
|
17
|
-
import { Toggle as S } from "../../input/toggle/Toggle.js";
|
|
18
|
-
import { AvatarSelector as ce } from "../avatar_selector/AvatarSelector.js";
|
|
19
|
-
const Ie = ({
|
|
20
|
-
termsUrl: O,
|
|
21
|
-
privacyUrl: F,
|
|
22
|
-
showEmailConsent: M = !1,
|
|
23
|
-
showTerms: u = !1
|
|
24
|
-
}) => {
|
|
25
|
-
const l = ee(), D = ae(), i = Y(), r = te(), L = [...Array(r.avatars?.maxFileName || 0).keys()].map(
|
|
26
|
-
(e) => `${r.avatars?.baseUrl}/${e + 1}.${r.avatars?.fileExtension}`
|
|
27
|
-
), [f, B] = n(l.currentUser.first_name || ""), [p, $] = n(
|
|
28
|
-
l.currentUser.description || ""
|
|
29
|
-
), [g, j] = n(l.currentUser.last_name || ""), [_, R] = n(l.currentUser.language), [q, h] = n(!1), [N, U] = n(
|
|
30
|
-
l.currentUser.image_url
|
|
31
|
-
), [c, E] = n(null), [C, x] = n(!1), [z, T] = n(!1), { isMobile: y } = se(), { errors: d, validate: V } = re(), { hideModal: k } = ie(), [v, W] = n(!1), [b, G] = n(!1), H = (e) => {
|
|
32
|
-
const s = new FileReader();
|
|
33
|
-
s.onloadend = () => {
|
|
34
|
-
U(s.result);
|
|
35
|
-
}, s.readAsDataURL(e);
|
|
36
|
-
}, J = [
|
|
37
|
-
{ first_name: ["required", null] },
|
|
38
|
-
{ first_name: ["minChar", 2] },
|
|
39
|
-
{ last_name: ["required", null] },
|
|
40
|
-
{ last_name: ["minChar", 2] },
|
|
41
|
-
{ language: ["required", null] },
|
|
42
|
-
...u ? [{ accepts_terms: ["enforceValue", !0] }] : []
|
|
43
|
-
], K = (e) => {
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
const s = {};
|
|
46
|
-
if (f && (s.first_name = f), g && (s.last_name = g), _ && (s.language = _), c && C && (s.image = c), c && !C && (s.origin_image_url = c), p && (s.description = p), M && (s.accepts_provider_email = b), u && (s.accepts_terms = v), s.is_onboarded = !0, V(s, J)) {
|
|
47
|
-
T(!0);
|
|
48
|
-
const P = new FormData();
|
|
49
|
-
Object.entries(s).forEach(([m, X]) => {
|
|
50
|
-
P.append(m, X);
|
|
51
|
-
}), D.update("users", l.currentUser.slug, P).then((m) => {
|
|
52
|
-
m.data.success && l.setCurrentUser(m.data.data.resource), k();
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}, Q = (e) => {
|
|
56
|
-
const s = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i;
|
|
57
|
-
E(e), h(!1), s.test(e) ? (U(e), x(!1)) : (x(!0), H(e));
|
|
58
|
-
};
|
|
59
|
-
return /* @__PURE__ */ a(
|
|
60
|
-
ne,
|
|
61
|
-
{
|
|
62
|
-
"data-vid": "update_user_info_modal",
|
|
63
|
-
title: i.formatMessage({
|
|
64
|
-
id: "modal.update_user_info_modal.modal_title",
|
|
65
|
-
defaultMessage: "Update your profile"
|
|
66
|
-
}),
|
|
67
|
-
style: {
|
|
68
|
-
width: y ? "unset" : "max-content",
|
|
69
|
-
minWidth: y ? "unset" : "500px",
|
|
70
|
-
maxWidth: "800px"
|
|
71
|
-
},
|
|
72
|
-
showCloseButton: !1,
|
|
73
|
-
disableClickOutside: !0,
|
|
74
|
-
children: z ? /* @__PURE__ */ a(le, {}) : q ? /* @__PURE__ */ o(w, { children: [
|
|
75
|
-
/* @__PURE__ */ a(
|
|
76
|
-
ce,
|
|
77
|
-
{
|
|
78
|
-
onChooseAvatar: Q,
|
|
79
|
-
avatarUrlList: L,
|
|
80
|
-
userName: l.currentUser.full_name,
|
|
81
|
-
allowUserImage: r.avatars?.allowUserImage
|
|
82
|
-
}
|
|
83
|
-
),
|
|
84
|
-
/* @__PURE__ */ a(
|
|
85
|
-
"div",
|
|
86
|
-
{
|
|
87
|
-
className: t.backButton,
|
|
88
|
-
onClick: () => h(!1),
|
|
89
|
-
children: i.formatMessage({
|
|
90
|
-
id: "user.user_edit.back",
|
|
91
|
-
defaultMessage: "Back"
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
] }) : /* @__PURE__ */ o(w, { children: [
|
|
96
|
-
/* @__PURE__ */ o("div", { className: t.container, children: [
|
|
97
|
-
/* @__PURE__ */ o("div", { className: t.userImageContainer, children: [
|
|
98
|
-
N ? /* @__PURE__ */ a(
|
|
99
|
-
"img",
|
|
100
|
-
{
|
|
101
|
-
className: t.userPictureUpload,
|
|
102
|
-
src: N,
|
|
103
|
-
alt: i.formatMessage({
|
|
104
|
-
id: "alt.my_profile_picture",
|
|
105
|
-
defaultMessage: "Ma photo de profil"
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
) : /* @__PURE__ */ a("div", { className: t.userPictureUpload, children: /* @__PURE__ */ a(
|
|
109
|
-
oe,
|
|
110
|
-
{
|
|
111
|
-
name: "camera",
|
|
112
|
-
height: 20,
|
|
113
|
-
width: 20,
|
|
114
|
-
alt: i.formatMessage({
|
|
115
|
-
id: "user.user_edit.profile_picture",
|
|
116
|
-
defaultMessage: "Profile picture"
|
|
117
|
-
})
|
|
118
|
-
}
|
|
119
|
-
) }),
|
|
120
|
-
/* @__PURE__ */ a(
|
|
121
|
-
I,
|
|
122
|
-
{
|
|
123
|
-
"data-testid": "avatar-button",
|
|
124
|
-
"data-tid": "action_save_profile",
|
|
125
|
-
onClick: () => h(!0),
|
|
126
|
-
style: { whiteSpace: "nowrap" },
|
|
127
|
-
children: i.formatMessage({
|
|
128
|
-
id: "user.user_edit.avatar",
|
|
129
|
-
defaultMessage: "Select an avatar"
|
|
130
|
-
})
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
] }),
|
|
134
|
-
/* @__PURE__ */ o("div", { className: t.inputsContainer, children: [
|
|
135
|
-
/* @__PURE__ */ o("div", { className: t.nameContainer, children: [
|
|
136
|
-
/* @__PURE__ */ a("div", { className: t.updateProfileInput, children: /* @__PURE__ */ a(
|
|
137
|
-
A,
|
|
138
|
-
{
|
|
139
|
-
type: "text",
|
|
140
|
-
name: "first_name",
|
|
141
|
-
"aria-label": i.formatMessage({
|
|
142
|
-
id: "auth.signup_form.first_name.aria_label",
|
|
143
|
-
defaultMessage: "First name"
|
|
144
|
-
}),
|
|
145
|
-
placeholder: i.formatMessage({
|
|
146
|
-
id: "auth_signup_form_first_name_placeholder",
|
|
147
|
-
defaultMessage: "First name"
|
|
148
|
-
}),
|
|
149
|
-
onChange: (e) => r.actions?.disableOnboardingNameUpdate === !0 ? null : B(e.target.value),
|
|
150
|
-
value: f,
|
|
151
|
-
error: !!d.first_name,
|
|
152
|
-
message: d.first_name,
|
|
153
|
-
"data-testid": "first-name",
|
|
154
|
-
disabled: r.actions?.disableOnboardingNameUpdate === !0
|
|
155
|
-
}
|
|
156
|
-
) }),
|
|
157
|
-
/* @__PURE__ */ a("div", { className: t.updateProfileInput, children: /* @__PURE__ */ a(
|
|
158
|
-
A,
|
|
159
|
-
{
|
|
160
|
-
type: "text",
|
|
161
|
-
name: "last_name",
|
|
162
|
-
"aria-label": i.formatMessage({
|
|
163
|
-
id: "auth.signup_form.last_name.aria_label",
|
|
164
|
-
defaultMessage: "Last name"
|
|
165
|
-
}),
|
|
166
|
-
placeholder: i.formatMessage({
|
|
167
|
-
id: "auth_signup_form_last_name_placeholder",
|
|
168
|
-
defaultMessage: "Last name"
|
|
169
|
-
}),
|
|
170
|
-
onChange: (e) => r.actions?.disableOnboardingNameUpdate === !0 ? null : j(e.target.value),
|
|
171
|
-
value: g,
|
|
172
|
-
error: !!d.last_name,
|
|
173
|
-
message: d.last_name,
|
|
174
|
-
"data-testid": "last-name",
|
|
175
|
-
disabled: r.actions?.disableOnboardingNameUpdate === !0
|
|
176
|
-
}
|
|
177
|
-
) })
|
|
178
|
-
] }),
|
|
179
|
-
r.actions?.disableNameUpdate == !0 && r.actions?.disableOnboardingNameUpdate != !0 && /* @__PURE__ */ a("div", { className: t.hint, children: i.formatMessage({
|
|
180
|
-
id: "user.user_edit.user_name_hint",
|
|
181
|
-
defaultMessage: "last name"
|
|
182
|
-
}) }),
|
|
183
|
-
r.translation?.translationMethods && Object.keys(r.translation.translationMethods).length > 0 && /* @__PURE__ */ a(
|
|
184
|
-
de,
|
|
185
|
-
{
|
|
186
|
-
selectClassName: t.langSelect,
|
|
187
|
-
options: Object.keys(
|
|
188
|
-
r.translation.translationMethods
|
|
189
|
-
).map((e) => ({
|
|
190
|
-
name: e,
|
|
191
|
-
value: e,
|
|
192
|
-
text: `${e.toUpperCase()}`
|
|
193
|
-
})),
|
|
194
|
-
defaultOption: _,
|
|
195
|
-
onChange: (e) => R(e.value)
|
|
196
|
-
}
|
|
197
|
-
),
|
|
198
|
-
/* @__PURE__ */ a("div", { className: t.userDescription, children: /* @__PURE__ */ a(
|
|
199
|
-
"textarea",
|
|
200
|
-
{
|
|
201
|
-
className: t.textArea,
|
|
202
|
-
placeholder: i.formatMessage({
|
|
203
|
-
id: "user.user_edit.user_description",
|
|
204
|
-
defaultMessage: "Describe yourself in a few words"
|
|
205
|
-
}),
|
|
206
|
-
value: p,
|
|
207
|
-
onChange: (e) => $(e.target.value),
|
|
208
|
-
maxLength: 500,
|
|
209
|
-
"data-testid": "description"
|
|
210
|
-
}
|
|
211
|
-
) })
|
|
212
|
-
] })
|
|
213
|
-
] }),
|
|
214
|
-
u && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
|
|
215
|
-
S,
|
|
216
|
-
{
|
|
217
|
-
type: "checkbox",
|
|
218
|
-
name: "accepts_terms",
|
|
219
|
-
style: { fontSize: 18 },
|
|
220
|
-
checked: v,
|
|
221
|
-
label: /* @__PURE__ */ a(
|
|
222
|
-
Z,
|
|
223
|
-
{
|
|
224
|
-
id: "modal.update_user_info_modal.accepts_terms",
|
|
225
|
-
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.",
|
|
226
|
-
values: {
|
|
227
|
-
var1: (e) => /* @__PURE__ */ a(
|
|
228
|
-
"a",
|
|
229
|
-
{
|
|
230
|
-
className: t.cgu,
|
|
231
|
-
target: "_blank",
|
|
232
|
-
href: O,
|
|
233
|
-
rel: "noreferrer",
|
|
234
|
-
children: e
|
|
235
|
-
}
|
|
236
|
-
),
|
|
237
|
-
var2: (e) => /* @__PURE__ */ a(
|
|
238
|
-
"a",
|
|
239
|
-
{
|
|
240
|
-
className: t.cgu,
|
|
241
|
-
target: "_blank",
|
|
242
|
-
href: F,
|
|
243
|
-
rel: "noreferrer",
|
|
244
|
-
children: e
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
),
|
|
250
|
-
onInputChanged: (e) => W(!v),
|
|
251
|
-
message: d.accepts_terms,
|
|
252
|
-
"data-testid": "accepts-terms-input"
|
|
253
|
-
}
|
|
254
|
-
) }),
|
|
255
|
-
M && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
|
|
256
|
-
S,
|
|
257
|
-
{
|
|
258
|
-
type: "checkbox",
|
|
259
|
-
name: "accepts_provider_email",
|
|
260
|
-
style: { fontSize: 18 },
|
|
261
|
-
checked: b,
|
|
262
|
-
label: i.formatMessage(
|
|
263
|
-
{
|
|
264
|
-
id: "modal.update_user_info_modal.consent_label",
|
|
265
|
-
defaultMessage: "I agree to receive emails from the editor"
|
|
266
|
-
},
|
|
267
|
-
{ provider: r.provider?.companyName }
|
|
268
|
-
),
|
|
269
|
-
onInputChanged: (e) => G(!b),
|
|
270
|
-
"data-testid": "accepts-email-input"
|
|
271
|
-
}
|
|
272
|
-
) }),
|
|
273
|
-
/* @__PURE__ */ a("div", { className: t.userSaveBox, children: /* @__PURE__ */ a(
|
|
274
|
-
I,
|
|
275
|
-
{
|
|
276
|
-
"data-testid": "save-button",
|
|
277
|
-
"data-tid": "action_save_profile",
|
|
278
|
-
onClick: (e) => K(e),
|
|
279
|
-
children: i.formatMessage({
|
|
280
|
-
id: "user.user_edit.save",
|
|
281
|
-
defaultMessage: "Save"
|
|
282
|
-
})
|
|
283
|
-
}
|
|
284
|
-
) })
|
|
285
|
-
] })
|
|
286
|
-
}
|
|
287
|
-
);
|
|
288
|
-
};
|
|
289
|
-
export {
|
|
290
|
-
Ie as UpdateUserInfoModal
|
|
291
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import '../../../assets/components/user/update_user_info_modal/UpdateUserInfoModal.module-DJym6u4r.css';const t = "_container_6t85s_3", n = "_nameContainer_6t85s_22", e = "_inputsContainer_6t85s_48", s = "_hint_6t85s_61", o = "_langSelect_6t85s_67", _ = "_textArea_6t85s_71", a = "_userSaveBox_6t85s_129", c = "_userPictureUpload_6t85s_138", r = "_userImageContainer_6t85s_156", u = "_backButton_6t85s_172", i = "_toggle_6t85s_179", g = "_cgu_6t85s_184", l = {
|
|
2
|
-
container: t,
|
|
3
|
-
nameContainer: n,
|
|
4
|
-
inputsContainer: e,
|
|
5
|
-
hint: s,
|
|
6
|
-
langSelect: o,
|
|
7
|
-
textArea: _,
|
|
8
|
-
userSaveBox: a,
|
|
9
|
-
userPictureUpload: c,
|
|
10
|
-
userImageContainer: r,
|
|
11
|
-
backButton: u,
|
|
12
|
-
toggle: i,
|
|
13
|
-
cgu: g
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
u as backButton,
|
|
17
|
-
g as cgu,
|
|
18
|
-
t as container,
|
|
19
|
-
l as default,
|
|
20
|
-
s as hint,
|
|
21
|
-
e as inputsContainer,
|
|
22
|
-
o as langSelect,
|
|
23
|
-
n as nameContainer,
|
|
24
|
-
_ as textArea,
|
|
25
|
-
i as toggle,
|
|
26
|
-
r as userImageContainer,
|
|
27
|
-
c as userPictureUpload,
|
|
28
|
-
a as userSaveBox
|
|
29
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as i } from "react";
|
|
3
|
-
import { UpdateUserInfoModal as p } from "./UpdateUserInfoModal.js";
|
|
4
|
-
import { useAuth as l } from "../../auth/use_auth/useAuth.js";
|
|
5
|
-
import { useModal as m } from "../../dialog/modal/useModal.js";
|
|
6
|
-
import { useConfig as u } from "../../data/config_provider/useConfig.js";
|
|
7
|
-
const U = () => {
|
|
8
|
-
const { currentUser: t, isLoggedIn: r } = l(), { showModal: e, isModalPresent: s } = m(), o = u(), n = () => {
|
|
9
|
-
e(
|
|
10
|
-
/* @__PURE__ */ a(
|
|
11
|
-
p,
|
|
12
|
-
{
|
|
13
|
-
showEmailConsent: o.auth?.showEmailConsent,
|
|
14
|
-
showTerms: o.auth?.hideCgu !== !0,
|
|
15
|
-
termsUrl: o.provider?.cguUrl || "https://www.logora.com/blog-posts/cgu",
|
|
16
|
-
privacyUrl: o.provider?.privacyUrl || "https://www.logora.com/blog-posts/privacy-policy"
|
|
17
|
-
}
|
|
18
|
-
)
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
return i(() => {
|
|
22
|
-
!s && r && t.is_onboarded === !1 && o.auth?.showOnboarding === !0 && n();
|
|
23
|
-
}, [s, r, o.auth?.showOnboarding]), null;
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
U as useUpdateUserInfo
|
|
27
|
-
};
|