@selfcommunity/react-templates 0.3.50-events.50 → 0.3.50-events.52
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.
|
@@ -53,13 +53,10 @@ function Event(inProps) {
|
|
|
53
53
|
});
|
|
54
54
|
const { id = 'event', className, event, eventId, widgets, FeedObjectProps, FeedSidebarProps, EventFeedProps = {} } = props;
|
|
55
55
|
// HOOKS
|
|
56
|
-
const { scEvent
|
|
57
|
-
const handleSubscribe = (event, status) => {
|
|
58
|
-
setSCEvent(Object.assign({}, scEvent, { subscription_status: status }));
|
|
59
|
-
};
|
|
56
|
+
const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
|
|
60
57
|
if (!scEvent) {
|
|
61
58
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
62
59
|
}
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.EventHeader, { eventId: scEvent.id
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.EventHeader, { eventId: scEvent.id }), (0, jsx_runtime_1.jsx)(EventFeed_1.default, Object.assign({ className: classes.feed, event: scEvent, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, EventFeedProps))] })));
|
|
64
61
|
}
|
|
65
62
|
exports.default = Event;
|
|
@@ -116,9 +116,7 @@ function EventFeed(inProps) {
|
|
|
116
116
|
});
|
|
117
117
|
}, itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: react_ui_1.FeedObjectSkeleton, ItemSkeletonProps: {
|
|
118
118
|
template: react_ui_1.SCFeedObjectTemplateType.PREVIEW
|
|
119
|
-
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.EventInfoWidget, { className: classes.root, event: scEvent }), scEvent && scEvent.subscription_status === types_1.SCEventSubscriptionStatusType.SUBSCRIBED && ((0, jsx_runtime_1.jsx)(react_ui_1.InlineComposerWidget, { onSuccess: handleComposerSuccess,
|
|
120
|
-
// defaultValue={{event: scEvent}}
|
|
121
|
-
label: (0, jsx_runtime_1.jsx)(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: [
|
|
119
|
+
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.EventInfoWidget, { className: classes.root, event: scEvent }), scEvent && scEvent.subscription_status === types_1.SCEventSubscriptionStatusType.SUBSCRIBED && ((0, jsx_runtime_1.jsx)(react_ui_1.InlineComposerWidget, { onSuccess: handleComposerSuccess, defaultValue: { event: scEvent }, label: (0, jsx_runtime_1.jsx)(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
120
|
types_1.SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
|
|
123
121
|
types_1.SCCustomAdvPosition.POSITION_FEED,
|
|
124
122
|
types_1.SCCustomAdvPosition.POSITION_BELOW_TOPBAR
|
|
@@ -50,12 +50,9 @@ export default function Event(inProps) {
|
|
|
50
50
|
});
|
|
51
51
|
const { id = 'event', className, event, eventId, widgets, FeedObjectProps, FeedSidebarProps, EventFeedProps = {} } = props;
|
|
52
52
|
// HOOKS
|
|
53
|
-
const { scEvent
|
|
54
|
-
const handleSubscribe = (event, status) => {
|
|
55
|
-
setSCEvent(Object.assign({}, scEvent, { subscription_status: status }));
|
|
56
|
-
};
|
|
53
|
+
const { scEvent } = useSCFetchEvent({ id: eventId, event });
|
|
57
54
|
if (!scEvent) {
|
|
58
55
|
return _jsx(EventSkeletonTemplate, {});
|
|
59
56
|
}
|
|
60
|
-
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(EventHeader, { eventId: scEvent.id
|
|
57
|
+
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(EventHeader, { eventId: scEvent.id }), _jsx(EventFeed, Object.assign({ className: classes.feed, event: scEvent, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, EventFeedProps))] })));
|
|
61
58
|
}
|
|
@@ -113,9 +113,7 @@ export default function EventFeed(inProps) {
|
|
|
113
113
|
});
|
|
114
114
|
}, itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: FeedObjectSkeleton, ItemSkeletonProps: {
|
|
115
115
|
template: SCFeedObjectTemplateType.PREVIEW
|
|
116
|
-
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: _jsxs(_Fragment, { children: [_jsx(EventInfoWidget, { className: classes.root, event: scEvent }), scEvent && scEvent.subscription_status === SCEventSubscriptionStatusType.SUBSCRIBED && (_jsx(InlineComposerWidget, { onSuccess: handleComposerSuccess,
|
|
117
|
-
// defaultValue={{event: scEvent}}
|
|
118
|
-
label: _jsx(FormattedMessage, { id: "templates.eventFeed.composer.label", defaultMessage: "templates.eventFeed.composer.label" }), feedType: SCFeedTypologyType.EVENT }))] }), CustomAdvProps: { position: SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
|
|
116
|
+
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: _jsxs(_Fragment, { children: [_jsx(EventInfoWidget, { className: classes.root, event: scEvent }), scEvent && scEvent.subscription_status === SCEventSubscriptionStatusType.SUBSCRIBED && (_jsx(InlineComposerWidget, { onSuccess: handleComposerSuccess, defaultValue: { event: scEvent }, label: _jsx(FormattedMessage, { id: "templates.eventFeed.composer.label", defaultMessage: "templates.eventFeed.composer.label" }), feedType: SCFeedTypologyType.EVENT }))] }), CustomAdvProps: { position: SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
|
|
119
117
|
SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
|
|
120
118
|
SCCustomAdvPosition.POSITION_FEED,
|
|
121
119
|
SCCustomAdvPosition.POSITION_BELOW_TOPBAR
|