@logora/debate 0.4.90 → 0.4.91
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 e, Fragment as p, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import { useMemo as f } from "react";
|
|
4
|
+
import { useIntl as N, FormattedMessage as u } from "react-intl";
|
|
5
|
+
import o from "./ConsultationBox.module.scss.js";
|
|
6
|
+
import { useRoutes as _ } from "../../data/config_provider/useRoutes.js";
|
|
7
|
+
import { useResponsive as v } from "../../hooks/use_responsive/useResponsive.js";
|
|
8
|
+
import { Link as r } from "../../action/link/Link.js";
|
|
9
|
+
import { Icon as l } from "../../icons/icon/Icon.js";
|
|
10
|
+
import { TranslatedContent as x } from "../../translation/translated_content/TranslatedContent.js";
|
|
11
|
+
import { Tooltip as g } from "../../dialog/tooltip/Tooltip.js";
|
|
12
|
+
import { ProgressBar as M } from "../../progress/progress_bar/ProgressBar.js";
|
|
13
|
+
const P = ({ consultation: t, showVoteProgress: h = !0 }) => {
|
|
14
|
+
const a = N(), m = f(() => /* @__PURE__ */ new Date()), c = new Date(t.ends_at), d = t.ends_at && c < m || t.is_expired === !0 || t.is_active === !1, n = _(), { isMobile: b } = v();
|
|
15
|
+
return /* @__PURE__ */ e(p, { children: /* @__PURE__ */ s("div", { className: o.container, children: [
|
|
16
|
+
/* @__PURE__ */ s("div", { className: o.consultationImageBox, children: [
|
|
17
|
+
/* @__PURE__ */ e(
|
|
18
|
+
r,
|
|
19
19
|
{
|
|
20
|
-
to:
|
|
20
|
+
to: n.consultationShowLocation.toUrl({
|
|
21
21
|
consultationSlug: t.slug
|
|
22
22
|
}),
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ e(
|
|
24
24
|
"img",
|
|
25
25
|
{
|
|
26
26
|
loading: "lazy",
|
|
27
|
-
className:
|
|
27
|
+
className: o.consultationImage,
|
|
28
28
|
src: t.image_url,
|
|
29
29
|
height: 200,
|
|
30
|
-
alt:
|
|
30
|
+
alt: a.formatMessage({
|
|
31
31
|
id: "consultation.consultation_box.alt",
|
|
32
32
|
defaultMessage: "Presentation image for the consultation"
|
|
33
33
|
})
|
|
@@ -35,42 +35,35 @@ const R = ({ consultation: t, showVoteProgress: p = !0 }) => {
|
|
|
35
35
|
)
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
d && /* @__PURE__ */ e("div", { className: i(o.consultationTime, o.ended), children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
39
|
+
u,
|
|
40
40
|
{
|
|
41
41
|
id: "consultation.consultation_box.consultation_ended",
|
|
42
42
|
defaultMessage: "Consultation ended"
|
|
43
43
|
}
|
|
44
44
|
) }) }),
|
|
45
|
-
|
|
46
|
-
l,
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
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,
|
|
45
|
+
t.author && t.author.is_admin === !1 && /* @__PURE__ */ s("div", { className: o.consultationSuggestion, children: [
|
|
46
|
+
/* @__PURE__ */ e(l, { name: "suggestion", width: 15, height: 15 }),
|
|
47
|
+
/* @__PURE__ */ s("span", { className: o.authorSuggestion, children: [
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
u,
|
|
57
50
|
{
|
|
58
51
|
id: "consultation.consultation_box.suggestion_author_short",
|
|
59
52
|
defaultMessage: "Suggested by"
|
|
60
53
|
}
|
|
61
54
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ e("span", { className: o.authorName, children: t.author.full_name })
|
|
63
56
|
] })
|
|
64
57
|
] })
|
|
65
58
|
] }),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
r,
|
|
68
61
|
{
|
|
69
|
-
to:
|
|
62
|
+
to: n.consultationShowLocation.toUrl({
|
|
70
63
|
consultationSlug: t.slug
|
|
71
64
|
}),
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
|
|
65
|
+
children: /* @__PURE__ */ e("div", { className: o.consultationTitle, children: /* @__PURE__ */ e(
|
|
66
|
+
x,
|
|
74
67
|
{
|
|
75
68
|
originalContent: t.title,
|
|
76
69
|
originalLanguage: t.language,
|
|
@@ -80,20 +73,20 @@ const R = ({ consultation: t, showVoteProgress: p = !0 }) => {
|
|
|
80
73
|
) })
|
|
81
74
|
}
|
|
82
75
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
76
|
+
/* @__PURE__ */ e(
|
|
77
|
+
r,
|
|
85
78
|
{
|
|
86
|
-
to:
|
|
79
|
+
to: n.consultationShowLocation.toUrl({
|
|
87
80
|
consultationSlug: t.slug
|
|
88
81
|
})
|
|
89
82
|
}
|
|
90
83
|
),
|
|
91
|
-
/* @__PURE__ */ s("div", { className:
|
|
92
|
-
/* @__PURE__ */ s("div", { className:
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
84
|
+
/* @__PURE__ */ s("div", { className: o.consultationInformations, children: [
|
|
85
|
+
/* @__PURE__ */ s("div", { className: o.consultationLeft, children: [
|
|
86
|
+
/* @__PURE__ */ e(
|
|
87
|
+
g,
|
|
95
88
|
{
|
|
96
|
-
text:
|
|
89
|
+
text: a.formatMessage({
|
|
97
90
|
id: "info.votes_count",
|
|
98
91
|
defaultMessage: "Number of votes"
|
|
99
92
|
}),
|
|
@@ -101,45 +94,45 @@ const R = ({ consultation: t, showVoteProgress: p = !0 }) => {
|
|
|
101
94
|
children: /* @__PURE__ */ s(
|
|
102
95
|
"div",
|
|
103
96
|
{
|
|
104
|
-
className:
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
className: i(
|
|
98
|
+
o.consultationGroupInformation,
|
|
99
|
+
o.consultationGroupRight
|
|
107
100
|
),
|
|
108
101
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ e("span", { className: o.consultationTextInformation, children: t.total_votes }),
|
|
103
|
+
/* @__PURE__ */ e(l, { name: "votebox", width: 15, height: 20, className: o.iconVote })
|
|
111
104
|
]
|
|
112
105
|
}
|
|
113
106
|
)
|
|
114
107
|
}
|
|
115
108
|
),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
109
|
+
/* @__PURE__ */ e(
|
|
110
|
+
g,
|
|
118
111
|
{
|
|
119
|
-
text:
|
|
112
|
+
text: a.formatMessage({
|
|
120
113
|
id: "info.proposals_count",
|
|
121
114
|
defaultMessage: "Number of proposals"
|
|
122
115
|
}),
|
|
123
116
|
position: "top",
|
|
124
|
-
children: /* @__PURE__ */ s("div", { className:
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ s("div", { className: o.consultationGroupInformation, children: [
|
|
118
|
+
/* @__PURE__ */ e("span", { className: o.consultationTextInformation, children: t.proposals_count }),
|
|
119
|
+
/* @__PURE__ */ e(l, { name: "chat", width: 15, height: 20, className: o.iconChat })
|
|
127
120
|
] })
|
|
128
121
|
}
|
|
129
122
|
)
|
|
130
123
|
] }),
|
|
131
|
-
|
|
124
|
+
h && t.vote_goal > 0 && !d && c > m && /* @__PURE__ */ e(
|
|
132
125
|
"div",
|
|
133
126
|
{
|
|
134
|
-
className:
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
className: i(
|
|
128
|
+
o.consultationGroupInformation,
|
|
129
|
+
o.progressBarContainer
|
|
137
130
|
),
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
-
|
|
131
|
+
children: /* @__PURE__ */ e(
|
|
132
|
+
M,
|
|
140
133
|
{
|
|
141
|
-
className:
|
|
142
|
-
innerClassName:
|
|
134
|
+
className: o.progress,
|
|
135
|
+
innerClassName: o.bar,
|
|
143
136
|
progress: t.total_votes,
|
|
144
137
|
goal: t.vote_goal,
|
|
145
138
|
showProgressSubtitle: !0,
|
|
@@ -152,5 +145,5 @@ const R = ({ consultation: t, showVoteProgress: p = !0 }) => {
|
|
|
152
145
|
] }) });
|
|
153
146
|
};
|
|
154
147
|
export {
|
|
155
|
-
|
|
148
|
+
P as ConsultationBox
|
|
156
149
|
};
|