@logora/debate 0.4.35 → 0.4.37

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.
@@ -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(), o = M(), { pathname: u } = _(), { isLoggedIn: h, currentUser: m } = S(), p = b(), g = k?.() || {}, { isMobile: f, elementWidth: v } = g, L = f && v <= 576 && !s.isDrawer, e = (N) => !!x(N, u), w = () => {
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(o.indexLocation.path) || e(o.debateShowLocation.path) || e(o.rootLocation.path || "/")
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(o.indexLocation.path) || e(o.debateShowLocation.path) || e(o.rootLocation.path || "/")
37
+ [t.activeItem]: o(e.indexLocation.path) || o(e.debateShowLocation.path) || o(e.rootLocation.path || "/")
38
38
  }),
39
- to: o.indexLocation.toUrl(),
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(o.consultationIndexLocation.path) || e(o.consultationShowLocation.path)
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(o.consultationIndexLocation.path) || e(o.consultationShowLocation.path)
66
+ [t.activeItem]: o(e.consultationIndexLocation.path) || o(e.consultationShowLocation.path)
67
67
  }),
68
- to: o.consultationIndexLocation.toUrl(),
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(o.suggestionLocation.path)
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(o.suggestionLocation.path)
95
+ [t.activeItem]: o(e.suggestionLocation.path)
96
96
  }),
97
- to: o.suggestionLocation.toUrl(),
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(o.userShowLocation.path) || e(o.userEditLocation.path)
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(o.userShowLocation.path) || e(o.userEditLocation.path)
124
+ [t.activeItem]: o(e.userShowLocation.path) || o(e.userEditLocation.path)
125
125
  }),
126
- to: o.userShowLocation.toUrl({
126
+ to: e.userShowLocation.toUrl({
127
127
  userSlug: m.hash_id
128
128
  }),
129
129
  "data-tid": "view_user_profile",
@@ -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 L } from "../../data/config_provider/useRoutes.js";
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 _ } from "../../icons/icon/Icon.js";
10
+ import { Icon as P } from "../../icons/icon/Icon.js";
10
11
  import { getLocaleIcon as S } from "../../util/lang_emojis/langEmojis.js";
11
- const q = ({
12
+ const R = ({
12
13
  fullName: i,
13
14
  slug: s,
14
15
  avatarUrl: c,
15
- lastActivity: M,
16
- showBadge: b = !1,
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: h = null,
23
- languageDialect: u = null
23
+ language: u = null,
24
+ languageDialect: h = null
24
25
  }) => {
25
- const t = B(), p = L(), f = new Date(M) > Date.now();
26
+ const t = B(), f = _(), L = k()?.layout?.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: f,
33
+ isOnline: p,
33
34
  size: 48
34
35
  }
35
36
  ) : /* @__PURE__ */ e(
36
37
  v,
37
38
  {
38
- to: p.userShowLocation.toUrl({ userSlug: s }),
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: f,
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: p.userShowLocation.toUrl({ userSlug: s }), children: i }) }),
66
- b && !o && /* @__PURE__ */ r("div", { className: a.expertContainer, children: [
67
- /* @__PURE__ */ e(_, { name: "expertBadge", width: 14, height: 14 }),
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
- h && u && /* @__PURE__ */ e("div", { className: a.languageContainer, children: S(h, u) })
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
- q as AuthorBox
118
+ R as AuthorBox
118
119
  };
@@ -1,73 +1,83 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import n from "classnames";
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import c from "classnames";
3
3
  import "react";
4
- import { useIntl as u, FormattedMessage as i } from "react-intl";
5
- import o from "./UserBox.module.scss.js";
6
- import { useRoutes as c } from "../../data/config_provider/useRoutes.js";
7
- import { Link as t } from "../../action/link/Link.js";
8
- import { Avatar as d } from "../avatar/Avatar.js";
9
- const N = ({ user: s }) => {
10
- const l = u(), a = c();
11
- return /* @__PURE__ */ r("div", { className: n(o.userBox, "author-box"), children: [
12
- /* @__PURE__ */ e("div", { className: o.userBoxHeader, children: /* @__PURE__ */ e(
13
- t,
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 o } from "../../action/link/Link.js";
10
+ const B = ({ user: e }) => {
11
+ const n = d(), t = m(), u = _()?.layout?.disableProfileLinks === !0;
12
+ return /* @__PURE__ */ i("div", { className: c(s.userBox, "author-box"), children: [
13
+ /* @__PURE__ */ a("div", { className: s.userBoxHeader, children: u ? /* @__PURE__ */ a(
14
+ l,
14
15
  {
15
- to: a.userShowLocation.toUrl({ userSlug: s.hash_id }),
16
- "aria-label": l.formatMessage({
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
+ o,
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__ */ e(
21
- d,
30
+ children: /* @__PURE__ */ a(
31
+ l,
22
32
  {
23
33
  "data-tid": "action_view_user_image",
24
- userName: s.full_name,
25
- avatarUrl: s.image_url,
26
- isOnline: new Date(s.last_activity) > Date.now(),
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__ */ r("div", { className: o.userBoxDescription, children: [
33
- /* @__PURE__ */ e(t, { to: a.userShowLocation.toUrl({ userSlug: s.hash_id }), children: /* @__PURE__ */ e(
42
+ /* @__PURE__ */ i("div", { className: s.userBoxDescription, children: [
43
+ /* @__PURE__ */ a(o, { 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: o.userBoxName,
38
- title: s.full_name,
39
- children: s.full_name
47
+ className: s.userBoxName,
48
+ title: e.full_name,
49
+ children: e.full_name
40
50
  }
41
51
  ) }),
42
- s.role === "contributor" && /* @__PURE__ */ e(
43
- t,
52
+ e.role === "contributor" && /* @__PURE__ */ a(
53
+ o,
44
54
  {
45
- to: a.userShowLocation.toUrl({ userSlug: s.hash_id }),
55
+ to: t.userShowLocation.toUrl({ userSlug: e.hash_id }),
46
56
  hash: "activity",
47
- children: /* @__PURE__ */ e("div", { className: o.userBoxPoints, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
48
- i,
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: s.points },
61
+ values: { count: e.points },
52
62
  defaultMessage: "{count} points"
53
63
  }
54
64
  ) }) })
55
65
  }
56
66
  ),
57
- /* @__PURE__ */ e(t, { to: a.userShowLocation.toUrl({ userSlug: s.hash_id }), children: /* @__PURE__ */ r("div", { className: o.userBoxStats, children: [
58
- /* @__PURE__ */ e("div", { className: o.userDebates, children: /* @__PURE__ */ e(
59
- i,
67
+ /* @__PURE__ */ a(o, { to: t.userShowLocation.toUrl({ userSlug: e.hash_id }), children: /* @__PURE__ */ i("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: s.messages_count },
72
+ values: { count: e.messages_count },
63
73
  defaultMessage: "{count} arguments"
64
74
  }
65
75
  ) }),
66
- /* @__PURE__ */ e("div", { className: o.userVotes, children: /* @__PURE__ */ e(
67
- i,
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: s.upvotes },
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
- N as UserBox
89
+ B as UserBox
80
90
  };
@@ -1,34 +1,35 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import n from "classnames";
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 u } from "react-intl";
4
+ import { useIntl as f } from "react-intl";
5
5
  import r from "./UserBoxSmall.module.scss.js";
6
- import { useRoutes as c } from "../../data/config_provider/useRoutes.js";
7
- import { Link as i } from "../../action/link/Link.js";
8
- import { Avatar as f } from "../avatar/Avatar.js";
9
- const L = ({ userName: a, avatarUrl: l, userSlug: t }) => {
10
- const e = u(), s = c();
11
- return /* @__PURE__ */ m("div", { className: n(r.authorContainer, "author-box"), children: [
12
- /* @__PURE__ */ o(
13
- i,
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()?.layout?.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: t }),
16
+ to: s.userShowLocation.toUrl({ userSlug: e }),
16
17
  className: r.authorLink,
17
18
  target: "_top",
18
- "aria-label": e.formatMessage({
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(f, { avatarUrl: l, userName: a, size: 25 })
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
- i,
27
+ n,
27
28
  {
28
- to: s.userShowLocation.toUrl({ userSlug: t }),
29
+ to: s.userShowLocation.toUrl({ userSlug: e }),
29
30
  className: r.authorLink,
30
31
  target: "_top",
31
- "aria-label": e.formatMessage({
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
- L as UserBoxSmall
42
+ N as UserBoxSmall
42
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.35",
3
+ "version": "0.4.37",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",