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