@logora/debate 0.4.35 → 0.4.36
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.
|
@@ -3,46 +3,47 @@ import N from "classnames";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import { useIntl as B, FormattedMessage as w } from "react-intl";
|
|
5
5
|
import a from "./AuthorBox.module.scss.js";
|
|
6
|
-
import { useRoutes as
|
|
6
|
+
import { useRoutes as _ } from "../../data/config_provider/useRoutes.js";
|
|
7
|
+
import { useConfig as k } from "../../data/config_provider/useConfig.js";
|
|
7
8
|
import { Avatar as g } from "../avatar/Avatar.js";
|
|
8
9
|
import { Link as v } from "../../action/link/Link.js";
|
|
9
|
-
import { Icon as
|
|
10
|
+
import { Icon as P } from "../../icons/icon/Icon.js";
|
|
10
11
|
import { getLocaleIcon as S } from "../../util/lang_emojis/langEmojis.js";
|
|
11
|
-
const
|
|
12
|
+
const R = ({
|
|
12
13
|
fullName: i,
|
|
13
14
|
slug: s,
|
|
14
15
|
avatarUrl: c,
|
|
15
|
-
lastActivity:
|
|
16
|
-
showBadge:
|
|
16
|
+
lastActivity: b,
|
|
17
|
+
showBadge: M = !1,
|
|
17
18
|
points: n = 0,
|
|
18
19
|
eloquenceTitle: m,
|
|
19
20
|
occupation: d,
|
|
20
21
|
disableLinks: l = !1,
|
|
21
22
|
isDeleted: o = !1,
|
|
22
|
-
language:
|
|
23
|
-
languageDialect:
|
|
23
|
+
language: u = null,
|
|
24
|
+
languageDialect: h = null
|
|
24
25
|
}) => {
|
|
25
|
-
const t = B(),
|
|
26
|
+
const t = B(), f = _(), L = k()?.actions?.disableProfileLinks === !0, p = new Date(b) > Date.now();
|
|
26
27
|
return /* @__PURE__ */ r("div", { className: N(a.authorBox, "author-box"), children: [
|
|
27
|
-
!s || l || o ? /* @__PURE__ */ e(
|
|
28
|
+
!s || l || L || o ? /* @__PURE__ */ e(
|
|
28
29
|
g,
|
|
29
30
|
{
|
|
30
31
|
avatarUrl: o ? null : c,
|
|
31
32
|
userName: i,
|
|
32
|
-
isOnline:
|
|
33
|
+
isOnline: p,
|
|
33
34
|
size: 48
|
|
34
35
|
}
|
|
35
36
|
) : /* @__PURE__ */ e(
|
|
36
37
|
v,
|
|
37
38
|
{
|
|
38
|
-
to:
|
|
39
|
+
to: f.userShowLocation.toUrl({ userSlug: s }),
|
|
39
40
|
className: a.authorLink,
|
|
40
41
|
children: /* @__PURE__ */ e(
|
|
41
42
|
g,
|
|
42
43
|
{
|
|
43
44
|
avatarUrl: c,
|
|
44
45
|
userName: i,
|
|
45
|
-
isOnline:
|
|
46
|
+
isOnline: p,
|
|
46
47
|
size: 48
|
|
47
48
|
}
|
|
48
49
|
)
|
|
@@ -62,15 +63,15 @@ const q = ({
|
|
|
62
63
|
defaultMessage: "Deleted"
|
|
63
64
|
}) : i
|
|
64
65
|
}
|
|
65
|
-
) : /* @__PURE__ */ e("div", { className: a.authorLink, children: /* @__PURE__ */ e(v, { to:
|
|
66
|
-
|
|
67
|
-
/* @__PURE__ */ e(
|
|
66
|
+
) : /* @__PURE__ */ e("div", { className: a.authorLink, children: /* @__PURE__ */ e(v, { to: f.userShowLocation.toUrl({ userSlug: s }), children: i }) }),
|
|
67
|
+
M && !o && /* @__PURE__ */ r("div", { className: a.expertContainer, children: [
|
|
68
|
+
/* @__PURE__ */ e(P, { name: "expertBadge", width: 14, height: 14 }),
|
|
68
69
|
/* @__PURE__ */ e("span", { className: a.expertBadge, children: t.formatMessage({
|
|
69
70
|
id: "user.author_box.expert",
|
|
70
71
|
defaultMessage: "Journalist"
|
|
71
72
|
}) })
|
|
72
73
|
] }),
|
|
73
|
-
|
|
74
|
+
u && h && /* @__PURE__ */ e("div", { className: a.languageContainer, children: S(u, h) })
|
|
74
75
|
] }) }),
|
|
75
76
|
!o && /* @__PURE__ */ r(x, { children: [
|
|
76
77
|
/* @__PURE__ */ r("div", { className: a.authorPointsBox, children: [
|
|
@@ -114,5 +115,5 @@ const q = ({
|
|
|
114
115
|
] });
|
|
115
116
|
};
|
|
116
117
|
export {
|
|
117
|
-
|
|
118
|
+
R as AuthorBox
|
|
118
119
|
};
|
|
@@ -1,73 +1,83 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import c from "classnames";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { useRoutes as
|
|
7
|
-
import {
|
|
8
|
-
import { Avatar as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { useIntl as d, FormattedMessage as r } from "react-intl";
|
|
5
|
+
import s from "./UserBox.module.scss.js";
|
|
6
|
+
import { useRoutes as m } from "../../data/config_provider/useRoutes.js";
|
|
7
|
+
import { useConfig as _ } from "../../data/config_provider/useConfig.js";
|
|
8
|
+
import { Avatar as l } from "../avatar/Avatar.js";
|
|
9
|
+
import { Link as i } from "../../action/link/Link.js";
|
|
10
|
+
const B = ({ user: e }) => {
|
|
11
|
+
const n = d(), t = m(), u = _()?.actions?.disableProfileLinks === !0;
|
|
12
|
+
return /* @__PURE__ */ o("div", { className: c(s.userBox, "author-box"), children: [
|
|
13
|
+
/* @__PURE__ */ a("div", { className: s.userBoxHeader, children: u ? /* @__PURE__ */ a(
|
|
14
|
+
l,
|
|
14
15
|
{
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
"data-tid": "action_view_user_image",
|
|
17
|
+
userName: e.full_name,
|
|
18
|
+
avatarUrl: e.image_url,
|
|
19
|
+
isOnline: new Date(e.last_activity) > Date.now(),
|
|
20
|
+
size: 60
|
|
21
|
+
}
|
|
22
|
+
) : /* @__PURE__ */ a(
|
|
23
|
+
i,
|
|
24
|
+
{
|
|
25
|
+
to: t.userShowLocation.toUrl({ userSlug: e.hash_id }),
|
|
26
|
+
"aria-label": n.formatMessage({
|
|
17
27
|
id: "user.user_box.author_link.aria_label",
|
|
18
28
|
defaultMessage: "View profile"
|
|
19
29
|
}),
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
|
|
30
|
+
children: /* @__PURE__ */ a(
|
|
31
|
+
l,
|
|
22
32
|
{
|
|
23
33
|
"data-tid": "action_view_user_image",
|
|
24
|
-
userName:
|
|
25
|
-
avatarUrl:
|
|
26
|
-
isOnline: new Date(
|
|
34
|
+
userName: e.full_name,
|
|
35
|
+
avatarUrl: e.image_url,
|
|
36
|
+
isOnline: new Date(e.last_activity) > Date.now(),
|
|
27
37
|
size: 60
|
|
28
38
|
}
|
|
29
39
|
)
|
|
30
40
|
}
|
|
31
41
|
) }),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ o("div", { className: s.userBoxDescription, children: [
|
|
43
|
+
/* @__PURE__ */ a(i, { to: t.userShowLocation.toUrl({ userSlug: e.hash_id }), children: /* @__PURE__ */ a(
|
|
34
44
|
"div",
|
|
35
45
|
{
|
|
36
46
|
"data-tid": "action_view_user_name",
|
|
37
|
-
className:
|
|
38
|
-
title:
|
|
39
|
-
children:
|
|
47
|
+
className: s.userBoxName,
|
|
48
|
+
title: e.full_name,
|
|
49
|
+
children: e.full_name
|
|
40
50
|
}
|
|
41
51
|
) }),
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
e.role === "contributor" && /* @__PURE__ */ a(
|
|
53
|
+
i,
|
|
44
54
|
{
|
|
45
|
-
to:
|
|
55
|
+
to: t.userShowLocation.toUrl({ userSlug: e.hash_id }),
|
|
46
56
|
hash: "activity",
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
|
|
57
|
+
children: /* @__PURE__ */ a("div", { className: s.userBoxPoints, children: /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(
|
|
58
|
+
r,
|
|
49
59
|
{
|
|
50
60
|
id: "user.user_box.points",
|
|
51
|
-
values: { count:
|
|
61
|
+
values: { count: e.points },
|
|
52
62
|
defaultMessage: "{count} points"
|
|
53
63
|
}
|
|
54
64
|
) }) })
|
|
55
65
|
}
|
|
56
66
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
67
|
+
/* @__PURE__ */ a(i, { to: t.userShowLocation.toUrl({ userSlug: e.hash_id }), children: /* @__PURE__ */ o("div", { className: s.userBoxStats, children: [
|
|
68
|
+
/* @__PURE__ */ a("div", { className: s.userDebates, children: /* @__PURE__ */ a(
|
|
69
|
+
r,
|
|
60
70
|
{
|
|
61
71
|
id: "user.user_box.user_arguments",
|
|
62
|
-
values: { count:
|
|
72
|
+
values: { count: e.messages_count },
|
|
63
73
|
defaultMessage: "{count} arguments"
|
|
64
74
|
}
|
|
65
75
|
) }),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
76
|
+
/* @__PURE__ */ a("div", { className: s.userVotes, children: /* @__PURE__ */ a(
|
|
77
|
+
r,
|
|
68
78
|
{
|
|
69
79
|
id: "user.user_box.user_votes",
|
|
70
|
-
values: { count:
|
|
80
|
+
values: { count: e.upvotes },
|
|
71
81
|
defaultMessage: "{count} votes"
|
|
72
82
|
}
|
|
73
83
|
) })
|
|
@@ -76,5 +86,5 @@ const N = ({ user: s }) => {
|
|
|
76
86
|
] });
|
|
77
87
|
};
|
|
78
88
|
export {
|
|
79
|
-
|
|
89
|
+
B as UserBox
|
|
80
90
|
};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import u from "classnames";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useIntl as
|
|
4
|
+
import { useIntl as f } from "react-intl";
|
|
5
5
|
import r from "./UserBoxSmall.module.scss.js";
|
|
6
|
-
import { useRoutes as
|
|
7
|
-
import {
|
|
8
|
-
import { Avatar as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { useRoutes as h } from "../../data/config_provider/useRoutes.js";
|
|
7
|
+
import { useConfig as d } from "../../data/config_provider/useConfig.js";
|
|
8
|
+
import { Avatar as l } from "../avatar/Avatar.js";
|
|
9
|
+
import { Link as n } from "../../action/link/Link.js";
|
|
10
|
+
const N = ({ userName: a, avatarUrl: t, userSlug: e }) => {
|
|
11
|
+
const i = f(), s = h(), m = d()?.actions?.disableProfileLinks === !0;
|
|
12
|
+
return /* @__PURE__ */ c("div", { className: u(r.authorContainer, "author-box"), children: [
|
|
13
|
+
m ? /* @__PURE__ */ o("div", { className: r.authorLink, children: /* @__PURE__ */ o(l, { avatarUrl: t, userName: a, size: 25 }) }) : /* @__PURE__ */ o(
|
|
14
|
+
n,
|
|
14
15
|
{
|
|
15
|
-
to: s.userShowLocation.toUrl({ userSlug:
|
|
16
|
+
to: s.userShowLocation.toUrl({ userSlug: e }),
|
|
16
17
|
className: r.authorLink,
|
|
17
18
|
target: "_top",
|
|
18
|
-
"aria-label":
|
|
19
|
+
"aria-label": i.formatMessage({
|
|
19
20
|
id: "user.user_box_small.author_link.aria_label",
|
|
20
21
|
defaultMessage: "View profile"
|
|
21
22
|
}),
|
|
22
|
-
children: /* @__PURE__ */ o(
|
|
23
|
+
children: /* @__PURE__ */ o(l, { avatarUrl: t, userName: a, size: 25 })
|
|
23
24
|
}
|
|
24
25
|
),
|
|
25
26
|
/* @__PURE__ */ o("div", { className: r.authorName, children: /* @__PURE__ */ o(
|
|
26
|
-
|
|
27
|
+
n,
|
|
27
28
|
{
|
|
28
|
-
to: s.userShowLocation.toUrl({ userSlug:
|
|
29
|
+
to: s.userShowLocation.toUrl({ userSlug: e }),
|
|
29
30
|
className: r.authorLink,
|
|
30
31
|
target: "_top",
|
|
31
|
-
"aria-label":
|
|
32
|
+
"aria-label": i.formatMessage({
|
|
32
33
|
id: "user.user_box_small.author_link.aria_label",
|
|
33
34
|
defaultMessage: "View profile"
|
|
34
35
|
}),
|
|
@@ -38,5 +39,5 @@ const L = ({ userName: a, avatarUrl: l, userSlug: t }) => {
|
|
|
38
39
|
] });
|
|
39
40
|
};
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
N as UserBoxSmall
|
|
42
43
|
};
|