@selfcommunity/react-templates 0.3.50-events.41 → 0.3.50-events.44
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 +3 -5
- package/lib/cjs/components/Category/Skeleton.js +2 -4
- package/lib/cjs/components/CategoryFeed/CategoryFeed.js +7 -7
- package/lib/cjs/components/CategoryFeed/Skeleton.js +2 -5
- package/lib/cjs/components/Event/Event.js +3 -5
- package/lib/cjs/components/Event/Skeleton.js +2 -4
- package/lib/cjs/components/EventFeed/EventFeed.js +10 -12
- package/lib/cjs/components/EventFeed/Skeleton.js +2 -5
- package/lib/cjs/components/ExploreFeed/ExploreFeed.js +5 -4
- package/lib/cjs/components/ExploreFeed/Skeleton.js +2 -5
- package/lib/cjs/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
- package/lib/cjs/components/FeedObjectDetail/Skeleton.js +2 -9
- package/lib/cjs/components/Group/Group.js +3 -5
- package/lib/cjs/components/Group/Skeleton.js +2 -4
- package/lib/cjs/components/GroupFeed/GroupFeed.js +8 -8
- package/lib/cjs/components/GroupFeed/Skeleton.js +2 -5
- package/lib/cjs/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
- package/lib/cjs/components/LoyaltyProgramDetail/PointsList.js +4 -17
- package/lib/cjs/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -14
- package/lib/cjs/components/LoyaltyProgramDetail/Skeleton.js +2 -16
- package/lib/cjs/components/MainFeed/MainFeed.js +5 -4
- package/lib/cjs/components/MainFeed/Skeleton.js +2 -5
- package/lib/cjs/components/NotificationFeed/NotificationFeed.js +3 -2
- package/lib/cjs/components/NotificationFeed/Skeleton.js +2 -3
- package/lib/cjs/components/UserFeed/Skeleton.js +2 -5
- package/lib/cjs/components/UserFeed/UserFeed.js +6 -5
- package/lib/cjs/components/UserProfile/Skeleton.js +2 -4
- package/lib/cjs/components/UserProfile/UserProfile.js +13 -30
- package/lib/esm/components/Category/Category.js +3 -5
- package/lib/esm/components/Category/Skeleton.js +2 -4
- package/lib/esm/components/CategoryFeed/CategoryFeed.js +7 -7
- package/lib/esm/components/CategoryFeed/Skeleton.js +2 -5
- package/lib/esm/components/Event/Event.js +3 -5
- package/lib/esm/components/Event/Skeleton.js +2 -4
- package/lib/esm/components/EventFeed/EventFeed.js +10 -12
- package/lib/esm/components/EventFeed/Skeleton.js +2 -5
- package/lib/esm/components/ExploreFeed/ExploreFeed.js +5 -4
- package/lib/esm/components/ExploreFeed/Skeleton.js +2 -5
- package/lib/esm/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
- package/lib/esm/components/FeedObjectDetail/Skeleton.js +2 -8
- package/lib/esm/components/Group/Group.js +3 -5
- package/lib/esm/components/Group/Skeleton.js +2 -4
- package/lib/esm/components/GroupFeed/GroupFeed.js +8 -8
- package/lib/esm/components/GroupFeed/Skeleton.js +2 -5
- package/lib/esm/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
- package/lib/esm/components/LoyaltyProgramDetail/PointsList.js +4 -17
- package/lib/esm/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -13
- package/lib/esm/components/LoyaltyProgramDetail/Skeleton.js +2 -16
- package/lib/esm/components/MainFeed/MainFeed.js +5 -4
- package/lib/esm/components/MainFeed/Skeleton.js +2 -5
- package/lib/esm/components/NotificationFeed/NotificationFeed.js +3 -2
- package/lib/esm/components/NotificationFeed/Skeleton.js +2 -3
- package/lib/esm/components/UserFeed/Skeleton.js +2 -5
- package/lib/esm/components/UserFeed/UserFeed.js +6 -5
- package/lib/esm/components/UserProfile/Skeleton.js +2 -4
- package/lib/esm/components/UserProfile/UserProfile.js +13 -30
- package/lib/umd/react-templates.js +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
3
|
import { styled } from '@mui/material/styles';
|
|
3
4
|
import { Box, Button, Icon, Stack, Typography } from '@mui/material';
|
|
4
5
|
import { ConnectionUserButton, LoyaltyProgramWidget, TagChip, UserActionIconButton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsWidget, UserConnectionsWidget, UserCounters, UserFollowedCategoriesWidget, UserFollowedUsersWidget, UserFollowersWidget, UserProfileBlocked, UserProfileHeader, UserSubscribedGroupsWidget, } from '@selfcommunity/react-ui';
|
|
@@ -202,7 +203,7 @@ export default function UserProfile(inProps) {
|
|
|
202
203
|
}
|
|
203
204
|
}, [isConnection, scUserContext.managers.followers, scUserContext.managers.connections, followEnabled, isMe, user, scUserContext.user]);
|
|
204
205
|
if (!scUser) {
|
|
205
|
-
return
|
|
206
|
+
return _jsx(UserProfileSkeleton, {});
|
|
206
207
|
}
|
|
207
208
|
// HANDLERS
|
|
208
209
|
const handleEdit = () => {
|
|
@@ -216,36 +217,18 @@ export default function UserProfile(inProps) {
|
|
|
216
217
|
if (privateMessagingEnabled && !isMe && user && user.can_send_pm_to) {
|
|
217
218
|
actionItems = [
|
|
218
219
|
{
|
|
219
|
-
label:
|
|
220
|
+
label: _jsx(FormattedMessage, { defaultMessage: "templates.userProfile.send.pm", id: "templates.userProfile.send.pm" }),
|
|
220
221
|
to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, scUser)
|
|
221
222
|
}
|
|
222
223
|
];
|
|
223
224
|
}
|
|
224
|
-
return (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
scUserContext.user === undefined ||
|
|
234
|
-
(scUserContext.user && ((loadingBlockedBy && blockedBy === null) || scUserContext.managers.blockedUsers.isLoading())) ? (React.createElement(UserFeedSkeleton, null)) : (React.createElement(React.Fragment, null, loadingBlockedBy || (scUserContext.user && scUserContext.managers.blockedUsers.loading) ? null : (React.createElement(React.Fragment, null, !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? (React.createElement(UserProfileBlocked, { user: scUser, blockedByUser: blockedBy })) : (React.createElement(React.Fragment, null,
|
|
235
|
-
React.createElement(UserCounters, { className: classes.counters, userId: userId, user: scUser }),
|
|
236
|
-
scUser.date_joined && (React.createElement(Typography, { className: classes.info },
|
|
237
|
-
React.createElement(FormattedMessage, { id: "templates.userProfile.dateJoined", defaultMessage: "templates.userProfile.dateJoined", values: {
|
|
238
|
-
date: intl.formatDate(scUser.date_joined, {
|
|
239
|
-
year: 'numeric',
|
|
240
|
-
month: 'long'
|
|
241
|
-
})
|
|
242
|
-
} }))),
|
|
243
|
-
scUser.location && (React.createElement(Typography, { className: classes.info },
|
|
244
|
-
React.createElement(Icon, null, "add_location_alt"),
|
|
245
|
-
" ",
|
|
246
|
-
scUser.location)),
|
|
247
|
-
taggingEnabled && (React.createElement(Stack, { key: `tags_${scUser.id}`, direction: "row", spacing: 2, className: classes.tags }, scUser.tags
|
|
248
|
-
.filter((t) => t.visible)
|
|
249
|
-
.map((tag) => (React.createElement(TagChip, { key: tag.id, tag: tag, clickable: false, disposable: false }))))),
|
|
250
|
-
React.createElement(UserFeed, Object.assign({ key: `feed_${scUser.id}`, className: classes.feed, user: scUser, widgets: _widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, UserFeedProps))))))))));
|
|
225
|
+
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(UserProfileHeader, Object.assign({ user: scUser }, UserProfileHeaderProps, { actions: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? null : (_jsxs(Stack, Object.assign({ direction: "row", spacing: 2, className: classes.actions }, { children: [startActions, isMe ? editStartActions : viewStartActions, isMe ? (_jsx(Button, Object.assign({ variant: "contained", color: "secondary", onClick: handleEdit }, { children: _jsx(FormattedMessage, { defaultMessage: "templates.userProfile.edit", id: "templates.userProfile.edit" }) }))) : (_jsx(ConnectionUserButton, { user: scUser })), isMe ? editEndActions : viewEndActions, endActions, _jsx(UserActionIconButton, { user: scUser, items: actionItems })] }), `actions_${scUser.id}`)) })), scUserContext.user === undefined ||
|
|
226
|
+
(scUserContext.user && ((loadingBlockedBy && blockedBy === null) || scUserContext.managers.blockedUsers.isLoading())) ? (_jsx(UserFeedSkeleton, {})) : (_jsx(_Fragment, { children: loadingBlockedBy || (scUserContext.user && scUserContext.managers.blockedUsers.loading) ? null : (_jsx(_Fragment, { children: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? (_jsx(UserProfileBlocked, { user: scUser, blockedByUser: blockedBy })) : (_jsxs(_Fragment, { children: [_jsx(UserCounters, { className: classes.counters, userId: userId, user: scUser }), scUser.date_joined && (_jsx(Typography, Object.assign({ className: classes.info }, { children: _jsx(FormattedMessage, { id: "templates.userProfile.dateJoined", defaultMessage: "templates.userProfile.dateJoined", values: {
|
|
227
|
+
date: intl.formatDate(scUser.date_joined, {
|
|
228
|
+
year: 'numeric',
|
|
229
|
+
month: 'long'
|
|
230
|
+
})
|
|
231
|
+
} }) }))), scUser.location && (_jsxs(Typography, Object.assign({ className: classes.info }, { children: [_jsx(Icon, { children: "add_location_alt" }), " ", scUser.location] }))), taggingEnabled && (_jsx(Stack, Object.assign({ direction: "row", spacing: 2, className: classes.tags }, { children: scUser.tags
|
|
232
|
+
.filter((t) => t.visible)
|
|
233
|
+
.map((tag) => (_jsx(TagChip, { tag: tag, clickable: false, disposable: false }, tag.id))) }), `tags_${scUser.id}`)), _jsx(UserFeed, Object.assign({ className: classes.feed, user: scUser, widgets: _widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, UserFeedProps), `feed_${scUser.id}`)] })) })) }))] })));
|
|
251
234
|
}
|