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