@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.
Files changed (58) hide show
  1. package/lib/cjs/components/Category/Category.js +3 -5
  2. package/lib/cjs/components/Category/Skeleton.js +2 -4
  3. package/lib/cjs/components/CategoryFeed/CategoryFeed.js +7 -7
  4. package/lib/cjs/components/CategoryFeed/Skeleton.js +2 -5
  5. package/lib/cjs/components/Event/Event.js +3 -5
  6. package/lib/cjs/components/Event/Skeleton.js +2 -4
  7. package/lib/cjs/components/EventFeed/EventFeed.js +10 -12
  8. package/lib/cjs/components/EventFeed/Skeleton.js +2 -5
  9. package/lib/cjs/components/ExploreFeed/ExploreFeed.js +5 -4
  10. package/lib/cjs/components/ExploreFeed/Skeleton.js +2 -5
  11. package/lib/cjs/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
  12. package/lib/cjs/components/FeedObjectDetail/Skeleton.js +2 -9
  13. package/lib/cjs/components/Group/Group.js +3 -5
  14. package/lib/cjs/components/Group/Skeleton.js +2 -4
  15. package/lib/cjs/components/GroupFeed/GroupFeed.js +8 -8
  16. package/lib/cjs/components/GroupFeed/Skeleton.js +2 -5
  17. package/lib/cjs/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
  18. package/lib/cjs/components/LoyaltyProgramDetail/PointsList.js +4 -17
  19. package/lib/cjs/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -14
  20. package/lib/cjs/components/LoyaltyProgramDetail/Skeleton.js +2 -16
  21. package/lib/cjs/components/MainFeed/MainFeed.js +5 -4
  22. package/lib/cjs/components/MainFeed/Skeleton.js +2 -5
  23. package/lib/cjs/components/NotificationFeed/NotificationFeed.js +3 -2
  24. package/lib/cjs/components/NotificationFeed/Skeleton.js +2 -3
  25. package/lib/cjs/components/UserFeed/Skeleton.js +2 -5
  26. package/lib/cjs/components/UserFeed/UserFeed.js +6 -5
  27. package/lib/cjs/components/UserProfile/Skeleton.js +2 -4
  28. package/lib/cjs/components/UserProfile/UserProfile.js +13 -30
  29. package/lib/esm/components/Category/Category.js +3 -5
  30. package/lib/esm/components/Category/Skeleton.js +2 -4
  31. package/lib/esm/components/CategoryFeed/CategoryFeed.js +7 -7
  32. package/lib/esm/components/CategoryFeed/Skeleton.js +2 -5
  33. package/lib/esm/components/Event/Event.js +3 -5
  34. package/lib/esm/components/Event/Skeleton.js +2 -4
  35. package/lib/esm/components/EventFeed/EventFeed.js +10 -12
  36. package/lib/esm/components/EventFeed/Skeleton.js +2 -5
  37. package/lib/esm/components/ExploreFeed/ExploreFeed.js +5 -4
  38. package/lib/esm/components/ExploreFeed/Skeleton.js +2 -5
  39. package/lib/esm/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
  40. package/lib/esm/components/FeedObjectDetail/Skeleton.js +2 -8
  41. package/lib/esm/components/Group/Group.js +3 -5
  42. package/lib/esm/components/Group/Skeleton.js +2 -4
  43. package/lib/esm/components/GroupFeed/GroupFeed.js +8 -8
  44. package/lib/esm/components/GroupFeed/Skeleton.js +2 -5
  45. package/lib/esm/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
  46. package/lib/esm/components/LoyaltyProgramDetail/PointsList.js +4 -17
  47. package/lib/esm/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -13
  48. package/lib/esm/components/LoyaltyProgramDetail/Skeleton.js +2 -16
  49. package/lib/esm/components/MainFeed/MainFeed.js +5 -4
  50. package/lib/esm/components/MainFeed/Skeleton.js +2 -5
  51. package/lib/esm/components/NotificationFeed/NotificationFeed.js +3 -2
  52. package/lib/esm/components/NotificationFeed/Skeleton.js +2 -3
  53. package/lib/esm/components/UserFeed/Skeleton.js +2 -5
  54. package/lib/esm/components/UserFeed/UserFeed.js +6 -5
  55. package/lib/esm/components/UserProfile/Skeleton.js +2 -4
  56. package/lib/esm/components/UserProfile/UserProfile.js +13 -30
  57. package/lib/umd/react-templates.js +1 -1
  58. package/package.json +6 -6
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
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 React.createElement(UserProfileSkeleton, null);
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: React.createElement(FormattedMessage, { defaultMessage: "templates.userProfile.send.pm", id: "templates.userProfile.send.pm" }),
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 (React.createElement(Root, { id: id, className: classNames(classes.root, className) },
225
- React.createElement(UserProfileHeader, Object.assign({ user: scUser }, UserProfileHeaderProps, { actions: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? null : (React.createElement(Stack, { key: `actions_${scUser.id}`, direction: "row", spacing: 2, className: classes.actions },
226
- startActions,
227
- isMe ? editStartActions : viewStartActions,
228
- isMe ? (React.createElement(Button, { variant: "contained", color: "secondary", onClick: handleEdit },
229
- React.createElement(FormattedMessage, { defaultMessage: "templates.userProfile.edit", id: "templates.userProfile.edit" }))) : (React.createElement(ConnectionUserButton, { user: scUser })),
230
- isMe ? editEndActions : viewEndActions,
231
- endActions,
232
- React.createElement(UserActionIconButton, { user: scUser, items: actionItems }))) })),
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
  }