@selfcommunity/react-ui 0.7.9-alpha.67 → 0.7.9-alpha.69

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.
@@ -204,8 +204,10 @@ function FeedObject(inProps) {
204
204
  /**
205
205
  * Handle change/update poll: votes
206
206
  */
207
- const handleChangePoll = (0, react_1.useCallback)((pollObject) => {
208
- updateObject(Object.assign({}, obj, { poll: pollObject }));
207
+ const handleChangePoll = (0, react_1.useCallback)((pollChoices) => {
208
+ if ('poll' in obj) {
209
+ updateObject(Object.assign({}, obj, { poll: Object.assign(Object.assign({}, obj.poll), { choices: pollChoices }) }));
210
+ }
209
211
  }, [obj]);
210
212
  /**
211
213
  * Handle change poll visibility
@@ -69,36 +69,36 @@ function PollObject(props) {
69
69
  * Handles choice upvote
70
70
  */
71
71
  const handleVote = (id) => {
72
+ const prevChoices = [...choices];
73
+ let updatedChoices;
72
74
  if (multipleChoices) {
73
- setChoices((prevChoices) => {
74
- return prevChoices.map((choice) => Object.assign({}, choice, {
75
- voted: choice.id === id ? true : choice.voted,
76
- vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count
77
- }));
78
- });
75
+ updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
76
+ voted: choice.id === id ? true : choice.voted,
77
+ vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count
78
+ }));
79
79
  setVotes((prevVotes) => prevVotes + 1);
80
80
  }
81
81
  else {
82
- setChoices((prevChoices) => {
83
- const updatedChoices = prevChoices.map((choice) => {
84
- return Object.assign(Object.assign({}, choice), { voted: choice.id === id, vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count > 0 && choice.voted ? choice.vote_count - 1 : choice.vote_count });
85
- });
86
- const newVotes = updatedChoices.reduce((totalVotes, choice) => totalVotes + choice.vote_count, 0);
87
- setVotes(newVotes);
88
- return updatedChoices;
89
- });
82
+ updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
83
+ voted: choice.id === id,
84
+ vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count > 0 && choice.voted ? choice.vote_count - 1 : choice.vote_count
85
+ }));
86
+ setVotes(updatedChoices.reduce((totalVotes, choice) => totalVotes + choice.vote_count, 0));
90
87
  }
88
+ setChoices(updatedChoices);
89
+ onChange(updatedChoices);
91
90
  };
92
91
  /**
93
92
  * Handles choice unvote
94
93
  */
95
94
  const handleUnVote = (id) => {
96
- setChoices((prevChoices) => {
97
- return prevChoices.map((choice) => Object.assign({}, choice, {
98
- voted: choice.id === id ? false : choice.voted,
99
- vote_count: choice.id === id && choice.vote_count > 0 ? choice.vote_count - 1 : choice.vote_count
100
- }));
101
- });
95
+ const prevChoices = [...choices];
96
+ const updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
97
+ voted: choice.id === id ? false : choice.voted,
98
+ vote_count: choice.id === id && choice.vote_count > 0 ? choice.vote_count - 1 : choice.vote_count
99
+ }));
100
+ setChoices(updatedChoices);
101
+ onChange(updatedChoices);
102
102
  setVotes((prevVotes) => prevVotes - 1);
103
103
  };
104
104
  /**
@@ -232,7 +232,11 @@ function GroupForm(inProps) {
232
232
  } }),
233
233
  react_1.default.createElement(material_1.Box, { className: classes.privacySection },
234
234
  react_1.default.createElement(material_1.Typography, { variant: "h4" },
235
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.title", defaultMessage: "ui.groupForm.privacy.title", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })),
235
+ react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.title", defaultMessage: "ui.groupForm.privacy.title", values: {
236
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
237
+ // @ts-ignore
238
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
239
+ } })),
236
240
  react_1.default.createElement(material_1.Stack, { direction: "row", spacing: 1, alignItems: "center" },
237
241
  react_1.default.createElement(material_1.Typography, { className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: !field.isPublic }) },
238
242
  react_1.default.createElement(material_1.Icon, null, "private"),
@@ -241,10 +245,26 @@ function GroupForm(inProps) {
241
245
  react_1.default.createElement(material_1.Typography, { className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: field.isPublic }) },
242
246
  react_1.default.createElement(material_1.Icon, null, "public"),
243
247
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.public", defaultMessage: "ui.groupForm.privacy.public" }))),
244
- react_1.default.createElement(material_1.Typography, { variant: "body2", className: classes.privacySectionInfo }, field.isPublic ? (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.public.info", defaultMessage: "ui.groupForm.privacy.public.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })) : (react_1.default.createElement(react_1.default.Fragment, null, group && group.privacy === types_1.SCGroupPrivacyType.PRIVATE ? (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.private.info.edit", defaultMessage: "ui.groupForm.private.public.info.edit", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })) : (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.private.info", defaultMessage: "ui.groupForm.private.public.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })))))),
248
+ react_1.default.createElement(material_1.Typography, { variant: "body2", className: classes.privacySectionInfo }, field.isPublic ? (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.public.info", defaultMessage: "ui.groupForm.privacy.public.info", values: {
249
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
250
+ // @ts-ignore
251
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
252
+ } })) : (react_1.default.createElement(react_1.default.Fragment, null, group && group.privacy === types_1.SCGroupPrivacyType.PRIVATE ? (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.private.info.edit", defaultMessage: "ui.groupForm.private.public.info.edit", values: {
253
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
254
+ // @ts-ignore
255
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
256
+ } })) : (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.privacy.private.info", defaultMessage: "ui.groupForm.private.public.info", values: {
257
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
258
+ // @ts-ignore
259
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
260
+ } })))))),
245
261
  react_1.default.createElement(material_1.Box, { className: classes.visibilitySection }, ((!field.isPublic && !group) || (group && !field.isPublic)) && (react_1.default.createElement(react_1.default.Fragment, null,
246
262
  react_1.default.createElement(material_1.Typography, { variant: "h4" },
247
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.title", defaultMessage: "ui.groupForm.visibility.title", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })),
263
+ react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.title", defaultMessage: "ui.groupForm.visibility.title", values: {
264
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
265
+ // @ts-ignore
266
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
267
+ } })),
248
268
  react_1.default.createElement(material_1.Stack, { direction: "row", spacing: 1, alignItems: "center" },
249
269
  react_1.default.createElement(material_1.Typography, { className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: !field.isVisible }) },
250
270
  react_1.default.createElement(material_1.Icon, null, "visibility_off"),
@@ -253,7 +273,15 @@ function GroupForm(inProps) {
253
273
  react_1.default.createElement(material_1.Typography, { className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: field.isVisible }) },
254
274
  react_1.default.createElement(material_1.Icon, null, "visibility"),
255
275
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.visible", defaultMessage: "ui.groupForm.visibility.visible" }))),
256
- react_1.default.createElement(material_1.Typography, { variant: "body2", className: classes.visibilitySectionInfo }, !field.isVisible ? (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })) : (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } }))))))),
276
+ react_1.default.createElement(material_1.Typography, { variant: "body2", className: classes.visibilitySectionInfo }, !field.isVisible ? (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: {
277
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
278
+ // @ts-ignore
279
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
280
+ } })) : (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: {
281
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
282
+ // @ts-ignore
283
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
284
+ } }))))))),
257
285
  !group && (react_1.default.createElement(react_1.default.Fragment, null,
258
286
  react_1.default.createElement(material_1.Divider, null),
259
287
  react_1.default.createElement(material_1.Box, { className: classes.inviteSection },
@@ -108,23 +108,39 @@ function GroupInfoWidget(inProps) {
108
108
  react_1.default.createElement(material_1.Icon, null, "public"),
109
109
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.privacy.public", defaultMessage: "ui.groupInfoWidget.privacy.public" })),
110
110
  react_1.default.createElement(material_1.Typography, { variant: "body2" },
111
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.privacy.public.info", defaultMessage: "ui.groupInfoWidget.privacy.public.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })))) : (react_1.default.createElement(react_1.default.Fragment, null,
111
+ react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.privacy.public.info", defaultMessage: "ui.groupInfoWidget.privacy.public.info", values: {
112
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
113
+ // @ts-ignore
114
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
115
+ } })))) : (react_1.default.createElement(react_1.default.Fragment, null,
112
116
  react_1.default.createElement(material_1.Typography, { className: classes.privacyTitle },
113
117
  react_1.default.createElement(material_1.Icon, null, "private"),
114
118
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.privacy.private", defaultMessage: "ui.groupInfoWidget.privacy.private" })),
115
119
  react_1.default.createElement(material_1.Typography, { variant: "body2" },
116
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.privacy.private.info", defaultMessage: "ui.groupInfoWidget.private.public.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } }))))),
120
+ react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.privacy.private.info", defaultMessage: "ui.groupInfoWidget.private.public.info", values: {
121
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
122
+ // @ts-ignore
123
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
124
+ } }))))),
117
125
  scGroup.privacy === types_1.SCGroupPrivacyType.PRIVATE && (react_1.default.createElement(material_1.Typography, { component: "div", className: classes.visibility }, scGroup.visible ? (react_1.default.createElement(react_1.default.Fragment, null,
118
126
  react_1.default.createElement(material_1.Typography, { className: classes.visibilityTitle },
119
127
  react_1.default.createElement(material_1.Icon, null, "visibility"),
120
128
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.visible", defaultMessage: "ui.groupForm.visibility.visible" })),
121
129
  react_1.default.createElement(material_1.Typography, { variant: "body2" },
122
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })))) : (react_1.default.createElement(react_1.default.Fragment, null,
130
+ react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: {
131
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
132
+ // @ts-ignore
133
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
134
+ } })))) : (react_1.default.createElement(react_1.default.Fragment, null,
123
135
  react_1.default.createElement(material_1.Typography, { className: classes.visibilityTitle },
124
136
  react_1.default.createElement(material_1.Icon, null, "visibility_off"),
125
137
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.hidden", defaultMessage: "ui.groupForm.visibility.hidden" })),
126
138
  react_1.default.createElement(material_1.Typography, { variant: "body2" },
127
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: { b: (chunks) => react_1.default.createElement("strong", null, chunks) } })))))),
139
+ react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: {
140
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
141
+ // @ts-ignore
142
+ b: (chunks) => react_1.default.createElement("strong", null, chunks)
143
+ } })))))),
128
144
  react_1.default.createElement(material_1.Typography, { variant: "body2", className: classes.date },
129
145
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.date", defaultMessage: "ui.groupInfoWidget.date", values: { date: intl.formatDate(scGroup.created_at, { day: 'numeric', year: 'numeric', month: 'long' }) } })),
130
146
  react_1.default.createElement(material_1.Typography, { variant: "body2", className: classes.admin },
@@ -140,6 +140,12 @@ function GroupSettingsIconButton(inProps) {
140
140
  react_1.default.createElement(Icon_1.default, null, "more_vert")),
141
141
  isMobile ? (react_1.default.createElement(SwipeableDrawerRoot, { className: classes.drawerRoot, anchor: "bottom", open: Boolean(anchorEl), onClose: handleClose, onOpen: handleOpen, PaperProps: { className: classes.paper }, disableSwipeToOpen: true },
142
142
  react_1.default.createElement(material_1.List, null, renderList()))) : (react_1.default.createElement(MenuRoot, { className: classes.menuRoot, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, PaperProps: { className: classes.paper } }, renderList())),
143
- openConfirmDialog && (react_1.default.createElement(ConfirmDialog_1.default, { open: openConfirmDialog, title: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.msg", defaultMessage: "ui.groupSettingsIconButton.dialog.msg", values: { b: (...chunks) => react_1.default.createElement("strong", null, chunks), user: user.username, group: group.name } }), btnConfirm: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.confirm", defaultMessage: "ui.groupSettingsIconButton.dialog.confirm" }), onConfirm: handleRemoveUser, onClose: handleCloseDialog }))));
143
+ openConfirmDialog && (react_1.default.createElement(ConfirmDialog_1.default, { open: openConfirmDialog, title: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.msg", defaultMessage: "ui.groupSettingsIconButton.dialog.msg", values: {
144
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
145
+ // @ts-ignore
146
+ b: (...chunks) => react_1.default.createElement("strong", null, chunks),
147
+ user: user.username,
148
+ group: group.name
149
+ } }), btnConfirm: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.confirm", defaultMessage: "ui.groupSettingsIconButton.dialog.confirm" }), onConfirm: handleRemoveUser, onClose: handleCloseDialog }))));
144
150
  }
145
151
  exports.default = GroupSettingsIconButton;
@@ -164,6 +164,8 @@ function Groups(inProps) {
164
164
  react_1.default.createElement(material_1.Typography, { variant: "body1" },
165
165
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.subtitle", defaultMessage: "ui.groups.noGroups.subtitle" })))) : (react_1.default.createElement(InfiniteScroll_1.default, { dataLength: groups.length, next: handleNext, hasMoreNext: Boolean(next), loaderNext: isMobile ? react_1.default.createElement(Group_1.GroupSkeleton, null) : react_1.default.createElement(Skeleton_1.default, { groupsNumber: 2 }), endMessage: react_1.default.createElement(material_1.Typography, { component: "div", className: classes.endMessage },
166
166
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groups.endMessage", defaultMessage: "ui.groups.endMessage", values: {
167
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
168
+ // @ts-ignore
167
169
  button: (chunk) => (react_1.default.createElement(material_1.Button, { color: "secondary", variant: "text", onClick: handleScrollUp }, chunk))
168
170
  } })) },
169
171
  react_1.default.createElement(material_1.Grid, { container: true, spacing: { xs: 2 }, className: classes.groups }, filteredGroups.map((group) => (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, sm: 8, md: 6, key: group.id, className: classes.item },
@@ -202,8 +202,10 @@ export default function FeedObject(inProps) {
202
202
  /**
203
203
  * Handle change/update poll: votes
204
204
  */
205
- const handleChangePoll = useCallback((pollObject) => {
206
- updateObject(Object.assign({}, obj, { poll: pollObject }));
205
+ const handleChangePoll = useCallback((pollChoices) => {
206
+ if ('poll' in obj) {
207
+ updateObject(Object.assign({}, obj, { poll: Object.assign(Object.assign({}, obj.poll), { choices: pollChoices }) }));
208
+ }
207
209
  }, [obj]);
208
210
  /**
209
211
  * Handle change poll visibility
@@ -67,36 +67,36 @@ export default function PollObject(props) {
67
67
  * Handles choice upvote
68
68
  */
69
69
  const handleVote = (id) => {
70
+ const prevChoices = [...choices];
71
+ let updatedChoices;
70
72
  if (multipleChoices) {
71
- setChoices((prevChoices) => {
72
- return prevChoices.map((choice) => Object.assign({}, choice, {
73
- voted: choice.id === id ? true : choice.voted,
74
- vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count
75
- }));
76
- });
73
+ updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
74
+ voted: choice.id === id ? true : choice.voted,
75
+ vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count
76
+ }));
77
77
  setVotes((prevVotes) => prevVotes + 1);
78
78
  }
79
79
  else {
80
- setChoices((prevChoices) => {
81
- const updatedChoices = prevChoices.map((choice) => {
82
- return Object.assign(Object.assign({}, choice), { voted: choice.id === id, vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count > 0 && choice.voted ? choice.vote_count - 1 : choice.vote_count });
83
- });
84
- const newVotes = updatedChoices.reduce((totalVotes, choice) => totalVotes + choice.vote_count, 0);
85
- setVotes(newVotes);
86
- return updatedChoices;
87
- });
80
+ updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
81
+ voted: choice.id === id,
82
+ vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count > 0 && choice.voted ? choice.vote_count - 1 : choice.vote_count
83
+ }));
84
+ setVotes(updatedChoices.reduce((totalVotes, choice) => totalVotes + choice.vote_count, 0));
88
85
  }
86
+ setChoices(updatedChoices);
87
+ onChange(updatedChoices);
89
88
  };
90
89
  /**
91
90
  * Handles choice unvote
92
91
  */
93
92
  const handleUnVote = (id) => {
94
- setChoices((prevChoices) => {
95
- return prevChoices.map((choice) => Object.assign({}, choice, {
96
- voted: choice.id === id ? false : choice.voted,
97
- vote_count: choice.id === id && choice.vote_count > 0 ? choice.vote_count - 1 : choice.vote_count
98
- }));
99
- });
93
+ const prevChoices = [...choices];
94
+ const updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
95
+ voted: choice.id === id ? false : choice.voted,
96
+ vote_count: choice.id === id && choice.vote_count > 0 ? choice.vote_count - 1 : choice.vote_count
97
+ }));
98
+ setChoices(updatedChoices);
99
+ onChange(updatedChoices);
100
100
  setVotes((prevVotes) => prevVotes - 1);
101
101
  };
102
102
  /**
@@ -230,7 +230,11 @@ export default function GroupForm(inProps) {
230
230
  } }),
231
231
  React.createElement(Box, { className: classes.privacySection },
232
232
  React.createElement(Typography, { variant: "h4" },
233
- React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.title", defaultMessage: "ui.groupForm.privacy.title", values: { b: (chunks) => React.createElement("strong", null, chunks) } })),
233
+ React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.title", defaultMessage: "ui.groupForm.privacy.title", values: {
234
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
235
+ // @ts-ignore
236
+ b: (chunks) => React.createElement("strong", null, chunks)
237
+ } })),
234
238
  React.createElement(Stack, { direction: "row", spacing: 1, alignItems: "center" },
235
239
  React.createElement(Typography, { className: classNames(classes.switchLabel, { [classes.active]: !field.isPublic }) },
236
240
  React.createElement(Icon, null, "private"),
@@ -239,10 +243,26 @@ export default function GroupForm(inProps) {
239
243
  React.createElement(Typography, { className: classNames(classes.switchLabel, { [classes.active]: field.isPublic }) },
240
244
  React.createElement(Icon, null, "public"),
241
245
  React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.public", defaultMessage: "ui.groupForm.privacy.public" }))),
242
- React.createElement(Typography, { variant: "body2", className: classes.privacySectionInfo }, field.isPublic ? (React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.public.info", defaultMessage: "ui.groupForm.privacy.public.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } })) : (React.createElement(React.Fragment, null, group && group.privacy === SCGroupPrivacyType.PRIVATE ? (React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.private.info.edit", defaultMessage: "ui.groupForm.private.public.info.edit", values: { b: (chunks) => React.createElement("strong", null, chunks) } })) : (React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.private.info", defaultMessage: "ui.groupForm.private.public.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } })))))),
246
+ React.createElement(Typography, { variant: "body2", className: classes.privacySectionInfo }, field.isPublic ? (React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.public.info", defaultMessage: "ui.groupForm.privacy.public.info", values: {
247
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
248
+ // @ts-ignore
249
+ b: (chunks) => React.createElement("strong", null, chunks)
250
+ } })) : (React.createElement(React.Fragment, null, group && group.privacy === SCGroupPrivacyType.PRIVATE ? (React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.private.info.edit", defaultMessage: "ui.groupForm.private.public.info.edit", values: {
251
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
252
+ // @ts-ignore
253
+ b: (chunks) => React.createElement("strong", null, chunks)
254
+ } })) : (React.createElement(FormattedMessage, { id: "ui.groupForm.privacy.private.info", defaultMessage: "ui.groupForm.private.public.info", values: {
255
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
256
+ // @ts-ignore
257
+ b: (chunks) => React.createElement("strong", null, chunks)
258
+ } })))))),
243
259
  React.createElement(Box, { className: classes.visibilitySection }, ((!field.isPublic && !group) || (group && !field.isPublic)) && (React.createElement(React.Fragment, null,
244
260
  React.createElement(Typography, { variant: "h4" },
245
- React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.title", defaultMessage: "ui.groupForm.visibility.title", values: { b: (chunks) => React.createElement("strong", null, chunks) } })),
261
+ React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.title", defaultMessage: "ui.groupForm.visibility.title", values: {
262
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
263
+ // @ts-ignore
264
+ b: (chunks) => React.createElement("strong", null, chunks)
265
+ } })),
246
266
  React.createElement(Stack, { direction: "row", spacing: 1, alignItems: "center" },
247
267
  React.createElement(Typography, { className: classNames(classes.switchLabel, { [classes.active]: !field.isVisible }) },
248
268
  React.createElement(Icon, null, "visibility_off"),
@@ -251,7 +271,15 @@ export default function GroupForm(inProps) {
251
271
  React.createElement(Typography, { className: classNames(classes.switchLabel, { [classes.active]: field.isVisible }) },
252
272
  React.createElement(Icon, null, "visibility"),
253
273
  React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.visible", defaultMessage: "ui.groupForm.visibility.visible" }))),
254
- React.createElement(Typography, { variant: "body2", className: classes.visibilitySectionInfo }, !field.isVisible ? (React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } })) : (React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } }))))))),
274
+ React.createElement(Typography, { variant: "body2", className: classes.visibilitySectionInfo }, !field.isVisible ? (React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: {
275
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
276
+ // @ts-ignore
277
+ b: (chunks) => React.createElement("strong", null, chunks)
278
+ } })) : (React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: {
279
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
280
+ // @ts-ignore
281
+ b: (chunks) => React.createElement("strong", null, chunks)
282
+ } }))))))),
255
283
  !group && (React.createElement(React.Fragment, null,
256
284
  React.createElement(Divider, null),
257
285
  React.createElement(Box, { className: classes.inviteSection },
@@ -106,23 +106,39 @@ export default function GroupInfoWidget(inProps) {
106
106
  React.createElement(Icon, null, "public"),
107
107
  React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.privacy.public", defaultMessage: "ui.groupInfoWidget.privacy.public" })),
108
108
  React.createElement(Typography, { variant: "body2" },
109
- React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.privacy.public.info", defaultMessage: "ui.groupInfoWidget.privacy.public.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } })))) : (React.createElement(React.Fragment, null,
109
+ React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.privacy.public.info", defaultMessage: "ui.groupInfoWidget.privacy.public.info", values: {
110
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
111
+ // @ts-ignore
112
+ b: (chunks) => React.createElement("strong", null, chunks)
113
+ } })))) : (React.createElement(React.Fragment, null,
110
114
  React.createElement(Typography, { className: classes.privacyTitle },
111
115
  React.createElement(Icon, null, "private"),
112
116
  React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.privacy.private", defaultMessage: "ui.groupInfoWidget.privacy.private" })),
113
117
  React.createElement(Typography, { variant: "body2" },
114
- React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.privacy.private.info", defaultMessage: "ui.groupInfoWidget.private.public.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } }))))),
118
+ React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.privacy.private.info", defaultMessage: "ui.groupInfoWidget.private.public.info", values: {
119
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
120
+ // @ts-ignore
121
+ b: (chunks) => React.createElement("strong", null, chunks)
122
+ } }))))),
115
123
  scGroup.privacy === SCGroupPrivacyType.PRIVATE && (React.createElement(Typography, { component: "div", className: classes.visibility }, scGroup.visible ? (React.createElement(React.Fragment, null,
116
124
  React.createElement(Typography, { className: classes.visibilityTitle },
117
125
  React.createElement(Icon, null, "visibility"),
118
126
  React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.visible", defaultMessage: "ui.groupForm.visibility.visible" })),
119
127
  React.createElement(Typography, { variant: "body2" },
120
- React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } })))) : (React.createElement(React.Fragment, null,
128
+ React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.visible.info", defaultMessage: "ui.groupForm.visibility.visible.info", values: {
129
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
130
+ // @ts-ignore
131
+ b: (chunks) => React.createElement("strong", null, chunks)
132
+ } })))) : (React.createElement(React.Fragment, null,
121
133
  React.createElement(Typography, { className: classes.visibilityTitle },
122
134
  React.createElement(Icon, null, "visibility_off"),
123
135
  React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.hidden", defaultMessage: "ui.groupForm.visibility.hidden" })),
124
136
  React.createElement(Typography, { variant: "body2" },
125
- React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: { b: (chunks) => React.createElement("strong", null, chunks) } })))))),
137
+ React.createElement(FormattedMessage, { id: "ui.groupForm.visibility.hidden.info", defaultMessage: "ui.groupForm.visibility.hidden.info", values: {
138
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
139
+ // @ts-ignore
140
+ b: (chunks) => React.createElement("strong", null, chunks)
141
+ } })))))),
126
142
  React.createElement(Typography, { variant: "body2", className: classes.date },
127
143
  React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.date", defaultMessage: "ui.groupInfoWidget.date", values: { date: intl.formatDate(scGroup.created_at, { day: 'numeric', year: 'numeric', month: 'long' }) } })),
128
144
  React.createElement(Typography, { variant: "body2", className: classes.admin },
@@ -138,5 +138,11 @@ export default function GroupSettingsIconButton(inProps) {
138
138
  React.createElement(Icon, null, "more_vert")),
139
139
  isMobile ? (React.createElement(SwipeableDrawerRoot, { className: classes.drawerRoot, anchor: "bottom", open: Boolean(anchorEl), onClose: handleClose, onOpen: handleOpen, PaperProps: { className: classes.paper }, disableSwipeToOpen: true },
140
140
  React.createElement(List, null, renderList()))) : (React.createElement(MenuRoot, { className: classes.menuRoot, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, PaperProps: { className: classes.paper } }, renderList())),
141
- openConfirmDialog && (React.createElement(ConfirmDialog, { open: openConfirmDialog, title: React.createElement(FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.msg", defaultMessage: "ui.groupSettingsIconButton.dialog.msg", values: { b: (...chunks) => React.createElement("strong", null, chunks), user: user.username, group: group.name } }), btnConfirm: React.createElement(FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.confirm", defaultMessage: "ui.groupSettingsIconButton.dialog.confirm" }), onConfirm: handleRemoveUser, onClose: handleCloseDialog }))));
141
+ openConfirmDialog && (React.createElement(ConfirmDialog, { open: openConfirmDialog, title: React.createElement(FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.msg", defaultMessage: "ui.groupSettingsIconButton.dialog.msg", values: {
142
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
143
+ // @ts-ignore
144
+ b: (...chunks) => React.createElement("strong", null, chunks),
145
+ user: user.username,
146
+ group: group.name
147
+ } }), btnConfirm: React.createElement(FormattedMessage, { id: "ui.groupSettingsIconButton.dialog.confirm", defaultMessage: "ui.groupSettingsIconButton.dialog.confirm" }), onConfirm: handleRemoveUser, onClose: handleCloseDialog }))));
142
148
  }
@@ -162,6 +162,8 @@ export default function Groups(inProps) {
162
162
  React.createElement(Typography, { variant: "body1" },
163
163
  React.createElement(FormattedMessage, { id: "ui.groups.noGroups.subtitle", defaultMessage: "ui.groups.noGroups.subtitle" })))) : (React.createElement(InfiniteScroll, { dataLength: groups.length, next: handleNext, hasMoreNext: Boolean(next), loaderNext: isMobile ? React.createElement(GroupSkeleton, null) : React.createElement(Skeleton, { groupsNumber: 2 }), endMessage: React.createElement(Typography, { component: "div", className: classes.endMessage },
164
164
  React.createElement(FormattedMessage, { id: "ui.groups.endMessage", defaultMessage: "ui.groups.endMessage", values: {
165
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
166
+ // @ts-ignore
165
167
  button: (chunk) => (React.createElement(Button, { color: "secondary", variant: "text", onClick: handleScrollUp }, chunk))
166
168
  } })) },
167
169
  React.createElement(Grid, { container: true, spacing: { xs: 2 }, className: classes.groups }, filteredGroups.map((group) => (React.createElement(Grid, { item: true, xs: 12, sm: 8, md: 6, key: group.id, className: classes.item },