@logora/debate 0.4.36 → 0.4.38
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/components/navbar/navbar_modal/NavbarModal.js +14 -14
- package/dist/components/user/author_box/AuthorBox.js +1 -1
- package/dist/components/user/user_box/UserBox.js +9 -9
- package/dist/components/user/user_box_small/UserBoxSmall.js +1 -1
- package/dist/components/user_content/content_footer/ContentFooter.js +49 -49
- package/package.json +1 -1
|
@@ -16,27 +16,27 @@ import { Link as d } from "../../action/link/Link.js";
|
|
|
16
16
|
import { Icon as c } from "../../icons/icon/Icon.js";
|
|
17
17
|
import { Avatar as A } from "../../user/avatar/Avatar.js";
|
|
18
18
|
const Q = () => {
|
|
19
|
-
const { hideModal: r } = C(), s = I(),
|
|
19
|
+
const { hideModal: r } = C(), s = I(), e = M(), { pathname: u } = _(), { isLoggedIn: h, currentUser: m } = S(), p = b(), g = k?.() || {}, { isMobile: f, elementWidth: v } = g, L = f && v <= 576 && !s.isDrawer, o = (N) => !!x(N, u), w = () => {
|
|
20
20
|
p({});
|
|
21
21
|
};
|
|
22
22
|
return /* @__PURE__ */ n(U, { fullScreen: !s.isDrawer, showCloseButton: !0, children: [
|
|
23
23
|
/* @__PURE__ */ n("div", { className: t.modalContainer, children: [
|
|
24
24
|
/* @__PURE__ */ i("div", { className: t.modalTitle, children: /* @__PURE__ */ i(l, { id: "info.menu", defaultMessage: "Navigation" }) }),
|
|
25
25
|
/* @__PURE__ */ n("div", { className: t.navigationContainer, children: [
|
|
26
|
-
/* @__PURE__ */ i(
|
|
26
|
+
s?.layout?.hideDebatesLink !== !0 && /* @__PURE__ */ i(
|
|
27
27
|
"div",
|
|
28
28
|
{
|
|
29
29
|
className: a(t.modalItem, {
|
|
30
|
-
[t.active]: e
|
|
30
|
+
[t.active]: o(e.indexLocation.path) || o(e.debateShowLocation.path) || o(e.rootLocation.path || "/")
|
|
31
31
|
}),
|
|
32
32
|
onClick: r,
|
|
33
33
|
children: /* @__PURE__ */ n(
|
|
34
34
|
d,
|
|
35
35
|
{
|
|
36
36
|
className: a(t.itemContainer, {
|
|
37
|
-
[t.activeItem]: e
|
|
37
|
+
[t.activeItem]: o(e.indexLocation.path) || o(e.debateShowLocation.path) || o(e.rootLocation.path || "/")
|
|
38
38
|
}),
|
|
39
|
-
to:
|
|
39
|
+
to: e.indexLocation.toUrl(),
|
|
40
40
|
"data-tid": "view_index",
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ i(c, { name: "chat", height: 24, width: 24 }),
|
|
@@ -56,16 +56,16 @@ const Q = () => {
|
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
58
|
className: a(t.modalItem, {
|
|
59
|
-
[t.active]: e
|
|
59
|
+
[t.active]: o(e.consultationIndexLocation.path) || o(e.consultationShowLocation.path)
|
|
60
60
|
}),
|
|
61
61
|
onClick: r,
|
|
62
62
|
children: /* @__PURE__ */ n(
|
|
63
63
|
d,
|
|
64
64
|
{
|
|
65
65
|
className: a(t.itemContainer, {
|
|
66
|
-
[t.activeItem]: e
|
|
66
|
+
[t.activeItem]: o(e.consultationIndexLocation.path) || o(e.consultationShowLocation.path)
|
|
67
67
|
}),
|
|
68
|
-
to:
|
|
68
|
+
to: e.consultationIndexLocation.toUrl(),
|
|
69
69
|
"data-tid": "view_consultation",
|
|
70
70
|
children: [
|
|
71
71
|
/* @__PURE__ */ i(c, { name: "community", height: 24, width: 24 }),
|
|
@@ -85,16 +85,16 @@ const Q = () => {
|
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
87
|
className: a(t.modalItem, {
|
|
88
|
-
[t.active]: e
|
|
88
|
+
[t.active]: o(e.suggestionLocation.path)
|
|
89
89
|
}),
|
|
90
90
|
onClick: r,
|
|
91
91
|
children: /* @__PURE__ */ n(
|
|
92
92
|
d,
|
|
93
93
|
{
|
|
94
94
|
className: a(t.itemContainer, {
|
|
95
|
-
[t.activeItem]: e
|
|
95
|
+
[t.activeItem]: o(e.suggestionLocation.path)
|
|
96
96
|
}),
|
|
97
|
-
to:
|
|
97
|
+
to: e.suggestionLocation.toUrl(),
|
|
98
98
|
"data-tid": "view_suggestions",
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ i(c, { name: "suggestion", height: 24, width: 24 }),
|
|
@@ -114,16 +114,16 @@ const Q = () => {
|
|
|
114
114
|
"div",
|
|
115
115
|
{
|
|
116
116
|
className: a(t.modalItem, {
|
|
117
|
-
[t.active]: e
|
|
117
|
+
[t.active]: o(e.userShowLocation.path) || o(e.userEditLocation.path)
|
|
118
118
|
}),
|
|
119
119
|
onClick: r,
|
|
120
120
|
children: /* @__PURE__ */ i(
|
|
121
121
|
d,
|
|
122
122
|
{
|
|
123
123
|
className: a(t.itemContainer, {
|
|
124
|
-
[t.activeItem]: e
|
|
124
|
+
[t.activeItem]: o(e.userShowLocation.path) || o(e.userEditLocation.path)
|
|
125
125
|
}),
|
|
126
|
-
to:
|
|
126
|
+
to: e.userShowLocation.toUrl({
|
|
127
127
|
userSlug: m.hash_id
|
|
128
128
|
}),
|
|
129
129
|
"data-tid": "view_user_profile",
|
|
@@ -23,7 +23,7 @@ const R = ({
|
|
|
23
23
|
language: u = null,
|
|
24
24
|
languageDialect: h = null
|
|
25
25
|
}) => {
|
|
26
|
-
const t = B(), f = _(), L = k()?.
|
|
26
|
+
const t = B(), f = _(), L = k()?.layout?.disableProfileLinks === !0, p = new Date(b) > Date.now();
|
|
27
27
|
return /* @__PURE__ */ r("div", { className: N(a.authorBox, "author-box"), children: [
|
|
28
28
|
!s || l || L || o ? /* @__PURE__ */ e(
|
|
29
29
|
g,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import c from "classnames";
|
|
3
3
|
import "react";
|
|
4
4
|
import { useIntl as d, FormattedMessage as r } from "react-intl";
|
|
@@ -6,10 +6,10 @@ import s from "./UserBox.module.scss.js";
|
|
|
6
6
|
import { useRoutes as m } from "../../data/config_provider/useRoutes.js";
|
|
7
7
|
import { useConfig as _ } from "../../data/config_provider/useConfig.js";
|
|
8
8
|
import { Avatar as l } from "../avatar/Avatar.js";
|
|
9
|
-
import { Link as
|
|
9
|
+
import { Link as o } from "../../action/link/Link.js";
|
|
10
10
|
const B = ({ user: e }) => {
|
|
11
|
-
const n = d(), t = m(), u = _()?.
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
const n = d(), t = m(), u = _()?.layout?.disableProfileLinks === !0;
|
|
12
|
+
return /* @__PURE__ */ i("div", { className: c(s.userBox, "author-box"), children: [
|
|
13
13
|
/* @__PURE__ */ a("div", { className: s.userBoxHeader, children: u ? /* @__PURE__ */ a(
|
|
14
14
|
l,
|
|
15
15
|
{
|
|
@@ -20,7 +20,7 @@ const B = ({ user: e }) => {
|
|
|
20
20
|
size: 60
|
|
21
21
|
}
|
|
22
22
|
) : /* @__PURE__ */ a(
|
|
23
|
-
|
|
23
|
+
o,
|
|
24
24
|
{
|
|
25
25
|
to: t.userShowLocation.toUrl({ userSlug: e.hash_id }),
|
|
26
26
|
"aria-label": n.formatMessage({
|
|
@@ -39,8 +39,8 @@ const B = ({ user: e }) => {
|
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
) }),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */ a(
|
|
42
|
+
/* @__PURE__ */ i("div", { className: s.userBoxDescription, children: [
|
|
43
|
+
/* @__PURE__ */ a(o, { to: t.userShowLocation.toUrl({ userSlug: e.hash_id }), children: /* @__PURE__ */ a(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
"data-tid": "action_view_user_name",
|
|
@@ -50,7 +50,7 @@ const B = ({ user: e }) => {
|
|
|
50
50
|
}
|
|
51
51
|
) }),
|
|
52
52
|
e.role === "contributor" && /* @__PURE__ */ a(
|
|
53
|
-
|
|
53
|
+
o,
|
|
54
54
|
{
|
|
55
55
|
to: t.userShowLocation.toUrl({ userSlug: e.hash_id }),
|
|
56
56
|
hash: "activity",
|
|
@@ -64,7 +64,7 @@ const B = ({ user: e }) => {
|
|
|
64
64
|
) }) })
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */ a(
|
|
67
|
+
/* @__PURE__ */ a(o, { to: t.userShowLocation.toUrl({ userSlug: e.hash_id }), children: /* @__PURE__ */ i("div", { className: s.userBoxStats, children: [
|
|
68
68
|
/* @__PURE__ */ a("div", { className: s.userDebates, children: /* @__PURE__ */ a(
|
|
69
69
|
r,
|
|
70
70
|
{
|
|
@@ -8,7 +8,7 @@ import { useConfig as d } from "../../data/config_provider/useConfig.js";
|
|
|
8
8
|
import { Avatar as l } from "../avatar/Avatar.js";
|
|
9
9
|
import { Link as n } from "../../action/link/Link.js";
|
|
10
10
|
const N = ({ userName: a, avatarUrl: t, userSlug: e }) => {
|
|
11
|
-
const i = f(), s = h(), m = d()?.
|
|
11
|
+
const i = f(), s = h(), m = d()?.layout?.disableProfileLinks === !0;
|
|
12
12
|
return /* @__PURE__ */ c("div", { className: u(r.authorContainer, "author-box"), children: [
|
|
13
13
|
m ? /* @__PURE__ */ o("div", { className: r.authorLink, children: /* @__PURE__ */ o(l, { avatarUrl: t, userName: a, size: 25 }) }) : /* @__PURE__ */ o(
|
|
14
14
|
n,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense as J, lazy as O } from "react";
|
|
3
3
|
import { useIntl as Q } from "react-intl";
|
|
4
|
-
import
|
|
4
|
+
import D from "classnames";
|
|
5
5
|
import e from "./ContentFooter.module.scss.js";
|
|
6
6
|
import { useConfig as V } from "../../data/config_provider/useConfig.js";
|
|
7
7
|
import { useAuth as X } from "../../auth/use_auth/useAuth.js";
|
|
@@ -11,92 +11,92 @@ import { useReportContent as $ } from "../use_report_content/useReportContent.js
|
|
|
11
11
|
import { useDeleteContent as tt } from "../use_delete_content/useDeleteContent.js";
|
|
12
12
|
import { useResponsive as et } from "../../hooks/use_responsive/useResponsive.js";
|
|
13
13
|
import { Link as ot } from "../../action/link/Link.js";
|
|
14
|
-
import { Icon as
|
|
14
|
+
import { Icon as c } from "../../icons/icon/Icon.js";
|
|
15
15
|
import { ShareButton as nt } from "../../share/share_button/ShareButton.js";
|
|
16
16
|
import { Dropdown as at } from "../../dialog/dropdown/Dropdown.js";
|
|
17
17
|
const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ default: o.ShareModal }))), Dt = ({
|
|
18
18
|
resource: o,
|
|
19
|
-
reportType:
|
|
20
|
-
deleteType:
|
|
21
|
-
deleteListId:
|
|
22
|
-
softDelete:
|
|
23
|
-
disabled:
|
|
19
|
+
reportType: b,
|
|
20
|
+
deleteType: I,
|
|
21
|
+
deleteListId: k,
|
|
22
|
+
softDelete: N = !1,
|
|
23
|
+
disabled: x = !1,
|
|
24
24
|
children: C,
|
|
25
25
|
enableReply: S,
|
|
26
26
|
handleReplyTo: A,
|
|
27
27
|
showActions: K = !0,
|
|
28
28
|
showShareButton: E = !0,
|
|
29
29
|
shareModal: R,
|
|
30
|
-
shareUrl:
|
|
31
|
-
shareTitle:
|
|
32
|
-
shareText:
|
|
30
|
+
shareUrl: m,
|
|
31
|
+
shareTitle: p,
|
|
32
|
+
shareText: u,
|
|
33
33
|
shareModalTitle: z,
|
|
34
|
-
showShareCode:
|
|
35
|
-
shareCode:
|
|
34
|
+
showShareCode: f,
|
|
35
|
+
shareCode: h,
|
|
36
36
|
showShareText: P,
|
|
37
37
|
enableEdition: T = !0,
|
|
38
38
|
enableDeletion: j = !0,
|
|
39
39
|
enableReport: F = !0,
|
|
40
40
|
containerClassName: B,
|
|
41
41
|
voteActionClassName: L,
|
|
42
|
-
replyRedirectUrl:
|
|
42
|
+
replyRedirectUrl: _
|
|
43
43
|
}) => {
|
|
44
|
-
const n = Q(),
|
|
44
|
+
const n = Q(), g = V(), { currentUser: d } = X(), { showModal: U } = Y(), { setInputContent: W } = Z() || {}, { reportContent: y } = $(b, o.id), { deleteContent: w } = tt(
|
|
45
45
|
o,
|
|
46
|
+
I,
|
|
46
47
|
k,
|
|
47
|
-
N
|
|
48
|
-
|
|
49
|
-
), { elementWidth: c } = et(), q = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, v = () => {
|
|
48
|
+
N
|
|
49
|
+
), { elementWidth: l } = et(), q = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, M = () => {
|
|
50
50
|
W(o);
|
|
51
51
|
}, G = () => {
|
|
52
|
-
if (o.created_at &&
|
|
52
|
+
if (o.created_at && g.actions?.editionTime) {
|
|
53
53
|
const a = new Date(
|
|
54
54
|
new Date(o.created_at).setSeconds(
|
|
55
|
-
new Date(o.created_at).getSeconds() +
|
|
55
|
+
new Date(o.created_at).getSeconds() + g.actions?.editionTime
|
|
56
56
|
)
|
|
57
57
|
);
|
|
58
58
|
return /* @__PURE__ */ new Date() < a;
|
|
59
59
|
}
|
|
60
60
|
return !0;
|
|
61
|
-
},
|
|
61
|
+
}, v = () => {
|
|
62
62
|
U(
|
|
63
63
|
/* @__PURE__ */ t(J, { fallback: null, children: /* @__PURE__ */ t(
|
|
64
64
|
rt,
|
|
65
65
|
{
|
|
66
|
-
shareUrl:
|
|
67
|
-
shareTitle:
|
|
68
|
-
shareText:
|
|
66
|
+
shareUrl: m,
|
|
67
|
+
shareTitle: p,
|
|
68
|
+
shareText: u,
|
|
69
69
|
title: z,
|
|
70
|
-
showShareCode:
|
|
71
|
-
shareCode:
|
|
70
|
+
showShareCode: f,
|
|
71
|
+
shareCode: h
|
|
72
72
|
}
|
|
73
73
|
) })
|
|
74
74
|
);
|
|
75
75
|
}, i = (a) => (s) => {
|
|
76
76
|
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), a());
|
|
77
77
|
};
|
|
78
|
-
return /* @__PURE__ */ r("div", { className:
|
|
78
|
+
return /* @__PURE__ */ r("div", { className: D(e.container, B), children: [
|
|
79
79
|
/* @__PURE__ */ t(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
onKeyDown: (a) => {
|
|
83
83
|
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), onClick());
|
|
84
84
|
},
|
|
85
|
-
className:
|
|
85
|
+
className: D(e.voteAction, L),
|
|
86
86
|
"data-tid": "action_vote_argument",
|
|
87
87
|
children: C
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
!
|
|
90
|
+
!x && S && /* @__PURE__ */ t("div", { "data-tid": "action_reply_argument", "data-testid": "reply-button", children: _ ? /* @__PURE__ */ r(
|
|
91
91
|
ot,
|
|
92
92
|
{
|
|
93
|
-
to:
|
|
93
|
+
to: _,
|
|
94
94
|
className: e.replyAction,
|
|
95
95
|
tabIndex: "0",
|
|
96
96
|
"data-testid": "action-reply-button",
|
|
97
97
|
children: [
|
|
98
98
|
/* @__PURE__ */ t(
|
|
99
|
-
|
|
99
|
+
c,
|
|
100
100
|
{
|
|
101
101
|
name: "reply",
|
|
102
102
|
"data-tid": "action_reply_argument",
|
|
@@ -104,7 +104,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
104
104
|
width: 17
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
!(
|
|
107
|
+
!(l < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
|
|
108
108
|
id: "user_content.content_footer.reply",
|
|
109
109
|
defaultMessage: "Reply"
|
|
110
110
|
}) })
|
|
@@ -119,7 +119,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
119
119
|
"data-testid": "action-reply-button",
|
|
120
120
|
children: [
|
|
121
121
|
/* @__PURE__ */ t(
|
|
122
|
-
|
|
122
|
+
c,
|
|
123
123
|
{
|
|
124
124
|
name: "reply",
|
|
125
125
|
"data-tid": "action_reply_argument",
|
|
@@ -127,7 +127,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
127
127
|
width: 17
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
|
-
!(
|
|
130
|
+
!(l < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
|
|
131
131
|
id: "user_content.content_footer.reply",
|
|
132
132
|
defaultMessage: "Reply"
|
|
133
133
|
}) })
|
|
@@ -137,12 +137,12 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
137
137
|
E && /* @__PURE__ */ t(
|
|
138
138
|
nt,
|
|
139
139
|
{
|
|
140
|
-
shareUrl:
|
|
141
|
-
shareTitle:
|
|
142
|
-
shareText:
|
|
143
|
-
showShareCode:
|
|
144
|
-
shareCode:
|
|
145
|
-
showText: !(
|
|
140
|
+
shareUrl: m,
|
|
141
|
+
shareTitle: p,
|
|
142
|
+
shareText: u,
|
|
143
|
+
showShareCode: f,
|
|
144
|
+
shareCode: h,
|
|
145
|
+
showText: !(l < 768) && P,
|
|
146
146
|
iconSize: 17,
|
|
147
147
|
popoverPosition: "top"
|
|
148
148
|
}
|
|
@@ -163,7 +163,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
163
163
|
verticalPosition: "top",
|
|
164
164
|
children: [
|
|
165
165
|
/* @__PURE__ */ t(
|
|
166
|
-
|
|
166
|
+
c,
|
|
167
167
|
{
|
|
168
168
|
name: "ellipsis",
|
|
169
169
|
width: 17,
|
|
@@ -177,14 +177,14 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
177
177
|
),
|
|
178
178
|
/* @__PURE__ */ r("div", { children: [
|
|
179
179
|
q() && /* @__PURE__ */ r(H, { children: [
|
|
180
|
-
|
|
180
|
+
T && G() && /* @__PURE__ */ t(
|
|
181
181
|
"div",
|
|
182
182
|
{
|
|
183
183
|
"data-tid": "action_edit_argument",
|
|
184
184
|
className: e.dropdownItem,
|
|
185
185
|
tabIndex: "0",
|
|
186
|
-
onClick:
|
|
187
|
-
onKeyDown: i(
|
|
186
|
+
onClick: M,
|
|
187
|
+
onKeyDown: i(M),
|
|
188
188
|
children: n.formatMessage({
|
|
189
189
|
id: "user_content.content_footer.update",
|
|
190
190
|
defaultMessage: "Update"
|
|
@@ -197,8 +197,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
197
197
|
"data-tid": "action_delete_argument",
|
|
198
198
|
className: e.dropdownItem,
|
|
199
199
|
tabIndex: "0",
|
|
200
|
-
onClick:
|
|
201
|
-
onKeyDown: i(
|
|
200
|
+
onClick: w,
|
|
201
|
+
onKeyDown: i(w),
|
|
202
202
|
children: n.formatMessage({
|
|
203
203
|
id: "user_content.content_footer.delete",
|
|
204
204
|
defaultMessage: "Delete"
|
|
@@ -212,9 +212,9 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
212
212
|
"data-tid": "action_report_argument",
|
|
213
213
|
className: e.dropdownItem,
|
|
214
214
|
tabIndex: "0",
|
|
215
|
-
onClick:
|
|
215
|
+
onClick: y,
|
|
216
216
|
"data-testid": "report-content",
|
|
217
|
-
onKeyDown: i(
|
|
217
|
+
onKeyDown: i(y),
|
|
218
218
|
children: n.formatMessage({
|
|
219
219
|
id: "user_content.content_footer.report",
|
|
220
220
|
defaultMessage: "Report"
|
|
@@ -227,8 +227,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
|
|
|
227
227
|
"data-tid": "action_share_argument",
|
|
228
228
|
className: e.dropdownItem,
|
|
229
229
|
tabIndex: "0",
|
|
230
|
-
onClick:
|
|
231
|
-
onKeyDown: i(
|
|
230
|
+
onClick: v,
|
|
231
|
+
onKeyDown: i(v),
|
|
232
232
|
children: n.formatMessage({
|
|
233
233
|
id: "user_content.content_footer.share",
|
|
234
234
|
defaultMessage: "Share"
|