@selfcommunity/react-templates 0.5.0-alpha.3 → 0.5.0-alpha.30
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/Category/Category.js +1 -2
- package/lib/cjs/components/Category/Skeleton.js +1 -2
- package/lib/cjs/components/CategoryFeed/CategoryFeed.js +27 -9
- package/lib/cjs/components/CategoryFeed/Skeleton.js +2 -2
- package/lib/cjs/components/Event/Event.js +1 -2
- package/lib/cjs/components/Event/Skeleton.js +1 -2
- package/lib/cjs/components/EventFeed/EventFeed.js +48 -30
- package/lib/cjs/components/EventFeed/Skeleton.js +2 -2
- package/lib/cjs/components/ExploreFeed/ExploreFeed.js +19 -11
- package/lib/cjs/components/ExploreFeed/Skeleton.js +2 -2
- package/lib/cjs/components/FeedObjectDetail/FeedObjectDetail.js +5 -4
- package/lib/cjs/components/FeedObjectDetail/Skeleton.js +1 -2
- package/lib/cjs/components/Group/Group.js +1 -2
- package/lib/cjs/components/Group/Skeleton.js +1 -2
- package/lib/cjs/components/GroupFeed/GroupFeed.js +39 -20
- package/lib/cjs/components/GroupFeed/Skeleton.js +2 -2
- package/lib/cjs/components/Lesson/Lesson.js +2 -3
- package/lib/cjs/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +2 -4
- package/lib/cjs/components/LoyaltyProgramDetail/PointsList.js +1 -2
- package/lib/cjs/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +1 -2
- package/lib/cjs/components/LoyaltyProgramDetail/Skeleton.js +1 -2
- package/lib/cjs/components/MainFeed/MainFeed.js +19 -11
- package/lib/cjs/components/MainFeed/Skeleton.js +2 -2
- package/lib/cjs/components/NotificationFeed/NotificationFeed.js +13 -6
- package/lib/cjs/components/NotificationFeed/Skeleton.js +2 -2
- package/lib/cjs/components/UserFeed/Skeleton.js +2 -2
- package/lib/cjs/components/UserFeed/UserFeed.js +18 -10
- package/lib/cjs/components/UserProfile/Skeleton.js +1 -2
- package/lib/cjs/components/UserProfile/UserProfile.js +6 -4
- package/lib/esm/components/Category/Category.js +1 -2
- package/lib/esm/components/Category/Skeleton.js +1 -2
- package/lib/esm/components/CategoryFeed/CategoryFeed.js +29 -11
- package/lib/esm/components/CategoryFeed/Skeleton.js +1 -1
- package/lib/esm/components/Event/Event.js +1 -2
- package/lib/esm/components/Event/Skeleton.js +1 -2
- package/lib/esm/components/EventFeed/EventFeed.js +49 -31
- package/lib/esm/components/EventFeed/Skeleton.js +1 -1
- package/lib/esm/components/ExploreFeed/ExploreFeed.js +19 -11
- package/lib/esm/components/ExploreFeed/Skeleton.js +1 -1
- package/lib/esm/components/FeedObjectDetail/FeedObjectDetail.js +5 -4
- package/lib/esm/components/FeedObjectDetail/Skeleton.js +1 -2
- package/lib/esm/components/Group/Group.js +1 -2
- package/lib/esm/components/Group/Skeleton.js +1 -2
- package/lib/esm/components/GroupFeed/GroupFeed.js +41 -22
- package/lib/esm/components/GroupFeed/Skeleton.js +1 -1
- package/lib/esm/components/Lesson/Lesson.js +1 -2
- package/lib/esm/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +1 -3
- package/lib/esm/components/LoyaltyProgramDetail/PointsList.js +1 -2
- package/lib/esm/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +1 -2
- package/lib/esm/components/LoyaltyProgramDetail/Skeleton.js +1 -2
- package/lib/esm/components/MainFeed/MainFeed.js +19 -11
- package/lib/esm/components/MainFeed/Skeleton.js +1 -1
- package/lib/esm/components/NotificationFeed/NotificationFeed.js +13 -6
- package/lib/esm/components/NotificationFeed/Skeleton.js +1 -1
- package/lib/esm/components/UserFeed/Skeleton.js +1 -1
- package/lib/esm/components/UserFeed/UserFeed.js +18 -10
- package/lib/esm/components/UserProfile/Skeleton.js +1 -2
- package/lib/esm/components/UserProfile/UserProfile.js +6 -4
- package/lib/umd/{c473ce30406a3dad83e1.eot → 30b299174b4fa1fb9ce8.eot} +0 -0
- package/lib/umd/{b6dbec3d5816ff8baef1.woff → 3b49304a98beb1239bc7.ttf} +0 -0
- package/lib/umd/589.js +2 -0
- package/lib/umd/738.js +1 -1
- package/lib/umd/73cbb3dbfaa3ddd4df47.js +2 -0
- package/lib/umd/73cbb3dbfaa3ddd4df47.js.LICENSE.txt +21 -0
- package/lib/umd/ab247f43e550f5f6d0f8.woff2 +0 -0
- package/lib/umd/{ba74e493633796d551d1.ttf → ce10db0c87e7112cb315.woff} +0 -0
- package/lib/umd/{6158171e38cbff3c3340.svg → fff8590360ed9eed64ae.svg} +75 -69
- package/lib/umd/react-templates.js +1 -1
- package/package.json +9 -6
- package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
- package/lib/umd/916.js +0 -2
- /package/lib/umd/{916.js.LICENSE.txt → 589.js.LICENSE.txt} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { styled } from '@mui/material/styles';
|
|
5
4
|
import { SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
|
|
6
|
-
import { Divider, Grid, Typography } from '@mui/material';
|
|
5
|
+
import { Divider, Grid, Typography, styled } from '@mui/material';
|
|
7
6
|
import { FormattedMessage } from 'react-intl';
|
|
8
7
|
import classNames from 'classnames';
|
|
9
8
|
const PREFERENCES = [
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { styled } from '@mui/material
|
|
3
|
-
import { Typography, CardContent, Skeleton, CardActions, CardMedia, Button } from '@mui/material';
|
|
2
|
+
import { Typography, CardContent, Skeleton, CardActions, CardMedia, Button, styled } from '@mui/material';
|
|
4
3
|
import { Widget } from '@selfcommunity/react-ui';
|
|
5
4
|
import { PREFIX } from './constants';
|
|
6
5
|
const classes = {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { styled } from '@mui/material
|
|
3
|
-
import { Typography, Grid, Skeleton, Box, useTheme, useMediaQuery } from '@mui/material';
|
|
2
|
+
import { Typography, Grid, Skeleton, Box, useTheme, useMediaQuery, styled } from '@mui/material';
|
|
4
3
|
import PrizeItemSkeleton from './PrizeItemSkeleton';
|
|
5
4
|
import { PREFIX } from './constants';
|
|
6
5
|
const classes = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useRef } from 'react';
|
|
3
|
-
import { styled } from '@mui/material
|
|
4
|
-
import { CategoriesSuggestionWidget, Feed, FeedObject, FeedObjectSkeleton, SCFeedObjectTemplateType, InlineComposerWidget, LoyaltyProgramWidget, UserSuggestionWidget, PlatformWidget, OnBoardingWidget } from '@selfcommunity/react-ui';
|
|
3
|
+
import { styled } from '@mui/material';
|
|
4
|
+
import { CategoriesSuggestionWidget, Feed, FeedObject, FeedObjectSkeleton, SCFeedObjectTemplateType, InlineComposerWidget, LoyaltyProgramWidget, UserSuggestionWidget, PlatformWidget, OnBoardingWidget, FooterWidget } from '@selfcommunity/react-ui';
|
|
5
5
|
import { Endpoints } from '@selfcommunity/api-services';
|
|
6
6
|
import { SCUserContext, UserUtils } from '@selfcommunity/react-core';
|
|
7
7
|
import { useThemeProps } from '@mui/system';
|
|
@@ -21,31 +21,38 @@ const Root = styled(Feed, {
|
|
|
21
21
|
const WIDGETS = [
|
|
22
22
|
{
|
|
23
23
|
type: 'widget',
|
|
24
|
-
component:
|
|
24
|
+
component: FooterWidget,
|
|
25
25
|
componentProps: {},
|
|
26
26
|
column: 'right',
|
|
27
27
|
position: 0
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
type: 'widget',
|
|
31
|
-
component:
|
|
31
|
+
component: PlatformWidget,
|
|
32
32
|
componentProps: {},
|
|
33
33
|
column: 'right',
|
|
34
34
|
position: 1
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: 'widget',
|
|
38
|
-
component:
|
|
38
|
+
component: LoyaltyProgramWidget,
|
|
39
39
|
componentProps: {},
|
|
40
40
|
column: 'right',
|
|
41
41
|
position: 2
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
type: 'widget',
|
|
45
|
-
component:
|
|
45
|
+
component: CategoriesSuggestionWidget,
|
|
46
46
|
componentProps: {},
|
|
47
47
|
column: 'right',
|
|
48
48
|
position: 3
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'widget',
|
|
52
|
+
component: UserSuggestionWidget,
|
|
53
|
+
componentProps: {},
|
|
54
|
+
column: 'right',
|
|
55
|
+
position: 4
|
|
49
56
|
}
|
|
50
57
|
];
|
|
51
58
|
/**
|
|
@@ -91,7 +98,8 @@ export default function MainFeed(inProps) {
|
|
|
91
98
|
}
|
|
92
99
|
// HANDLERS
|
|
93
100
|
const handleComposerSuccess = (feedObject) => {
|
|
94
|
-
|
|
101
|
+
const messageId = feedObject.scheduled_at ? 'ui.composer.scheduled.success' : 'ui.inlineComposerWidget.success';
|
|
102
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: messageId, defaultMessage: messageId }), {
|
|
95
103
|
variant: 'success',
|
|
96
104
|
autoHideDuration: 3000
|
|
97
105
|
});
|
|
@@ -99,10 +107,10 @@ export default function MainFeed(inProps) {
|
|
|
99
107
|
const feedUnit = {
|
|
100
108
|
type: feedObject.type,
|
|
101
109
|
[feedObject.type]: feedObject,
|
|
102
|
-
|
|
110
|
+
seen: false,
|
|
103
111
|
has_boost: false
|
|
104
112
|
};
|
|
105
|
-
feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
|
|
113
|
+
!feedObject.draft && feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
|
|
106
114
|
};
|
|
107
115
|
const handleAddGenerationContent = (feedObjects) => {
|
|
108
116
|
if (feedRef && feedRef.current) {
|
|
@@ -112,7 +120,7 @@ export default function MainFeed(inProps) {
|
|
|
112
120
|
const feedUnit = {
|
|
113
121
|
type: feedObject.type,
|
|
114
122
|
[feedObject.type]: feedObject,
|
|
115
|
-
|
|
123
|
+
seen: false,
|
|
116
124
|
has_boost: false
|
|
117
125
|
};
|
|
118
126
|
feedRef.current.addFeedData(feedUnit, true);
|
|
@@ -124,7 +132,7 @@ export default function MainFeed(inProps) {
|
|
|
124
132
|
feedObject: item[item.type],
|
|
125
133
|
feedObjectType: item.type,
|
|
126
134
|
feedObjectActivities: item.activities ? item.activities : null,
|
|
127
|
-
markRead: scUser ? !item.
|
|
135
|
+
markRead: scUser ? !item.seen : null
|
|
128
136
|
}), itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: FeedObjectSkeleton, ItemSkeletonProps: {
|
|
129
137
|
template: SCFeedObjectTemplateType.PREVIEW
|
|
130
138
|
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: _jsxs(_Fragment, { children: [_jsx(InlineComposerWidget, { onSuccess: handleComposerSuccess }), UserUtils.isAdmin(scUserContext.user) && _jsx(OnBoardingWidget, { onGeneratedContent: handleAddGenerationContent })] }), requireAuthentication: true, disablePaginationLinks: true, enabledCustomAdvPositions: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { styled } from '@mui/material
|
|
3
|
+
import { styled } from '@mui/material';
|
|
4
4
|
import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
|
|
5
5
|
import { PREFIX } from './constants';
|
|
6
6
|
const classes = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from 'react';
|
|
3
|
-
import { styled } from '@mui/material
|
|
4
|
-
import { BroadcastMessages, CategoriesSuggestionWidget, Feed, SCFeedObjectTemplateType, FeedUpdatesWidget, LoyaltyProgramWidget, Notification, NotificationSkeleton, UserSuggestionWidget, PlatformWidget, getUnseenNotificationCounter } from '@selfcommunity/react-ui';
|
|
3
|
+
import { styled } from '@mui/material';
|
|
4
|
+
import { BroadcastMessages, CategoriesSuggestionWidget, Feed, SCFeedObjectTemplateType, FeedUpdatesWidget, LoyaltyProgramWidget, Notification, NotificationSkeleton, UserSuggestionWidget, PlatformWidget, getUnseenNotificationCounter, FooterWidget } from '@selfcommunity/react-ui';
|
|
5
5
|
import { Endpoints } from '@selfcommunity/api-services';
|
|
6
6
|
import { SCUserContext } from '@selfcommunity/react-core';
|
|
7
7
|
import { SCNotificationTopicType } from '@selfcommunity/types';
|
|
@@ -34,31 +34,38 @@ const WIDGETS = [
|
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
type: 'widget',
|
|
37
|
-
component:
|
|
37
|
+
component: FooterWidget,
|
|
38
38
|
componentProps: {},
|
|
39
39
|
column: 'right',
|
|
40
40
|
position: 0
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
type: 'widget',
|
|
44
|
-
component:
|
|
44
|
+
component: PlatformWidget,
|
|
45
45
|
componentProps: {},
|
|
46
46
|
column: 'right',
|
|
47
47
|
position: 1
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
type: 'widget',
|
|
51
|
-
component:
|
|
51
|
+
component: LoyaltyProgramWidget,
|
|
52
52
|
componentProps: {},
|
|
53
53
|
column: 'right',
|
|
54
54
|
position: 2
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
type: 'widget',
|
|
58
|
-
component:
|
|
58
|
+
component: CategoriesSuggestionWidget,
|
|
59
59
|
componentProps: {},
|
|
60
60
|
column: 'right',
|
|
61
61
|
position: 3
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type: 'widget',
|
|
65
|
+
component: UserSuggestionWidget,
|
|
66
|
+
componentProps: {},
|
|
67
|
+
column: 'right',
|
|
68
|
+
position: 4
|
|
62
69
|
}
|
|
63
70
|
];
|
|
64
71
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { styled } from '@mui/material
|
|
3
|
+
import { styled } from '@mui/material';
|
|
4
4
|
import { FeedSkeleton, GenericSkeleton, NotificationSkeleton } from '@selfcommunity/react-ui';
|
|
5
5
|
import { PREFIX } from './constants';
|
|
6
6
|
const classes = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { styled } from '@mui/material
|
|
3
|
+
import { styled } from '@mui/material';
|
|
4
4
|
import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
|
|
5
5
|
import { PREFIX } from './constants';
|
|
6
6
|
const classes = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useRef } from 'react';
|
|
3
|
-
import { styled } from '@mui/material
|
|
3
|
+
import { styled } from '@mui/material';
|
|
4
4
|
import { Endpoints } from '@selfcommunity/api-services';
|
|
5
5
|
import { useSCFetchUser, useSCUser } from '@selfcommunity/react-core';
|
|
6
|
-
import { Feed, FeedObject, FeedObjectSkeleton, InlineComposerWidget, SCFeedObjectTemplateType, UserFollowedCategoriesWidget, UserFollowedUsersWidget, UserFollowersWidget, UserLiveStreamWidget } from '@selfcommunity/react-ui';
|
|
6
|
+
import { Feed, FeedObject, FeedObjectSkeleton, FooterWidget, InlineComposerWidget, SCFeedObjectTemplateType, UserFollowedCategoriesWidget, UserFollowedUsersWidget, UserFollowersWidget, UserLiveStreamWidget } from '@selfcommunity/react-ui';
|
|
7
7
|
import { UserFeedSkeleton } from './index';
|
|
8
8
|
import { useThemeProps } from '@mui/system';
|
|
9
9
|
import classNames from 'classnames';
|
|
@@ -21,31 +21,38 @@ const Root = styled(Feed, {
|
|
|
21
21
|
const WIDGETS = [
|
|
22
22
|
{
|
|
23
23
|
type: 'widget',
|
|
24
|
-
component:
|
|
24
|
+
component: FooterWidget,
|
|
25
25
|
componentProps: {},
|
|
26
26
|
column: 'right',
|
|
27
27
|
position: 0
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
type: 'widget',
|
|
31
|
-
component:
|
|
31
|
+
component: UserLiveStreamWidget,
|
|
32
32
|
componentProps: {},
|
|
33
33
|
column: 'right',
|
|
34
34
|
position: 1
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: 'widget',
|
|
38
|
-
component:
|
|
38
|
+
component: UserFollowedCategoriesWidget,
|
|
39
39
|
componentProps: {},
|
|
40
40
|
column: 'right',
|
|
41
41
|
position: 2
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
type: 'widget',
|
|
45
|
-
component:
|
|
45
|
+
component: UserFollowedUsersWidget,
|
|
46
46
|
componentProps: {},
|
|
47
47
|
column: 'right',
|
|
48
48
|
position: 3
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'widget',
|
|
52
|
+
component: UserFollowersWidget,
|
|
53
|
+
componentProps: {},
|
|
54
|
+
column: 'right',
|
|
55
|
+
position: 4
|
|
49
56
|
}
|
|
50
57
|
];
|
|
51
58
|
/**
|
|
@@ -89,7 +96,8 @@ export default function UserFeed(inProps) {
|
|
|
89
96
|
const feedRef = useRef();
|
|
90
97
|
// HANDLERS
|
|
91
98
|
const handleComposerSuccess = (feedObject) => {
|
|
92
|
-
|
|
99
|
+
const messageId = feedObject.scheduled_at ? 'ui.composer.scheduled.success' : 'ui.inlineComposerWidget.success';
|
|
100
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: messageId, defaultMessage: messageId }), {
|
|
93
101
|
variant: 'success',
|
|
94
102
|
autoHideDuration: 3000
|
|
95
103
|
});
|
|
@@ -97,10 +105,10 @@ export default function UserFeed(inProps) {
|
|
|
97
105
|
const feedUnit = {
|
|
98
106
|
type: feedObject.type,
|
|
99
107
|
[feedObject.type]: feedObject,
|
|
100
|
-
|
|
108
|
+
seen: false,
|
|
101
109
|
has_boost: false
|
|
102
110
|
};
|
|
103
|
-
feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
|
|
111
|
+
!feedObject.draft && feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
|
|
104
112
|
};
|
|
105
113
|
// WIDGETS
|
|
106
114
|
const _widgets = useMemo(() => widgets.map((w) => {
|
|
@@ -109,7 +117,7 @@ export default function UserFeed(inProps) {
|
|
|
109
117
|
if (scUser === null) {
|
|
110
118
|
return _jsx(UserFeedSkeleton, {});
|
|
111
119
|
}
|
|
112
|
-
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className), ref: feedRef, endpoint: Object.assign(Object.assign({}, Endpoints.UserFeed), { url: () => Endpoints.UserFeed.url({ id: scUser.id }) }), widgets: _widgets, ItemComponent: FeedObject, itemPropsGenerator: (
|
|
120
|
+
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className), ref: feedRef, endpoint: Object.assign(Object.assign({}, Endpoints.UserFeed), { url: () => Endpoints.UserFeed.url({ id: scUser.id }) }), widgets: _widgets, ItemComponent: FeedObject, itemPropsGenerator: (_scUser, item) => ({
|
|
113
121
|
feedObject: item[item.type],
|
|
114
122
|
feedObjectType: item.type,
|
|
115
123
|
feedObjectActivities: item.activities ? item.activities : null
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@mui/material';
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { Box, styled } from '@mui/material';
|
|
4
3
|
import { UserProfileHeaderSkeleton } from '@selfcommunity/react-ui';
|
|
5
4
|
import UserFeedSkeleton from '../UserFeed/Skeleton';
|
|
6
5
|
import { PREFIX } from './constants';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { styled } from '@mui/material
|
|
4
|
-
import { Box, Button, Icon, Stack, Typography } from '@mui/material';
|
|
3
|
+
import { Box, Button, Icon, Stack, Typography, styled } from '@mui/material';
|
|
5
4
|
import { ConnectionUserButton, LoyaltyProgramWidget, TagChip, UserActionIconButton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsWidget, UserConnectionsWidget, UserCounters, UserCreatedCoursesWidget, UserFollowedCategoriesWidget, UserFollowedUsersWidget, UserFollowersWidget, UserLiveStreamWidget, UserProfileBlocked, UserProfileHeader, UserSubscribedGroupsWidget } from '@selfcommunity/react-ui';
|
|
6
5
|
import UserFeed from '../UserFeed';
|
|
7
6
|
import { SCPreferences, SCRoutes, useSCFetchUser, useSCPreferences, useSCRouting, useSCUser, useSCFetchUserBlockedBy } from '@selfcommunity/react-core';
|
|
@@ -183,13 +182,16 @@ export default function UserProfile(inProps) {
|
|
|
183
182
|
const isMe = useMemo(() => scUserContext.user && (scUser === null || scUser === void 0 ? void 0 : scUser.id) === scUserContext.user.id, [scUserContext.user, scUser]);
|
|
184
183
|
const followEnabled = useMemo(() => SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED in scPreferencesContext.preferences &&
|
|
185
184
|
scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED].value, [scPreferencesContext.preferences]);
|
|
186
|
-
const
|
|
185
|
+
const connectionEnabled = SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED in scPreferencesContext.preferences &&
|
|
186
|
+
scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED].value;
|
|
187
|
+
const privateMessagingEnabled = useMemo(() => SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED in scPreferencesContext.preferences &&
|
|
188
|
+
scPreferencesContext.preferences[SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED].value, [scPreferencesContext.preferences]);
|
|
187
189
|
const _widgets = useMemo(() => {
|
|
188
190
|
var _a, _b;
|
|
189
191
|
if (widgets !== null) {
|
|
190
192
|
return widgets;
|
|
191
193
|
}
|
|
192
|
-
if (!scUser) {
|
|
194
|
+
if (!scUser || (!followEnabled && !connectionEnabled)) {
|
|
193
195
|
return [];
|
|
194
196
|
}
|
|
195
197
|
let _widgets = [];
|
|
Binary file
|
|
Binary file
|