@selfcommunity/react-ui 0.7.9-alpha.7 → 0.7.9-alpha.70
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.
- package/lib/cjs/components/AccountRecover/AccountRecover.js +6 -1
- package/lib/cjs/components/BottomNavigation/BottomNavigation.js +4 -3
- package/lib/cjs/components/CategoryHeader/Skeleton.js +3 -2
- package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +13 -10
- package/lib/cjs/components/Composer/Attributes/Attributes.js +3 -3
- package/lib/cjs/components/Composer/Composer.js +3 -3
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +1 -1
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +9 -19
- package/lib/cjs/components/FeedObject/Contributors/Contributors.js +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.d.ts +1 -0
- package/lib/cjs/components/FeedObject/FeedObject.js +27 -8
- package/lib/cjs/components/FeedObject/Poll/Poll.js +20 -20
- package/lib/cjs/components/FeedUpdatesWidget/FeedUpdatesWidget.js +1 -1
- package/lib/cjs/components/Group/Group.d.ts +8 -0
- package/lib/cjs/components/Group/Group.js +17 -5
- package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +1 -1
- package/lib/cjs/components/GroupForm/GroupForm.js +64 -13
- package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +6 -5
- package/lib/cjs/components/GroupHeader/GroupHeader.js +53 -11
- package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +63 -9
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +31 -9
- package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.d.ts +74 -0
- package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +221 -0
- package/lib/cjs/components/GroupInvitedWidget/Skeleton.d.ts +22 -0
- package/lib/cjs/components/GroupInvitedWidget/Skeleton.js +38 -0
- package/lib/cjs/components/GroupInvitedWidget/constants.d.ts +1 -0
- package/lib/cjs/components/GroupInvitedWidget/constants.js +4 -0
- package/lib/cjs/components/GroupInvitedWidget/index.d.ts +4 -0
- package/lib/cjs/components/GroupInvitedWidget/index.js +8 -0
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.d.ts +5 -0
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.js +8 -3
- package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +25 -4
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +11 -5
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +18 -7
- package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +48 -0
- package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +151 -0
- package/lib/cjs/components/GroupSettingsIconButton/index.d.ts +3 -0
- package/lib/cjs/components/GroupSettingsIconButton/index.js +5 -0
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +8 -3
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +30 -11
- package/lib/cjs/components/Groups/Groups.d.ts +15 -8
- package/lib/cjs/components/Groups/Groups.js +89 -32
- package/lib/cjs/components/Groups/Skeleton.d.ts +4 -0
- package/lib/cjs/components/Groups/Skeleton.js +2 -2
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +7 -0
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.js +1 -1
- package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +4 -4
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +6 -2
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +5 -0
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +11 -4
- package/lib/cjs/components/Notification/Group/Group.d.ts +15 -0
- package/lib/cjs/components/Notification/Group/Group.js +78 -0
- package/lib/cjs/components/Notification/Group/index.d.ts +3 -0
- package/lib/cjs/components/Notification/Group/index.js +5 -0
- package/lib/cjs/components/Notification/Notification.js +31 -1
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +16 -5
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +1 -1
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +12 -7
- package/lib/cjs/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -1
- package/lib/cjs/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +3 -3
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +24 -6
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +45 -20
- package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +6 -0
- package/lib/cjs/components/SearchAutocomplete/SearchAutocomplete.js +22 -5
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +7 -0
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js +7 -0
- package/lib/cjs/components/User/User.d.ts +6 -1
- package/lib/cjs/components/User/User.js +5 -4
- package/lib/cjs/components/UserSubscribedGroupsWidget/Skeleton.d.ts +21 -0
- package/lib/cjs/components/UserSubscribedGroupsWidget/Skeleton.js +46 -0
- package/lib/cjs/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.d.ts +68 -0
- package/lib/cjs/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +183 -0
- package/lib/cjs/components/UserSubscribedGroupsWidget/constants.d.ts +1 -0
- package/lib/cjs/components/UserSubscribedGroupsWidget/constants.js +4 -0
- package/lib/cjs/components/UserSubscribedGroupsWidget/index.d.ts +4 -0
- package/lib/cjs/components/UserSubscribedGroupsWidget/index.js +8 -0
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +1 -1
- package/lib/cjs/constants/PubSub.d.ts +28 -0
- package/lib/cjs/constants/PubSub.js +22 -0
- package/lib/cjs/index.d.ts +6 -2
- package/lib/cjs/index.js +15 -4
- package/lib/esm/components/AccountRecover/AccountRecover.js +6 -1
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +5 -4
- package/lib/esm/components/CategoryHeader/Skeleton.js +3 -2
- package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +13 -10
- package/lib/esm/components/Composer/Attributes/Attributes.js +3 -3
- package/lib/esm/components/Composer/Composer.js +3 -3
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +1 -1
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +9 -19
- package/lib/esm/components/FeedObject/Contributors/Contributors.js +1 -1
- package/lib/esm/components/FeedObject/FeedObject.d.ts +1 -0
- package/lib/esm/components/FeedObject/FeedObject.js +28 -9
- package/lib/esm/components/FeedObject/Poll/Poll.js +20 -20
- package/lib/esm/components/FeedUpdatesWidget/FeedUpdatesWidget.js +1 -1
- package/lib/esm/components/Group/Group.d.ts +8 -0
- package/lib/esm/components/Group/Group.js +21 -9
- package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +1 -1
- package/lib/esm/components/GroupForm/GroupForm.js +64 -13
- package/lib/esm/components/GroupHeader/GroupHeader.d.ts +6 -5
- package/lib/esm/components/GroupHeader/GroupHeader.js +55 -13
- package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +63 -9
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +31 -9
- package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.d.ts +74 -0
- package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +218 -0
- package/lib/esm/components/GroupInvitedWidget/Skeleton.d.ts +22 -0
- package/lib/esm/components/GroupInvitedWidget/Skeleton.js +34 -0
- package/lib/esm/components/GroupInvitedWidget/constants.d.ts +1 -0
- package/lib/esm/components/GroupInvitedWidget/constants.js +1 -0
- package/lib/esm/components/GroupInvitedWidget/index.d.ts +4 -0
- package/lib/esm/components/GroupInvitedWidget/index.js +4 -0
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.d.ts +5 -0
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.js +9 -4
- package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +26 -5
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +11 -5
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +18 -7
- package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +48 -0
- package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +148 -0
- package/lib/esm/components/GroupSettingsIconButton/index.d.ts +3 -0
- package/lib/esm/components/GroupSettingsIconButton/index.js +2 -0
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +8 -3
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +30 -11
- package/lib/esm/components/Groups/Groups.d.ts +15 -8
- package/lib/esm/components/Groups/Groups.js +94 -37
- package/lib/esm/components/Groups/Skeleton.d.ts +4 -0
- package/lib/esm/components/Groups/Skeleton.js +2 -2
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +9 -2
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +1 -1
- package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +4 -4
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +7 -3
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +5 -0
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +13 -6
- package/lib/esm/components/Notification/Group/Group.d.ts +15 -0
- package/lib/esm/components/Notification/Group/Group.js +75 -0
- package/lib/esm/components/Notification/Group/index.d.ts +3 -0
- package/lib/esm/components/Notification/Group/index.js +2 -0
- package/lib/esm/components/Notification/Notification.js +31 -1
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +16 -5
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +13 -8
- package/lib/esm/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -1
- package/lib/esm/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +3 -3
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +26 -8
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +47 -22
- package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +7 -1
- package/lib/esm/components/SearchAutocomplete/SearchAutocomplete.js +22 -5
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +7 -0
- package/lib/esm/components/ToastNotifications/ToastNotifications.js +7 -0
- package/lib/esm/components/User/User.d.ts +6 -1
- package/lib/esm/components/User/User.js +5 -4
- package/lib/esm/components/UserSubscribedGroupsWidget/Skeleton.d.ts +21 -0
- package/lib/esm/components/UserSubscribedGroupsWidget/Skeleton.js +42 -0
- package/lib/esm/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.d.ts +68 -0
- package/lib/esm/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +180 -0
- package/lib/esm/components/UserSubscribedGroupsWidget/constants.d.ts +1 -0
- package/lib/esm/components/UserSubscribedGroupsWidget/constants.js +1 -0
- package/lib/esm/components/UserSubscribedGroupsWidget/index.d.ts +4 -0
- package/lib/esm/components/UserSubscribedGroupsWidget/index.js +4 -0
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +1 -1
- package/lib/esm/constants/PubSub.d.ts +28 -0
- package/lib/esm/constants/PubSub.js +19 -0
- package/lib/esm/index.d.ts +6 -2
- package/lib/esm/index.js +8 -4
- package/lib/umd/react-ui.js +1 -1
- package/package.json +6 -6
|
@@ -3,11 +3,11 @@ import React, { useCallback, useContext, useEffect, useMemo, useRef, useState }
|
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import { Endpoints, http, PrivateMessageService } from '@selfcommunity/api-services';
|
|
5
5
|
import { SCUserContext, UserUtils, useSCFetchUser } from '@selfcommunity/react-core';
|
|
6
|
-
import { SCNotificationTopicType, SCNotificationTypologyType, SCPrivateMessageStatusType } from '@selfcommunity/types';
|
|
6
|
+
import { SCNotificationTopicType, SCNotificationTypologyType, SCPrivateMessageStatusType, SCPrivateMessageType } from '@selfcommunity/types';
|
|
7
7
|
import PrivateMessageThreadItem, { PrivateMessageThreadItemSkeleton } from '../PrivateMessageThreadItem';
|
|
8
8
|
import PubSub from 'pubsub-js';
|
|
9
9
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
10
|
-
import { Box, Card, CardContent, IconButton, List, ListSubheader, TextField, Typography } from '@mui/material';
|
|
10
|
+
import { Avatar, Box, Card, CardContent, IconButton, List, ListItemAvatar, ListSubheader, TextField, Typography } from '@mui/material';
|
|
11
11
|
import PrivateMessageEditor from '../PrivateMessageEditor';
|
|
12
12
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
13
13
|
import classNames from 'classnames';
|
|
@@ -41,6 +41,8 @@ const classes = {
|
|
|
41
41
|
newMessageContent: `${PREFIX}-new-message-content`,
|
|
42
42
|
sender: `${PREFIX}-sender`,
|
|
43
43
|
receiver: `${PREFIX}-receiver`,
|
|
44
|
+
avatar: `${PREFIX}-avatar`,
|
|
45
|
+
item: `${PREFIX}-item`,
|
|
44
46
|
autocomplete: `${PREFIX}-autocomplete`,
|
|
45
47
|
autocompleteDialog: `${PREFIX}-autocomplete-dialog`,
|
|
46
48
|
editor: `${PREFIX}-editor`
|
|
@@ -93,7 +95,7 @@ export default function PrivateMessageThread(inProps) {
|
|
|
93
95
|
props: inProps,
|
|
94
96
|
name: PREFIX
|
|
95
97
|
});
|
|
96
|
-
const {
|
|
98
|
+
const { threadObj, openNewMessage = false, onNewMessageClose = null, onNewMessageSent = null, onSingleMessageOpen = null, className, type } = props, rest = __rest(props, ["threadObj", "openNewMessage", "onNewMessageClose", "onNewMessageSent", "onSingleMessageOpen", "className", "type"]);
|
|
97
99
|
// CONTEXT
|
|
98
100
|
const scUserContext = useContext(SCUserContext);
|
|
99
101
|
// STATE
|
|
@@ -104,7 +106,7 @@ export default function PrivateMessageThread(inProps) {
|
|
|
104
106
|
const [loading, setLoading] = useState(false);
|
|
105
107
|
const [isHovered, setIsHovered] = useState({});
|
|
106
108
|
const [followers, setFollowers] = useState([]);
|
|
107
|
-
const isNew =
|
|
109
|
+
const isNew = threadObj && threadObj === SCPrivateMessageStatusType.NEW;
|
|
108
110
|
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
109
111
|
const [singleMessageUser, setSingleMessageUser] = useState(null);
|
|
110
112
|
const [receiver, setReceiver] = useState(null);
|
|
@@ -113,7 +115,7 @@ export default function PrivateMessageThread(inProps) {
|
|
|
113
115
|
const [openDeleteMessageDialog, setOpenDeleteMessageDialog] = useState(false);
|
|
114
116
|
const [recipients, setRecipients] = useState([]);
|
|
115
117
|
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
|
|
116
|
-
const isNumber = typeof
|
|
118
|
+
const isNumber = typeof threadObj === 'number';
|
|
117
119
|
const messageReceiver = (item, loggedUserId) => {
|
|
118
120
|
var _a, _b, _c;
|
|
119
121
|
return ((_a = item === null || item === void 0 ? void 0 : item.receiver) === null || _a === void 0 ? void 0 : _a.id) !== loggedUserId ? (_b = item === null || item === void 0 ? void 0 : item.receiver) === null || _b === void 0 ? void 0 : _b.id : (_c = item === null || item === void 0 ? void 0 : item.sender) === null || _c === void 0 ? void 0 : _c.id;
|
|
@@ -126,7 +128,7 @@ export default function PrivateMessageThread(inProps) {
|
|
|
126
128
|
// HOOKS
|
|
127
129
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
128
130
|
// @ts-ignore
|
|
129
|
-
const { scUser } = useSCFetchUser({ id:
|
|
131
|
+
const { scUser } = useSCFetchUser({ id: threadObj, threadObj });
|
|
130
132
|
const messagesEndRef = useRef(null);
|
|
131
133
|
const scrollToBottom = () => {
|
|
132
134
|
var _a;
|
|
@@ -254,9 +256,9 @@ export default function PrivateMessageThread(inProps) {
|
|
|
254
256
|
* Fetches thread
|
|
255
257
|
*/
|
|
256
258
|
function fetchThread() {
|
|
257
|
-
if (
|
|
259
|
+
if (threadObj && typeof threadObj !== 'string' && type !== SCPrivateMessageType.GROUP) {
|
|
258
260
|
setLoadingMessageObjs(true);
|
|
259
|
-
const _userObjId = isNumber ?
|
|
261
|
+
const _userObjId = isNumber ? threadObj : messageReceiver(threadObj, authUserId);
|
|
260
262
|
PrivateMessageService.getAThread({ user: _userObjId, limit: 10 })
|
|
261
263
|
.then((res) => {
|
|
262
264
|
setMessageObjs(res.results);
|
|
@@ -289,6 +291,19 @@ export default function PrivateMessageThread(inProps) {
|
|
|
289
291
|
Logger.error(SCOPE_SC_UI, { error });
|
|
290
292
|
});
|
|
291
293
|
}
|
|
294
|
+
else if (type === SCPrivateMessageType.GROUP) {
|
|
295
|
+
PrivateMessageService.getAThread({ group: isNumber ? threadObj : threadObj.group.id, limit: 10 })
|
|
296
|
+
.then((res) => {
|
|
297
|
+
setMessageObjs(res.results);
|
|
298
|
+
setPrevious(res.next && updateAndDeleteURLParameters(res.next, 'before_message', res.results[0].id, 'offset'));
|
|
299
|
+
setLoadingMessageObjs(false);
|
|
300
|
+
})
|
|
301
|
+
.catch((error) => {
|
|
302
|
+
setLoadingMessageObjs(false);
|
|
303
|
+
console.log(error);
|
|
304
|
+
Logger.error(SCOPE_SC_UI, { error });
|
|
305
|
+
});
|
|
306
|
+
}
|
|
292
307
|
}
|
|
293
308
|
const isNewerThan60Seconds = (creationTime) => {
|
|
294
309
|
const date = new Date(creationTime);
|
|
@@ -353,11 +368,15 @@ export default function PrivateMessageThread(inProps) {
|
|
|
353
368
|
.request({
|
|
354
369
|
url: Endpoints.SendMessage.url(),
|
|
355
370
|
method: Endpoints.SendMessage.method,
|
|
356
|
-
data: {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
371
|
+
data: Object.assign(Object.assign({}, (type === SCPrivateMessageType.GROUP
|
|
372
|
+
? { group: isNumber ? threadObj : threadObj.group.id }
|
|
373
|
+
: {
|
|
374
|
+
recipients: openNewMessage || isNew || singleMessageThread
|
|
375
|
+
? ids
|
|
376
|
+
: [isNumber && threadObj ? threadObj : messageReceiver(threadObj, authUserId)]
|
|
377
|
+
})), {
|
|
378
|
+
// recipients: openNewMessage || isNew || singleMessageThread ? ids : [isNumber && threadObj ? threadObj : messageReceiver(threadObj, authUserId)],
|
|
379
|
+
message: message, file_uuid: file && !message ? file : null })
|
|
361
380
|
})
|
|
362
381
|
.then((res) => {
|
|
363
382
|
const isOne = res.data.length <= 1;
|
|
@@ -403,13 +422,13 @@ export default function PrivateMessageThread(inProps) {
|
|
|
403
422
|
if (!authUserId) {
|
|
404
423
|
return;
|
|
405
424
|
}
|
|
406
|
-
if (
|
|
425
|
+
if (threadObj) {
|
|
407
426
|
fetchThread();
|
|
408
427
|
}
|
|
409
428
|
else {
|
|
410
429
|
reset();
|
|
411
430
|
}
|
|
412
|
-
}, [
|
|
431
|
+
}, [threadObj, authUserId, scUser]);
|
|
413
432
|
/**
|
|
414
433
|
* Notification subscriber
|
|
415
434
|
*/
|
|
@@ -424,7 +443,7 @@ export default function PrivateMessageThread(inProps) {
|
|
|
424
443
|
if (index !== -1) {
|
|
425
444
|
setMessageObjs((prev) => [...prev, res.notification_obj.message]);
|
|
426
445
|
}
|
|
427
|
-
if (isNumber ?
|
|
446
|
+
if (isNumber ? threadObj === res.thread_id : threadObj.id === res.thread_id) {
|
|
428
447
|
scrollToBottom();
|
|
429
448
|
}
|
|
430
449
|
};
|
|
@@ -451,11 +470,17 @@ export default function PrivateMessageThread(inProps) {
|
|
|
451
470
|
React.createElement("ul", null,
|
|
452
471
|
React.createElement(ListSubheader, null,
|
|
453
472
|
React.createElement(Typography, { align: "center", className: classes.subHeader }, key)),
|
|
454
|
-
formattedMessages[key].map((msg) =>
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
473
|
+
formattedMessages[key].map((msg) => {
|
|
474
|
+
var _a;
|
|
475
|
+
return (React.createElement(Box, { className: classes.item, key: msg.id },
|
|
476
|
+
msg.group && ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) !== msg.sender.username && (React.createElement(ListItemAvatar, null,
|
|
477
|
+
React.createElement(Avatar, { alt: msg.sender.username, src: msg.sender.avatar, className: classes.avatar }))),
|
|
478
|
+
React.createElement(PrivateMessageThreadItem, { className: authUserId === msg.sender.id ? classes.sender : classes.receiver, message: msg, key: msg.id, mouseEvents: {
|
|
479
|
+
onMouseEnter: () => handleMouseEnter(msg.id),
|
|
480
|
+
onMouseLeave: () => handleMouseLeave(msg.id)
|
|
481
|
+
}, isHovering: isHovered[msg.id], showMenuIcon: authUserId === msg.sender.id, onMenuIconClick: () => handleOpenDeleteMessageDialog(msg) })));
|
|
482
|
+
}))))))),
|
|
483
|
+
React.createElement(PrivateMessageEditor, { className: classes.editor, send: handleSend, autoHide: type !== SCPrivateMessageType.GROUP && !(scUser === null || scUser === void 0 ? void 0 : scUser.can_send_pm_to), autoHideDeletion: type === SCPrivateMessageType.USER && ((receiver === null || receiver === void 0 ? void 0 : receiver.deleted) || (scUser === null || scUser === void 0 ? void 0 : scUser.deleted)), onThreadChangeId: isNumber ? threadObj : type === SCPrivateMessageType.USER ? threadObj.receiver.id : threadObj.group.id, error: error, onErrorRemove: () => setError(false) }),
|
|
459
484
|
openDeleteMessageDialog && (React.createElement(ConfirmDialog, { open: openDeleteMessageDialog, title: React.createElement(FormattedMessage, { id: "ui.privateMessage.component.delete.message.dialog.msg", defaultMessage: "ui.privateMessage.component.delete.message.dialog.msg" }), btnConfirm: React.createElement(FormattedMessage, { id: "ui.privateMessage.component.delete.message.dialog.confirm", defaultMessage: "ui.privateMessage.component.delete.message.dialog.confirm" }), onConfirm: handleDeleteMessage, onClose: handleCloseDeleteMessageDialog }))));
|
|
460
485
|
}
|
|
461
486
|
/**
|
|
@@ -483,5 +508,5 @@ export default function PrivateMessageThread(inProps) {
|
|
|
483
508
|
/**
|
|
484
509
|
* Renders the component
|
|
485
510
|
*/
|
|
486
|
-
return (React.createElement(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }),
|
|
511
|
+
return (React.createElement(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }), threadObj !== null && !isNew && !singleMessageThread ? renderThread() : renderNewOrNoMessageBox()));
|
|
487
512
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __rest } from "tslib";
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useContext, useState } from 'react';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import { ListItem, Typography, IconButton, Box, useTheme, Button } from '@mui/material';
|
|
5
5
|
import PrivateMessageThreadItemSkeleton from './Skeleton';
|
|
@@ -8,6 +8,7 @@ import { SCMessageFileType, SCPrivateMessageStatusType } from '@selfcommunity/ty
|
|
|
8
8
|
import Icon from '@mui/material/Icon';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { useThemeProps } from '@mui/system';
|
|
11
|
+
import { SCUserContext } from '@selfcommunity/react-core';
|
|
11
12
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
12
13
|
import PrivateMessageSettingsIconButton from '../PrivateMessageSettingsIconButton';
|
|
13
14
|
import { bytesToSize } from '../../utils/sizeCoverter';
|
|
@@ -19,6 +20,7 @@ import { PREFIX } from './constants';
|
|
|
19
20
|
import { isSupportedVideoFormat } from '../../utils/thumbnailCoverter';
|
|
20
21
|
const classes = {
|
|
21
22
|
root: `${PREFIX}-root`,
|
|
23
|
+
username: `${PREFIX}-username`,
|
|
22
24
|
text: `${PREFIX}-text`,
|
|
23
25
|
img: `${PREFIX}-img`,
|
|
24
26
|
document: `${PREFIX}-document`,
|
|
@@ -70,6 +72,7 @@ const Root = styled(ListItem, {
|
|
|
70
72
|
* @param inProps
|
|
71
73
|
*/
|
|
72
74
|
export default function PrivateMessageThreadItem(inProps) {
|
|
75
|
+
var _a;
|
|
73
76
|
// PROPS
|
|
74
77
|
const props = useThemeProps({
|
|
75
78
|
props: inProps,
|
|
@@ -78,6 +81,8 @@ export default function PrivateMessageThreadItem(inProps) {
|
|
|
78
81
|
const { message = null, className = null, mouseEvents = {}, isHovering = null, showMenuIcon = false, onMenuIconClick = null } = props, rest = __rest(props, ["message", "className", "mouseEvents", "isHovering", "showMenuIcon", "onMenuIconClick"]);
|
|
79
82
|
// INTL
|
|
80
83
|
const intl = useIntl();
|
|
84
|
+
// CONTEXT
|
|
85
|
+
const scUserContext = useContext(SCUserContext);
|
|
81
86
|
// STATE
|
|
82
87
|
const theme = useTheme();
|
|
83
88
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
@@ -165,6 +170,7 @@ export default function PrivateMessageThreadItem(inProps) {
|
|
|
165
170
|
return (React.createElement(Root, Object.assign({ className: classNames(classes.root, className) }, getMouseEvents(mouseEvents.onMouseEnter, mouseEvents.onMouseLeave), rest, { secondaryAction: (isHovering || isMobile) &&
|
|
166
171
|
showMenuIcon &&
|
|
167
172
|
message.status !== SCPrivateMessageStatusType.HIDDEN && React.createElement(PrivateMessageSettingsIconButton, { onMenuItemDeleteClick: handleMenuItemClick }) }),
|
|
173
|
+
message.group && ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) !== message.sender.username && (React.createElement(Typography, { color: "secondary", variant: "h4", className: classes.username }, message.sender.username)),
|
|
168
174
|
React.createElement(React.Fragment, null,
|
|
169
175
|
hasFile && message.status !== SCPrivateMessageStatusType.HIDDEN ? (renderMessageFile(message)) : (React.createElement(Box, { className: classes.text },
|
|
170
176
|
React.createElement(Typography, { component: "span", dangerouslySetInnerHTML: { __html: message.message } }))),
|
|
@@ -73,6 +73,25 @@ export default function SearchAutocomplete(inProps) {
|
|
|
73
73
|
setOptions([]);
|
|
74
74
|
onClear && onClear();
|
|
75
75
|
};
|
|
76
|
+
const getOptionData = (option) => {
|
|
77
|
+
let data = {};
|
|
78
|
+
if (option.type === SuggestionType.USER) {
|
|
79
|
+
data.name = option[SuggestionType.USER]['username'];
|
|
80
|
+
data.image = option[SuggestionType.USER]['avatar'];
|
|
81
|
+
data.variant = 'circular';
|
|
82
|
+
}
|
|
83
|
+
else if (option.type === SuggestionType.CATEGORY) {
|
|
84
|
+
data.name = option[SuggestionType.CATEGORY]['name'];
|
|
85
|
+
data.image = option[SuggestionType.CATEGORY]['image_medium'];
|
|
86
|
+
data.variant = 'square';
|
|
87
|
+
}
|
|
88
|
+
else if (option.type === SuggestionType.GROUP) {
|
|
89
|
+
data.name = option[SuggestionType.GROUP]['name'];
|
|
90
|
+
data.image = option[SuggestionType.GROUP]['image_big'];
|
|
91
|
+
data.variant = 'circular';
|
|
92
|
+
}
|
|
93
|
+
return data;
|
|
94
|
+
};
|
|
76
95
|
function fetchResults() {
|
|
77
96
|
setIsLoading(true);
|
|
78
97
|
SuggestionService.getSearchSuggestion(value)
|
|
@@ -96,11 +115,9 @@ export default function SearchAutocomplete(inProps) {
|
|
|
96
115
|
return option;
|
|
97
116
|
}
|
|
98
117
|
return (_a = option[option.type]['username']) !== null && _a !== void 0 ? _a : option[option.type]['name'];
|
|
99
|
-
}, renderOption: (props, option) => (React.createElement(Box, Object.assign({ component: "li" }, props),
|
|
100
|
-
React.createElement(Avatar, { alt: option
|
|
101
|
-
React.createElement(Typography, { ml: 1 }, option
|
|
102
|
-
React.createElement(Avatar, { alt: option[SuggestionType.CATEGORY]['name'], src: option[SuggestionType.CATEGORY]['image_medium'], variant: "square" }),
|
|
103
|
-
React.createElement(Typography, { ml: 1 }, option[SuggestionType.CATEGORY]['name']))))), renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { placeholder: `${intl.formatMessage(messages.placeholder, {
|
|
118
|
+
}, renderOption: (props, option) => (React.createElement(Box, Object.assign({ component: "li" }, props),
|
|
119
|
+
React.createElement(Avatar, { alt: getOptionData(option).name, src: getOptionData(option).image, variant: getOptionData(option).variant }),
|
|
120
|
+
React.createElement(Typography, { ml: 1 }, getOptionData(option).name))), renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { placeholder: `${intl.formatMessage(messages.placeholder, {
|
|
104
121
|
community: scPreferences.preferences[SCPreferences.TEXT_APPLICATION_NAME].value
|
|
105
122
|
})}`, InputProps: Object.assign(Object.assign({}, params.InputProps), { autoFocus, name: 'search-autocomplete', className: classes.input, startAdornment: React.createElement(Icon, { className: classes.icon }, "search"), endAdornment: (React.createElement(Fade, { in: value.length > 0 || Boolean(onClear), appear: false },
|
|
106
123
|
React.createElement(IconButton, { className: classes.clear, onClick: handleClear, size: "small" },
|
|
@@ -31,6 +31,7 @@ import { useThemeProps } from '@mui/system';
|
|
|
31
31
|
import ContributionNotification from '../Notification/Contribution';
|
|
32
32
|
import NotificationItem from '../../shared/NotificationItem';
|
|
33
33
|
import { PREFIX } from './constants';
|
|
34
|
+
import GroupNotification from '../Notification/Group';
|
|
34
35
|
const classes = {
|
|
35
36
|
root: `${PREFIX}-root`,
|
|
36
37
|
notificationsWrap: `${PREFIX}-notifications-wrap`,
|
|
@@ -252,6 +253,12 @@ export default function SnippetNotifications(inProps) {
|
|
|
252
253
|
else if (type === SCNotificationTypologyType.CONTRIBUTION) {
|
|
253
254
|
content = React.createElement(ContributionNotification, { notificationObject: n, key: i, template: SCNotificationObjectTemplateType.SNIPPET });
|
|
254
255
|
}
|
|
256
|
+
else if (n.type === SCNotificationTypologyType.USER_ADDED_TO_GROUP ||
|
|
257
|
+
n.type === SCNotificationTypologyType.USER_INVITED_TO_JOIN_GROUP ||
|
|
258
|
+
n.type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP ||
|
|
259
|
+
n.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP) {
|
|
260
|
+
return React.createElement(GroupNotification, { notificationObject: n, key: i, template: SCNotificationObjectTemplateType.SNIPPET });
|
|
261
|
+
}
|
|
255
262
|
if (type && handleNotification) {
|
|
256
263
|
/** Override content */
|
|
257
264
|
content = handleNotification(type, n, content);
|
|
@@ -21,6 +21,7 @@ import Message from '../BroadcastMessages/Message';
|
|
|
21
21
|
import { useThemeProps } from '@mui/system';
|
|
22
22
|
import ContributionNotification from '../Notification/Contribution';
|
|
23
23
|
import { PREFIX } from './constants';
|
|
24
|
+
import GroupNotification from '../Notification/Group';
|
|
24
25
|
const Root = styled(Box, {
|
|
25
26
|
name: PREFIX,
|
|
26
27
|
slot: 'Root'
|
|
@@ -108,6 +109,12 @@ export default function UserToastNotifications(inProps) {
|
|
|
108
109
|
else if (type === SCNotificationTypologyType.CONTRIBUTION) {
|
|
109
110
|
content = React.createElement(ContributionNotification, { notificationObject: n.notification_obj, template: SCNotificationObjectTemplateType.TOAST });
|
|
110
111
|
}
|
|
112
|
+
else if (type === SCNotificationTypologyType.USER_ADDED_TO_GROUP ||
|
|
113
|
+
type === SCNotificationTypologyType.USER_INVITED_TO_JOIN_GROUP ||
|
|
114
|
+
type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP ||
|
|
115
|
+
type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP) {
|
|
116
|
+
content = React.createElement(GroupNotification, { notificationObject: n.notification_obj, template: SCNotificationObjectTemplateType.TOAST });
|
|
117
|
+
}
|
|
111
118
|
}
|
|
112
119
|
if (n.activity_type && n.activity_type === SCNotificationTypologyType.NOTIFICATION_BANNER) {
|
|
113
120
|
/** Notification of type: 'notification_banner' */
|
|
@@ -34,6 +34,11 @@ export interface UserProps extends WidgetProps {
|
|
|
34
34
|
* Badge content to show as user avatar badge if show reaction is true.
|
|
35
35
|
*/
|
|
36
36
|
badgeContent?: any;
|
|
37
|
+
/**
|
|
38
|
+
* If true, shows a custom label next to the user username
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
isGroupAdmin?: boolean;
|
|
37
42
|
/**
|
|
38
43
|
* Prop to add actions
|
|
39
44
|
* @default null
|
|
@@ -43,7 +48,7 @@ export interface UserProps extends WidgetProps {
|
|
|
43
48
|
* Props to spread to the button
|
|
44
49
|
* @default {}
|
|
45
50
|
*/
|
|
46
|
-
buttonProps?: ButtonBaseProps;
|
|
51
|
+
buttonProps?: ButtonBaseProps | null;
|
|
47
52
|
/**
|
|
48
53
|
* Any other properties
|
|
49
54
|
*/
|
|
@@ -21,7 +21,8 @@ const messages = defineMessages({
|
|
|
21
21
|
const classes = {
|
|
22
22
|
root: `${PREFIX}-root`,
|
|
23
23
|
avatar: `${PREFIX}-avatar`,
|
|
24
|
-
staffBadgeLabel: `${PREFIX}-staff-badge-label
|
|
24
|
+
staffBadgeLabel: `${PREFIX}-staff-badge-label`,
|
|
25
|
+
groupAdminBadgeLabel: `${PREFIX}-group-admin-badge-label`
|
|
25
26
|
};
|
|
26
27
|
const Root = styled(BaseItemButton, {
|
|
27
28
|
name: PREFIX,
|
|
@@ -64,7 +65,7 @@ export default function User(inProps) {
|
|
|
64
65
|
props: inProps,
|
|
65
66
|
name: PREFIX
|
|
66
67
|
});
|
|
67
|
-
const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation, badgeContent = null, actions = null, buttonProps =
|
|
68
|
+
const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation, badgeContent = null, actions = null, isGroupAdmin = false, buttonProps = null } = props, rest = __rest(props, ["userId", "user", "handleIgnoreAction", "className", "followConnectUserButtonProps", "showFollowers", "elevation", "badgeContent", "actions", "isGroupAdmin", "buttonProps"]);
|
|
68
69
|
// STATE
|
|
69
70
|
const { scUser, setSCUser } = useSCFetchUser({ id: userId, user });
|
|
70
71
|
// CONTEXT
|
|
@@ -104,8 +105,8 @@ export default function User(inProps) {
|
|
|
104
105
|
? { onClick: () => setOpenAlert(true) }
|
|
105
106
|
: { component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUser) }), image: badgeContent ? (React.createElement(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: badgeContent },
|
|
106
107
|
React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))) : (React.createElement(UserAvatar, { hide: !hasBadge },
|
|
107
|
-
React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))), primary: hasBadge && preferences ? (React.createElement(React.Fragment, null,
|
|
108
|
+
React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))), primary: (hasBadge && preferences) || isGroupAdmin ? (React.createElement(React.Fragment, null,
|
|
108
109
|
scUser.username,
|
|
109
|
-
React.createElement(Chip, { component: "span", className: classes.staffBadgeLabel, size: "small", label: preferences[SCPreferences.STAFF_STAFF_BADGE_LABEL] }))) : (scUser.username), secondary: showFollowers ? `${intl.formatMessage(messages.userFollowers, { total: scUser.followers_counter })}` : scUser.description, actions: actions !== null && actions !== void 0 ? actions : renderAuthenticatedActions() })),
|
|
110
|
+
React.createElement(Chip, { component: "span", className: isGroupAdmin ? classes.groupAdminBadgeLabel : classes.staffBadgeLabel, size: "small", label: isGroupAdmin ? (React.createElement(FormattedMessage, { defaultMessage: "ui.user.group.admin", id: "ui.user.group.admin" })) : (preferences[SCPreferences.STAFF_STAFF_BADGE_LABEL]) }))) : (scUser.username), secondary: showFollowers ? `${intl.formatMessage(messages.userFollowers, { total: scUser.followers_counter })}` : scUser.description, actions: actions !== null && actions !== void 0 ? actions : renderAuthenticatedActions() })),
|
|
110
111
|
openAlert && React.createElement(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })));
|
|
111
112
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* > API documentation for the Community-JS User Profile Categories Followed Widget Skeleton component. Learn about the available props and the CSS API.
|
|
3
|
+
|
|
4
|
+
#### Import
|
|
5
|
+
|
|
6
|
+
```jsx
|
|
7
|
+
import {UserSubscribedGroupsWidgetSkeleton} from '@selfcommunity/react-ui';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### Component Name
|
|
11
|
+
|
|
12
|
+
The name `SCUserCategoriesFollowedWidget-skeleton-root` can be used when providing style overrides in the theme.
|
|
13
|
+
|
|
14
|
+
#### CSS
|
|
15
|
+
|
|
16
|
+
|Rule Name|Global class|Description|
|
|
17
|
+
|---|---|---|
|
|
18
|
+
|root|.SCUserSubscribedGroupsWidget-skeleton-root|Styles applied to the root element.|
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export default function UserSubscribedGroupsWidgetSkeleton(props: any): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Widget from '../Widget';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { CardContent, ListItem } from '@mui/material';
|
|
5
|
+
import List from '@mui/material/List';
|
|
6
|
+
import GroupSkeleton from '../Group/Skeleton';
|
|
7
|
+
const PREFIX = 'SCUserSubscribedGroupsWidgetSkeleton';
|
|
8
|
+
const classes = {
|
|
9
|
+
root: `${PREFIX}-skeleton-root`,
|
|
10
|
+
list: `${PREFIX}-list`
|
|
11
|
+
};
|
|
12
|
+
const Root = styled(Widget, {
|
|
13
|
+
name: PREFIX,
|
|
14
|
+
slot: 'SkeletonRoot'
|
|
15
|
+
})(() => ({}));
|
|
16
|
+
/**
|
|
17
|
+
* > API documentation for the Community-JS User Profile Categories Followed Widget Skeleton component. Learn about the available props and the CSS API.
|
|
18
|
+
|
|
19
|
+
#### Import
|
|
20
|
+
|
|
21
|
+
```jsx
|
|
22
|
+
import {UserSubscribedGroupsWidgetSkeleton} from '@selfcommunity/react-ui';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Component Name
|
|
26
|
+
|
|
27
|
+
The name `SCUserCategoriesFollowedWidget-skeleton-root` can be used when providing style overrides in the theme.
|
|
28
|
+
|
|
29
|
+
#### CSS
|
|
30
|
+
|
|
31
|
+
|Rule Name|Global class|Description|
|
|
32
|
+
|---|---|---|
|
|
33
|
+
|root|.SCUserSubscribedGroupsWidget-skeleton-root|Styles applied to the root element.|
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export default function UserSubscribedGroupsWidgetSkeleton(props) {
|
|
37
|
+
return (React.createElement(Root, Object.assign({ className: classes.root }, props),
|
|
38
|
+
React.createElement(CardContent, null,
|
|
39
|
+
React.createElement(List, { className: classes.list }, [...Array(3)].map((category, index) => (React.createElement(ListItem, { key: index },
|
|
40
|
+
React.createElement(GroupSkeleton, { elevation: 0 })))))),
|
|
41
|
+
");"));
|
|
42
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
2
|
+
import { BaseDialogProps } from '../../shared/BaseDialog';
|
|
3
|
+
import { WidgetProps } from '../Widget';
|
|
4
|
+
import { VirtualScrollerItemProps } from '../../types/virtualScroller';
|
|
5
|
+
import { GroupProps } from '../Group';
|
|
6
|
+
export interface UserSubscribedGroupsWidgetProps extends VirtualScrollerItemProps, WidgetProps {
|
|
7
|
+
/**
|
|
8
|
+
* The user id
|
|
9
|
+
* @default null
|
|
10
|
+
*/
|
|
11
|
+
userId: number;
|
|
12
|
+
/**
|
|
13
|
+
* Hides this component
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
autoHide?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Limit the number of groups to show
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
limit?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Props to spread to single group object
|
|
24
|
+
* @default empty object
|
|
25
|
+
*/
|
|
26
|
+
GroupProps?: GroupProps;
|
|
27
|
+
/**
|
|
28
|
+
* Caching strategies
|
|
29
|
+
* @default CacheStrategies.CACHE_FIRST
|
|
30
|
+
*/
|
|
31
|
+
cacheStrategy?: CacheStrategies;
|
|
32
|
+
/**
|
|
33
|
+
* Props to spread to subscribed groups dialog
|
|
34
|
+
* @default {}
|
|
35
|
+
*/
|
|
36
|
+
DialogProps?: BaseDialogProps;
|
|
37
|
+
/**
|
|
38
|
+
* Other props
|
|
39
|
+
*/
|
|
40
|
+
[p: string]: any;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* > API documentation for the Community-JS User Profile Groups Subscribed Widget component. Learn about the available props and the CSS API.
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
* This component renders the list of the groups that the given user follows.
|
|
47
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/UserSubscribedGroups)
|
|
48
|
+
|
|
49
|
+
#### Import
|
|
50
|
+
```jsx
|
|
51
|
+
import {UserSubscribedGroupsWidget} from '@selfcommunity/react-ui';
|
|
52
|
+
```
|
|
53
|
+
#### Component Name
|
|
54
|
+
The name `SCUserSubscribedGroupsWidget` can be used when providing style overrides in the theme.
|
|
55
|
+
|
|
56
|
+
#### CSS
|
|
57
|
+
|
|
58
|
+
|Rule Name|Global class|Description|
|
|
59
|
+
|---|---|---|
|
|
60
|
+
|root|.SCUserSubscribedGroupsWidget-root|Styles applied to the root element.|
|
|
61
|
+
|title|.SCUserSubscribedGroupsWidget-title|Styles applied to the title element.|
|
|
62
|
+
|noResults|.SCUserSubscribedGroupsWidget-no-results|Styles applied to no results section.|
|
|
63
|
+
|showMore|.SCUserSubscribedGroupsWidget-show-more|Styles applied to show more button element.|
|
|
64
|
+
|dialogRoot|.SCUserSubscribedGroupsWidget-dialog-root|Styles applied to the root dialog element.|
|
|
65
|
+
|endMessage|.SCUserSubscribedGroupsWidget-end-message|Styles applied to the end message element.|
|
|
66
|
+
* @param inProps
|
|
67
|
+
*/
|
|
68
|
+
export default function UserSubscribedGroupsWidget(inProps: UserSubscribedGroupsWidgetProps): JSX.Element;
|