@logora/debate 0.4.88 → 0.4.90
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.
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { useRoutes as
|
|
7
|
-
import { useResponsive as
|
|
8
|
-
import { Link as
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { TranslatedContent as
|
|
11
|
-
import { Tooltip as
|
|
12
|
-
import { ProgressBar as
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */ s("div", { className:
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
1
|
+
import { jsx as o, Fragment as f, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import a from "classnames";
|
|
3
|
+
import { useMemo as N } from "react";
|
|
4
|
+
import { useIntl as _, FormattedMessage as l } from "react-intl";
|
|
5
|
+
import e from "./ConsultationBox.module.scss.js";
|
|
6
|
+
import { useRoutes as v } from "../../data/config_provider/useRoutes.js";
|
|
7
|
+
import { useResponsive as x } from "../../hooks/use_responsive/useResponsive.js";
|
|
8
|
+
import { Link as c } from "../../action/link/Link.js";
|
|
9
|
+
import { Icon as d } from "../../icons/icon/Icon.js";
|
|
10
|
+
import { TranslatedContent as M } from "../../translation/translated_content/TranslatedContent.js";
|
|
11
|
+
import { Tooltip as h } from "../../dialog/tooltip/Tooltip.js";
|
|
12
|
+
import { ProgressBar as b } from "../../progress/progress_bar/ProgressBar.js";
|
|
13
|
+
const R = ({ consultation: t, showVoteProgress: p = !0 }) => {
|
|
14
|
+
const n = _(), m = N(() => /* @__PURE__ */ new Date()), u = new Date(t.ends_at), i = t.ends_at && u < m || t.is_expired === !0, g = !i && t.is_active === !1, r = v(), { isMobile: S } = x();
|
|
15
|
+
return /* @__PURE__ */ o(f, { children: /* @__PURE__ */ s("div", { className: e.container, children: [
|
|
16
|
+
/* @__PURE__ */ s("div", { className: e.consultationImageBox, children: [
|
|
17
|
+
/* @__PURE__ */ o(
|
|
18
|
+
c,
|
|
19
19
|
{
|
|
20
|
-
to:
|
|
21
|
-
consultationSlug:
|
|
20
|
+
to: r.consultationShowLocation.toUrl({
|
|
21
|
+
consultationSlug: t.slug
|
|
22
22
|
}),
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ o(
|
|
24
24
|
"img",
|
|
25
25
|
{
|
|
26
26
|
loading: "lazy",
|
|
27
|
-
className:
|
|
28
|
-
src:
|
|
27
|
+
className: e.consultationImage,
|
|
28
|
+
src: t.image_url,
|
|
29
29
|
height: 200,
|
|
30
|
-
alt:
|
|
30
|
+
alt: n.formatMessage({
|
|
31
31
|
id: "consultation.consultation_box.alt",
|
|
32
32
|
defaultMessage: "Presentation image for the consultation"
|
|
33
33
|
})
|
|
@@ -35,58 +35,65 @@ const F = ({ consultation: e, showVoteProgress: g = !0 }) => {
|
|
|
35
35
|
)
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
i && /* @__PURE__ */ o("div", { className: a(e.consultationTime, e.ended), children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
|
|
39
|
+
l,
|
|
40
40
|
{
|
|
41
41
|
id: "consultation.consultation_box.consultation_ended",
|
|
42
42
|
defaultMessage: "Consultation ended"
|
|
43
43
|
}
|
|
44
44
|
) }) }),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
g && /* @__PURE__ */ o("div", { className: a(e.consultationTime, e.ended), children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
|
|
46
|
+
l,
|
|
47
|
+
{
|
|
48
|
+
id: "consultation.consultation_box.consultation_suspended",
|
|
49
|
+
defaultMessage: "Consultation suspended"
|
|
50
|
+
}
|
|
51
|
+
) }) }),
|
|
52
|
+
t.author && t.author.is_admin === !1 && /* @__PURE__ */ s("div", { className: e.consultationSuggestion, children: [
|
|
53
|
+
/* @__PURE__ */ o(d, { name: "suggestion", width: 15, height: 15 }),
|
|
54
|
+
/* @__PURE__ */ s("span", { className: e.authorSuggestion, children: [
|
|
55
|
+
/* @__PURE__ */ o(
|
|
56
|
+
l,
|
|
50
57
|
{
|
|
51
58
|
id: "consultation.consultation_box.suggestion_author_short",
|
|
52
59
|
defaultMessage: "Suggested by"
|
|
53
60
|
}
|
|
54
61
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ o("span", { className: e.authorName, children: t.author.full_name })
|
|
56
63
|
] })
|
|
57
64
|
] })
|
|
58
65
|
] }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
66
|
+
/* @__PURE__ */ o(
|
|
67
|
+
c,
|
|
61
68
|
{
|
|
62
|
-
to:
|
|
63
|
-
consultationSlug:
|
|
69
|
+
to: r.consultationShowLocation.toUrl({
|
|
70
|
+
consultationSlug: t.slug
|
|
64
71
|
}),
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
|
|
72
|
+
children: /* @__PURE__ */ o("div", { className: e.consultationTitle, children: /* @__PURE__ */ o(
|
|
73
|
+
M,
|
|
67
74
|
{
|
|
68
|
-
originalContent:
|
|
69
|
-
originalLanguage:
|
|
75
|
+
originalContent: t.title,
|
|
76
|
+
originalLanguage: t.language,
|
|
70
77
|
targetField: "title",
|
|
71
|
-
translations:
|
|
78
|
+
translations: t.translation_entries
|
|
72
79
|
}
|
|
73
80
|
) })
|
|
74
81
|
}
|
|
75
82
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
83
|
+
/* @__PURE__ */ o(
|
|
84
|
+
c,
|
|
78
85
|
{
|
|
79
|
-
to:
|
|
80
|
-
consultationSlug:
|
|
86
|
+
to: r.consultationShowLocation.toUrl({
|
|
87
|
+
consultationSlug: t.slug
|
|
81
88
|
})
|
|
82
89
|
}
|
|
83
90
|
),
|
|
84
|
-
/* @__PURE__ */ s("div", { className:
|
|
85
|
-
/* @__PURE__ */ s("div", { className:
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
91
|
+
/* @__PURE__ */ s("div", { className: e.consultationInformations, children: [
|
|
92
|
+
/* @__PURE__ */ s("div", { className: e.consultationLeft, children: [
|
|
93
|
+
/* @__PURE__ */ o(
|
|
94
|
+
h,
|
|
88
95
|
{
|
|
89
|
-
text:
|
|
96
|
+
text: n.formatMessage({
|
|
90
97
|
id: "info.votes_count",
|
|
91
98
|
defaultMessage: "Number of votes"
|
|
92
99
|
}),
|
|
@@ -94,47 +101,47 @@ const F = ({ consultation: e, showVoteProgress: g = !0 }) => {
|
|
|
94
101
|
children: /* @__PURE__ */ s(
|
|
95
102
|
"div",
|
|
96
103
|
{
|
|
97
|
-
className:
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
className: a(
|
|
105
|
+
e.consultationGroupInformation,
|
|
106
|
+
e.consultationGroupRight
|
|
100
107
|
),
|
|
101
108
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ o("span", { className: e.consultationTextInformation, children: t.total_votes }),
|
|
110
|
+
/* @__PURE__ */ o(d, { name: "votebox", width: 15, height: 20, className: e.iconVote })
|
|
104
111
|
]
|
|
105
112
|
}
|
|
106
113
|
)
|
|
107
114
|
}
|
|
108
115
|
),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
116
|
+
/* @__PURE__ */ o(
|
|
117
|
+
h,
|
|
111
118
|
{
|
|
112
|
-
text:
|
|
119
|
+
text: n.formatMessage({
|
|
113
120
|
id: "info.proposals_count",
|
|
114
121
|
defaultMessage: "Number of proposals"
|
|
115
122
|
}),
|
|
116
123
|
position: "top",
|
|
117
|
-
children: /* @__PURE__ */ s("div", { className:
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ s("div", { className: e.consultationGroupInformation, children: [
|
|
125
|
+
/* @__PURE__ */ o("span", { className: e.consultationTextInformation, children: t.proposals_count }),
|
|
126
|
+
/* @__PURE__ */ o(d, { name: "chat", width: 15, height: 20, className: e.iconChat })
|
|
120
127
|
] })
|
|
121
128
|
}
|
|
122
129
|
)
|
|
123
130
|
] }),
|
|
124
|
-
|
|
131
|
+
p && t.vote_goal > 0 && !i && !g && u > m && /* @__PURE__ */ o(
|
|
125
132
|
"div",
|
|
126
133
|
{
|
|
127
|
-
className:
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
className: a(
|
|
135
|
+
e.consultationGroupInformation,
|
|
136
|
+
e.progressBarContainer
|
|
130
137
|
),
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
-
|
|
138
|
+
children: /* @__PURE__ */ o(
|
|
139
|
+
b,
|
|
133
140
|
{
|
|
134
|
-
className:
|
|
135
|
-
innerClassName:
|
|
136
|
-
progress:
|
|
137
|
-
goal:
|
|
141
|
+
className: e.progress,
|
|
142
|
+
innerClassName: e.bar,
|
|
143
|
+
progress: t.total_votes,
|
|
144
|
+
goal: t.vote_goal,
|
|
138
145
|
showProgressSubtitle: !0,
|
|
139
146
|
progressUnit: "votes"
|
|
140
147
|
}
|
|
@@ -145,5 +152,5 @@ const F = ({ consultation: e, showVoteProgress: g = !0 }) => {
|
|
|
145
152
|
] }) });
|
|
146
153
|
};
|
|
147
154
|
export {
|
|
148
|
-
|
|
155
|
+
R as ConsultationBox
|
|
149
156
|
};
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
const
|
|
3
|
+
const e = (h) => /* @__PURE__ */ t(
|
|
4
4
|
"svg",
|
|
5
5
|
{
|
|
6
6
|
width: "24",
|
|
7
7
|
height: "24",
|
|
8
|
-
viewBox: "0
|
|
8
|
+
viewBox: "0 -960 960 960",
|
|
9
9
|
fill: "none",
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
-
...
|
|
12
|
-
children: /* @__PURE__ */
|
|
13
|
-
"path",
|
|
14
|
-
{
|
|
15
|
-
fillRule: "evenodd",
|
|
16
|
-
clipRule: "evenodd",
|
|
17
|
-
d: "M19.06 3.58988L20.41 4.93988C21.2 5.71988 21.2 6.98988 20.41 7.76988L7.18 20.9999H3V16.8199L13.4 6.40988L16.23 3.58988C17.01 2.80988 18.28 2.80988 19.06 3.58988ZM5 18.9999L6.41 19.0599L16.23 9.22988L14.82 7.81988L5 17.6399V18.9999Z"
|
|
18
|
-
}
|
|
19
|
-
)
|
|
11
|
+
...h,
|
|
12
|
+
children: /* @__PURE__ */ t("path", { d: "M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z" })
|
|
20
13
|
}
|
|
21
14
|
);
|
|
22
15
|
export {
|
|
23
|
-
|
|
16
|
+
e as Reply
|
|
24
17
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
const
|
|
3
|
+
const h = (q) => /* @__PURE__ */ t(
|
|
4
4
|
"svg",
|
|
5
5
|
{
|
|
6
6
|
width: "24",
|
|
7
7
|
height: "24",
|
|
8
|
-
viewBox: "0
|
|
8
|
+
viewBox: "0 -960 960 960",
|
|
9
9
|
fill: "none",
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
-
...
|
|
12
|
-
children: /* @__PURE__ */ t("path", { d: "
|
|
11
|
+
...q,
|
|
12
|
+
children: /* @__PURE__ */ t("path", { d: "M680-80q-50 0-85-35t-35-85q0-6 3-28L282-392q-16 15-37 23.5t-45 8.5q-50 0-85-35t-35-85q0-50 35-85t85-35q24 0 45 8.5t37 23.5l281-164q-2-7-2.5-13.5T560-760q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35q-24 0-45-8.5T598-672L317-508q2 7 2.5 13.5t.5 14.5q0 8-.5 14.5T317-452l281 164q16-15 37-23.5t45-8.5q50 0 85 35t35 85q0 50-35 85t-85 35Zm0-80q17 0 28.5-11.5T720-200q0-17-11.5-28.5T680-240q-17 0-28.5 11.5T640-200q0 17 11.5 28.5T680-160ZM200-440q17 0 28.5-11.5T240-480q0-17-11.5-28.5T200-520q-17 0-28.5 11.5T160-480q0 17 11.5 28.5T200-440Zm508.5-291.5Q720-743 720-760t-11.5-28.5Q697-800 680-800t-28.5 11.5Q640-777 640-760t11.5 28.5Q663-720 680-720t28.5-11.5ZM680-200ZM200-480Zm480-280Z" })
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
h as Share
|
|
17
17
|
};
|