@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 u, jsxs as a } from "react/jsx-runtime";
2
- import s from "classnames";
3
- import { useMemo as g } from "react";
4
- import { useIntl as h, FormattedMessage as p } from "react-intl";
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 f } from "../../data/config_provider/useRoutes.js";
7
- import { useResponsive as v } from "../../hooks/use_responsive/useResponsive.js";
8
- import { Link as i } from "../../action/link/Link.js";
9
- import { TranslatedContent as N } from "../../translation/translated_content/TranslatedContent.js";
10
- import { Icon as c } from "../../icons/icon/Icon.js";
11
- import { ProgressBar as _ } from "../../progress/progress_bar/ProgressBar.js";
12
- const D = ({ consultation: e, showVoteProgress: m = !0 }) => {
13
- const d = h(), r = g(() => /* @__PURE__ */ new Date()), l = new Date(e.ends_at), n = f(), { isMobile: x } = v();
14
- return /* @__PURE__ */ t(u, { children: /* @__PURE__ */ a("div", { className: o.container, children: [
15
- /* @__PURE__ */ a("div", { className: o.consultationImageBox, children: [
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
- i,
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: d.formatMessage({
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 && l < r && /* @__PURE__ */ t("div", { className: s(o.consultationTime, o.ended), children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
37
- p,
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
- i,
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
- N,
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
- i,
63
+ r,
63
64
  {
64
65
  to: n.consultationShowLocation.toUrl({
65
66
  consultationSlug: e.slug
66
67
  })
67
68
  }
68
69
  ),
69
- /* @__PURE__ */ a("div", { className: o.consultationInformations, children: [
70
- /* @__PURE__ */ a("div", { className: o.consultationLeft, children: [
71
- /* @__PURE__ */ a(
72
- "div",
70
+ /* @__PURE__ */ s("div", { className: o.consultationInformations, children: [
71
+ /* @__PURE__ */ s("div", { className: o.consultationLeft, children: [
72
+ /* @__PURE__ */ t(
73
+ m,
73
74
  {
74
- className: s(
75
- o.consultationGroupInformation,
76
- o.consultationGroupRight
77
- ),
78
- children: [
79
- /* @__PURE__ */ t("span", { className: o.consultationTextInformation, children: e.total_votes }),
80
- /* @__PURE__ */ t(c, { name: "votebox", width: 15, height: 20, className: o.iconVote })
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__ */ a("div", { className: o.consultationGroupInformation, children: [
85
- /* @__PURE__ */ t("span", { className: o.consultationTextInformation, children: e.proposals_count }),
86
- /* @__PURE__ */ t(c, { name: "chat", width: 15, height: 20, className: o.iconChat })
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
- m && e.vote_goal > 0 && l > r && /* @__PURE__ */ t(
110
+ u && e.vote_goal > 0 && c > l && /* @__PURE__ */ t(
90
111
  "div",
91
112
  {
92
- className: s(
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
- D as ConsultationBox
134
+ P as ConsultationBox
114
135
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.67",
3
+ "version": "0.3.68",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",