@selfcommunity/react-templates 0.3.50-events.39 → 0.3.50-events.41

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.
@@ -6,7 +6,6 @@ const styles_1 = require("@mui/material/styles");
6
6
  const material_1 = require("@mui/material");
7
7
  const react_ui_1 = require("@selfcommunity/react-ui");
8
8
  const react_core_1 = require("@selfcommunity/react-core");
9
- const types_1 = require("@selfcommunity/types");
10
9
  const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
11
10
  const system_1 = require("@mui/system");
12
11
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
@@ -63,10 +62,6 @@ function Event(inProps) {
63
62
  }
64
63
  return (react_1.default.createElement(Root, { id: id, className: (0, classnames_1.default)(classes.root, className) },
65
64
  react_1.default.createElement(react_ui_1.EventHeader, { eventId: scEvent.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }),
66
- react_1.default.createElement(material_1.Grid, { container: true, spacing: 2, mt: 2 }, scEvent.location === types_1.SCEventLocationType.PERSON ? (react_1.default.createElement(react_1.default.Fragment, null,
67
- react_1.default.createElement(material_1.Grid, { item: true, xs: 12, md: 7 }),
68
- react_1.default.createElement(material_1.Grid, { item: true, xs: 12, md: 5 },
69
- react_1.default.createElement(react_ui_1.EventLocationWidget, { event: scEvent })))) : (react_1.default.createElement(material_1.Grid, { item: true, xs: 12 }))),
70
65
  react_1.default.createElement(EventFeed_1.default, Object.assign({ className: classes.feed, event: scEvent, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, EventFeedProps))));
71
66
  }
72
67
  exports.default = Event;
@@ -22,13 +22,13 @@ const Root = (0, styles_1.styled)(react_ui_1.Feed, {
22
22
  })(() => ({}));
23
23
  // Widgets for feed
24
24
  const WIDGETS = [
25
- /* {
26
- type: 'widget',
27
- component: EventLocationWidget,
28
- componentProps: {},
29
- column: 'left',
30
- position: 0
31
- }, */
25
+ {
26
+ type: 'widget',
27
+ component: react_ui_1.EventLocationWidget,
28
+ componentProps: {},
29
+ column: 'right',
30
+ position: 0
31
+ }
32
32
  ];
33
33
  /**
34
34
  * > API documentation for the Community-JS Group Feed Template. Learn about the available props and the CSS API.
@@ -102,8 +102,7 @@ function EventFeed(inProps) {
102
102
  scEvent.subscription_status !== types_1.SCEventSubscriptionStatusType.SUBSCRIBED &&
103
103
  scEvent.subscription_status !== types_1.SCEventSubscriptionStatusType.GOING &&
104
104
  scEvent.subscription_status !== types_1.SCEventSubscriptionStatusType.NOT_GOING) {
105
- // return <EventInfoWidget className={classes.root} event={scEvent} />;
106
- return null;
105
+ return react_1.default.createElement(react_ui_1.EventInfoWidget, { className: classes.root, event: scEvent });
107
106
  }
108
107
  return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), id: id, ref: feedRef, endpoint: Object.assign(Object.assign({}, api_services_1.Endpoints.GetEventFeed), { url: () => api_services_1.Endpoints.GetEventFeed.url({ id: scEvent.id }) }), widgets: _widgets, ItemComponent: react_ui_1.FeedObject, itemPropsGenerator: (scUser, item) => {
109
108
  var _a;
@@ -115,10 +114,11 @@ function EventFeed(inProps) {
115
114
  });
116
115
  }, itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: react_ui_1.FeedObjectSkeleton, ItemSkeletonProps: {
117
116
  template: react_ui_1.SCFeedObjectTemplateType.PREVIEW
118
- }, FeedSidebarProps: FeedSidebarProps, HeaderComponent: scEvent &&
119
- scEvent.subscription_status === types_1.SCEventSubscriptionStatusType.SUBSCRIBED && (react_1.default.createElement(react_ui_1.InlineComposerWidget, { onSuccess: handleComposerSuccess,
120
- // defaultValue={{event: scEvent}}
121
- label: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.groupFeed.composer.label", defaultMessage: "templates.groupFeed.composer.label" }), feedType: types_1.SCFeedTypologyType.EVENT })), CustomAdvProps: { position: types_1.SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
117
+ }, FeedSidebarProps: FeedSidebarProps, HeaderComponent: react_1.default.createElement(react_1.default.Fragment, null,
118
+ react_1.default.createElement(react_ui_1.EventInfoWidget, { className: classes.root, event: scEvent }),
119
+ scEvent && scEvent.subscription_status === types_1.SCEventSubscriptionStatusType.SUBSCRIBED && (react_1.default.createElement(react_ui_1.InlineComposerWidget, { onSuccess: handleComposerSuccess,
120
+ // defaultValue={{event: scEvent}}
121
+ label: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.eventFeed.composer.label", defaultMessage: "templates.eventFeed.composer.label" }), feedType: types_1.SCFeedTypologyType.EVENT }))), CustomAdvProps: { position: types_1.SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
122
122
  types_1.SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
123
123
  types_1.SCCustomAdvPosition.POSITION_FEED,
124
124
  types_1.SCCustomAdvPosition.POSITION_BELOW_TOPBAR
@@ -7,6 +7,8 @@ import NotificationFeed, { NotificationFeedProps, NotificationFeedSkeleton } fro
7
7
  import UserFeed, { UserFeedProps, UserFeedSkeleton } from './components/UserFeed';
8
8
  import UserProfile, { UserProfileProps, UserProfileSkeleton } from './components/UserProfile';
9
9
  import LoyaltyProgramDetail, { LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton } from './components/LoyaltyProgramDetail';
10
- import GroupFeed, { GroupFeedProps, GroupFeedSkeleton } from './components/GroupFeed';
11
10
  import Group, { GroupProps, GroupSkeleton } from './components/Group';
12
- export { Category, CategoryProps, CategorySkeleton, CategoryFeed, CategoryFeedProps, CategoryFeedSkeleton, ExploreFeed, ExploreFeedProps, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailProps, FeedObjectDetailSkeleton, MainFeed, MainFeedProps, MainFeedSkeleton, NotificationFeed, NotificationFeedProps, NotificationFeedSkeleton, UserFeed, UserFeedProps, UserFeedSkeleton, UserProfile, UserProfileProps, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedProps, GroupFeedSkeleton, Group, GroupProps, GroupSkeleton };
11
+ import GroupFeed, { GroupFeedProps, GroupFeedSkeleton } from './components/GroupFeed';
12
+ import Event, { EventProps, EventSkeleton } from './components/Event';
13
+ import EventFeed, { EventFeedProps, EventFeedSkeleton } from './components/EventFeed';
14
+ export { Category, CategoryProps, CategorySkeleton, CategoryFeed, CategoryFeedProps, CategoryFeedSkeleton, ExploreFeed, ExploreFeedProps, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailProps, FeedObjectDetailSkeleton, MainFeed, MainFeedProps, MainFeedSkeleton, NotificationFeed, NotificationFeedProps, NotificationFeedSkeleton, UserFeed, UserFeedProps, UserFeedSkeleton, UserProfile, UserProfileProps, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedProps, GroupFeedSkeleton, Group, GroupProps, GroupSkeleton, Event, EventProps, EventSkeleton, EventFeed, EventFeedProps, EventFeedSkeleton };
package/lib/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GroupSkeleton = exports.Group = exports.GroupFeedSkeleton = exports.GroupFeed = exports.LoyaltyProgramDetailSkeleton = exports.LoyaltyProgramDetail = exports.UserProfileSkeleton = exports.UserProfile = exports.UserFeedSkeleton = exports.UserFeed = exports.NotificationFeedSkeleton = exports.NotificationFeed = exports.MainFeedSkeleton = exports.MainFeed = exports.FeedObjectDetailSkeleton = exports.FeedObjectDetail = exports.ExploreFeedSkeleton = exports.ExploreFeed = exports.CategoryFeedSkeleton = exports.CategoryFeed = exports.CategorySkeleton = exports.Category = void 0;
3
+ exports.EventFeedSkeleton = exports.EventFeed = exports.EventSkeleton = exports.Event = exports.GroupSkeleton = exports.Group = exports.GroupFeedSkeleton = exports.GroupFeed = exports.LoyaltyProgramDetailSkeleton = exports.LoyaltyProgramDetail = exports.UserProfileSkeleton = exports.UserProfile = exports.UserFeedSkeleton = exports.UserFeed = exports.NotificationFeedSkeleton = exports.NotificationFeed = exports.MainFeedSkeleton = exports.MainFeed = exports.FeedObjectDetailSkeleton = exports.FeedObjectDetail = exports.ExploreFeedSkeleton = exports.ExploreFeed = exports.CategoryFeedSkeleton = exports.CategoryFeed = exports.CategorySkeleton = exports.Category = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Category_1 = tslib_1.__importStar(require("./components/Category"));
6
6
  exports.Category = Category_1.default;
@@ -29,9 +29,15 @@ Object.defineProperty(exports, "UserProfileSkeleton", { enumerable: true, get: f
29
29
  const LoyaltyProgramDetail_1 = tslib_1.__importStar(require("./components/LoyaltyProgramDetail"));
30
30
  exports.LoyaltyProgramDetail = LoyaltyProgramDetail_1.default;
31
31
  Object.defineProperty(exports, "LoyaltyProgramDetailSkeleton", { enumerable: true, get: function () { return LoyaltyProgramDetail_1.LoyaltyProgramDetailSkeleton; } });
32
- const GroupFeed_1 = tslib_1.__importStar(require("./components/GroupFeed"));
33
- exports.GroupFeed = GroupFeed_1.default;
34
- Object.defineProperty(exports, "GroupFeedSkeleton", { enumerable: true, get: function () { return GroupFeed_1.GroupFeedSkeleton; } });
35
32
  const Group_1 = tslib_1.__importStar(require("./components/Group"));
36
33
  exports.Group = Group_1.default;
37
34
  Object.defineProperty(exports, "GroupSkeleton", { enumerable: true, get: function () { return Group_1.GroupSkeleton; } });
35
+ const GroupFeed_1 = tslib_1.__importStar(require("./components/GroupFeed"));
36
+ exports.GroupFeed = GroupFeed_1.default;
37
+ Object.defineProperty(exports, "GroupFeedSkeleton", { enumerable: true, get: function () { return GroupFeed_1.GroupFeedSkeleton; } });
38
+ const Event_1 = tslib_1.__importStar(require("./components/Event"));
39
+ exports.Event = Event_1.default;
40
+ Object.defineProperty(exports, "EventSkeleton", { enumerable: true, get: function () { return Event_1.EventSkeleton; } });
41
+ const EventFeed_1 = tslib_1.__importStar(require("./components/EventFeed"));
42
+ exports.EventFeed = EventFeed_1.default;
43
+ Object.defineProperty(exports, "EventFeedSkeleton", { enumerable: true, get: function () { return EventFeed_1.EventFeedSkeleton; } });
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import { styled } from '@mui/material/styles';
3
- import { Box, Grid } from '@mui/material';
4
- import { EventHeader, EventLocationWidget } from '@selfcommunity/react-ui';
3
+ import { Box } from '@mui/material';
4
+ import { EventHeader } from '@selfcommunity/react-ui';
5
5
  import { useSCFetchEvent } from '@selfcommunity/react-core';
6
- import { SCEventLocationType } from '@selfcommunity/types';
7
6
  import EventSkeletonTemplate from './Skeleton';
8
7
  import { useThemeProps } from '@mui/system';
9
8
  import classNames from 'classnames';
@@ -60,9 +59,5 @@ export default function Event(inProps) {
60
59
  }
61
60
  return (React.createElement(Root, { id: id, className: classNames(classes.root, className) },
62
61
  React.createElement(EventHeader, { eventId: scEvent.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }),
63
- React.createElement(Grid, { container: true, spacing: 2, mt: 2 }, scEvent.location === SCEventLocationType.PERSON ? (React.createElement(React.Fragment, null,
64
- React.createElement(Grid, { item: true, xs: 12, md: 7 }),
65
- React.createElement(Grid, { item: true, xs: 12, md: 5 },
66
- React.createElement(EventLocationWidget, { event: scEvent })))) : (React.createElement(Grid, { item: true, xs: 12 }))),
67
62
  React.createElement(EventFeed, Object.assign({ className: classes.feed, event: scEvent, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, EventFeedProps))));
68
63
  }
@@ -1,9 +1,6 @@
1
1
  import React, { useMemo, useRef } from 'react';
2
2
  import { styled } from '@mui/material/styles';
3
- import { ContributionUtils, Feed, FeedObject, FeedObjectSkeleton,
4
- // EventInfoWidget,
5
- // EventMembersWidget,
6
- InlineComposerWidget, SCFeedObjectTemplateType } from '@selfcommunity/react-ui';
3
+ import { ContributionUtils, EventInfoWidget, EventLocationWidget, Feed, FeedObject, FeedObjectSkeleton, InlineComposerWidget, SCFeedObjectTemplateType } from '@selfcommunity/react-ui';
7
4
  import { Endpoints } from '@selfcommunity/api-services';
8
5
  import { Link, SCRoutes, useSCFetchEvent, useSCRouting } from '@selfcommunity/react-core';
9
6
  import { SCCustomAdvPosition, SCEventSubscriptionStatusType, SCFeedTypologyType } from '@selfcommunity/types';
@@ -22,13 +19,13 @@ const Root = styled(Feed, {
22
19
  })(() => ({}));
23
20
  // Widgets for feed
24
21
  const WIDGETS = [
25
- /* {
26
- type: 'widget',
27
- component: EventLocationWidget,
28
- componentProps: {},
29
- column: 'left',
30
- position: 0
31
- }, */
22
+ {
23
+ type: 'widget',
24
+ component: EventLocationWidget,
25
+ componentProps: {},
26
+ column: 'right',
27
+ position: 0
28
+ }
32
29
  ];
33
30
  /**
34
31
  * > API documentation for the Community-JS Group Feed Template. Learn about the available props and the CSS API.
@@ -102,8 +99,7 @@ export default function EventFeed(inProps) {
102
99
  scEvent.subscription_status !== SCEventSubscriptionStatusType.SUBSCRIBED &&
103
100
  scEvent.subscription_status !== SCEventSubscriptionStatusType.GOING &&
104
101
  scEvent.subscription_status !== SCEventSubscriptionStatusType.NOT_GOING) {
105
- // return <EventInfoWidget className={classes.root} event={scEvent} />;
106
- return null;
102
+ return React.createElement(EventInfoWidget, { className: classes.root, event: scEvent });
107
103
  }
108
104
  return (React.createElement(Root, Object.assign({ className: classNames(classes.root, className), id: id, ref: feedRef, endpoint: Object.assign(Object.assign({}, Endpoints.GetEventFeed), { url: () => Endpoints.GetEventFeed.url({ id: scEvent.id }) }), widgets: _widgets, ItemComponent: FeedObject, itemPropsGenerator: (scUser, item) => {
109
105
  var _a;
@@ -115,10 +111,11 @@ export default function EventFeed(inProps) {
115
111
  });
116
112
  }, itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: FeedObjectSkeleton, ItemSkeletonProps: {
117
113
  template: SCFeedObjectTemplateType.PREVIEW
118
- }, FeedSidebarProps: FeedSidebarProps, HeaderComponent: scEvent &&
119
- scEvent.subscription_status === SCEventSubscriptionStatusType.SUBSCRIBED && (React.createElement(InlineComposerWidget, { onSuccess: handleComposerSuccess,
120
- // defaultValue={{event: scEvent}}
121
- label: React.createElement(FormattedMessage, { id: "templates.groupFeed.composer.label", defaultMessage: "templates.groupFeed.composer.label" }), feedType: SCFeedTypologyType.EVENT })), CustomAdvProps: { position: SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
114
+ }, FeedSidebarProps: FeedSidebarProps, HeaderComponent: React.createElement(React.Fragment, null,
115
+ React.createElement(EventInfoWidget, { className: classes.root, event: scEvent }),
116
+ scEvent && scEvent.subscription_status === SCEventSubscriptionStatusType.SUBSCRIBED && (React.createElement(InlineComposerWidget, { onSuccess: handleComposerSuccess,
117
+ // defaultValue={{event: scEvent}}
118
+ label: React.createElement(FormattedMessage, { id: "templates.eventFeed.composer.label", defaultMessage: "templates.eventFeed.composer.label" }), feedType: SCFeedTypologyType.EVENT }))), CustomAdvProps: { position: SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
122
119
  SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
123
120
  SCCustomAdvPosition.POSITION_FEED,
124
121
  SCCustomAdvPosition.POSITION_BELOW_TOPBAR
@@ -7,6 +7,8 @@ import NotificationFeed, { NotificationFeedProps, NotificationFeedSkeleton } fro
7
7
  import UserFeed, { UserFeedProps, UserFeedSkeleton } from './components/UserFeed';
8
8
  import UserProfile, { UserProfileProps, UserProfileSkeleton } from './components/UserProfile';
9
9
  import LoyaltyProgramDetail, { LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton } from './components/LoyaltyProgramDetail';
10
- import GroupFeed, { GroupFeedProps, GroupFeedSkeleton } from './components/GroupFeed';
11
10
  import Group, { GroupProps, GroupSkeleton } from './components/Group';
12
- export { Category, CategoryProps, CategorySkeleton, CategoryFeed, CategoryFeedProps, CategoryFeedSkeleton, ExploreFeed, ExploreFeedProps, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailProps, FeedObjectDetailSkeleton, MainFeed, MainFeedProps, MainFeedSkeleton, NotificationFeed, NotificationFeedProps, NotificationFeedSkeleton, UserFeed, UserFeedProps, UserFeedSkeleton, UserProfile, UserProfileProps, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedProps, GroupFeedSkeleton, Group, GroupProps, GroupSkeleton };
11
+ import GroupFeed, { GroupFeedProps, GroupFeedSkeleton } from './components/GroupFeed';
12
+ import Event, { EventProps, EventSkeleton } from './components/Event';
13
+ import EventFeed, { EventFeedProps, EventFeedSkeleton } from './components/EventFeed';
14
+ export { Category, CategoryProps, CategorySkeleton, CategoryFeed, CategoryFeedProps, CategoryFeedSkeleton, ExploreFeed, ExploreFeedProps, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailProps, FeedObjectDetailSkeleton, MainFeed, MainFeedProps, MainFeedSkeleton, NotificationFeed, NotificationFeedProps, NotificationFeedSkeleton, UserFeed, UserFeedProps, UserFeedSkeleton, UserProfile, UserProfileProps, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailProps, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedProps, GroupFeedSkeleton, Group, GroupProps, GroupSkeleton, Event, EventProps, EventSkeleton, EventFeed, EventFeedProps, EventFeedSkeleton };
package/lib/esm/index.js CHANGED
@@ -7,6 +7,8 @@ import NotificationFeed, { NotificationFeedSkeleton } from './components/Notific
7
7
  import UserFeed, { UserFeedSkeleton } from './components/UserFeed';
8
8
  import UserProfile, { UserProfileSkeleton } from './components/UserProfile';
9
9
  import LoyaltyProgramDetail, { LoyaltyProgramDetailSkeleton } from './components/LoyaltyProgramDetail';
10
- import GroupFeed, { GroupFeedSkeleton } from './components/GroupFeed';
11
10
  import Group, { GroupSkeleton } from './components/Group';
12
- export { Category, CategorySkeleton, CategoryFeed, CategoryFeedSkeleton, ExploreFeed, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailSkeleton, MainFeed, MainFeedSkeleton, NotificationFeed, NotificationFeedSkeleton, UserFeed, UserFeedSkeleton, UserProfile, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedSkeleton, Group, GroupSkeleton };
11
+ import GroupFeed, { GroupFeedSkeleton } from './components/GroupFeed';
12
+ import Event, { EventSkeleton } from './components/Event';
13
+ import EventFeed, { EventFeedSkeleton } from './components/EventFeed';
14
+ export { Category, CategorySkeleton, CategoryFeed, CategoryFeedSkeleton, ExploreFeed, ExploreFeedSkeleton, FeedObjectDetail, FeedObjectDetailSkeleton, MainFeed, MainFeedSkeleton, NotificationFeed, NotificationFeedSkeleton, UserFeed, UserFeedSkeleton, UserProfile, UserProfileSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailSkeleton, GroupFeed, GroupFeedSkeleton, Group, GroupSkeleton, Event, EventSkeleton, EventFeed, EventFeedSkeleton };