@logora/debate 0.4.89 → 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
|
};
|