@selfcommunity/react-ui 0.7.50-events.110 → 0.7.50-events.112
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/Event/Event.d.ts +5 -0
- package/lib/cjs/components/Event/Event.js +10 -4
- package/lib/cjs/components/EventHeader/EventHeader.js +1 -1
- package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +36 -10
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.d.ts +3 -2
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +33 -13
- package/lib/cjs/components/EventMembersWidget/types.d.ts +6 -0
- package/lib/cjs/components/EventMembersWidget/types.js +9 -0
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.d.ts +2 -2
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +8 -5
- package/lib/cjs/components/FeedObject/FeedObject.js +6 -2
- package/lib/cjs/shared/ContributionActionsMenu/index.js +8 -1
- package/lib/cjs/shared/EventInfoDetails/index.d.ts +1 -0
- package/lib/cjs/shared/EventInfoDetails/index.js +18 -14
- package/lib/esm/components/Event/Event.d.ts +5 -0
- package/lib/esm/components/Event/Event.js +11 -5
- package/lib/esm/components/EventHeader/EventHeader.js +1 -1
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +36 -10
- package/lib/esm/components/EventMembersWidget/TabContentComponent.d.ts +3 -2
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +34 -14
- package/lib/esm/components/EventMembersWidget/types.d.ts +6 -0
- package/lib/esm/components/EventMembersWidget/types.js +6 -0
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.d.ts +2 -2
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +8 -5
- package/lib/esm/components/FeedObject/FeedObject.js +6 -2
- package/lib/esm/shared/ContributionActionsMenu/index.js +8 -1
- package/lib/esm/shared/EventInfoDetails/index.d.ts +1 -0
- package/lib/esm/shared/EventInfoDetails/index.js +19 -15
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -8,6 +8,7 @@ const system_1 = require("@mui/system");
|
|
|
8
8
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
9
9
|
const types_1 = require("@selfcommunity/types");
|
|
10
10
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
11
|
+
const react_1 = require("react");
|
|
11
12
|
const react_intl_1 = require("react-intl");
|
|
12
13
|
const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem"));
|
|
13
14
|
const Calendar_1 = tslib_1.__importDefault(require("../../shared/Calendar"));
|
|
@@ -25,6 +26,7 @@ const classes = {
|
|
|
25
26
|
snippetRoot: `${constants_1.PREFIX}-snippet-root`,
|
|
26
27
|
detailImageWrapper: `${constants_1.PREFIX}-detail-image-wrapper`,
|
|
27
28
|
detailImage: `${constants_1.PREFIX}-detail-image`,
|
|
29
|
+
detailInProgress: `${constants_1.PREFIX}-detail-in-progress`,
|
|
28
30
|
detailNameWrapper: `${constants_1.PREFIX}-detail-name-wrapper`,
|
|
29
31
|
detailName: `${constants_1.PREFIX}-detail-name`,
|
|
30
32
|
detailContent: `${constants_1.PREFIX}-detail-content`,
|
|
@@ -34,11 +36,14 @@ const classes = {
|
|
|
34
36
|
detailActions: `${constants_1.PREFIX}-detail-actions`,
|
|
35
37
|
previewImageWrapper: `${constants_1.PREFIX}-preview-image-wrapper`,
|
|
36
38
|
previewImage: `${constants_1.PREFIX}-preview-image`,
|
|
39
|
+
previewInProgress: `${constants_1.PREFIX}-preview-in-progress`,
|
|
37
40
|
previewNameWrapper: `${constants_1.PREFIX}-preview-name-wrapper`,
|
|
38
41
|
previewName: `${constants_1.PREFIX}-preview-name`,
|
|
39
42
|
previewContent: `${constants_1.PREFIX}-preview-content`,
|
|
40
43
|
previewActions: `${constants_1.PREFIX}-preview-actions`,
|
|
44
|
+
snippetImage: `${constants_1.PREFIX}-snippet-image`,
|
|
41
45
|
snippetAvatar: `${constants_1.PREFIX}-snippet-avatar`,
|
|
46
|
+
snippetInProgress: `${constants_1.PREFIX}-snippet-in-progress`,
|
|
42
47
|
snippetPrimary: `${constants_1.PREFIX}-snippet-primary`,
|
|
43
48
|
snippetSecondary: `${constants_1.PREFIX}-snippet-secondary`,
|
|
44
49
|
snippetActions: `${constants_1.PREFIX}-snippet-actions`
|
|
@@ -101,9 +106,10 @@ function Event(inProps) {
|
|
|
101
106
|
props: inProps,
|
|
102
107
|
name: constants_1.PREFIX
|
|
103
108
|
});
|
|
104
|
-
const { id = `event_object_${props.eventId ? props.eventId : props.event ? props.event.id : ''}`, eventId = null, event = null, className = null, template = event_1.SCEventTemplateType.SNIPPET, hideEventParticipants = false, hideEventPlanner = false, actions, EventParticipantsButtonComponentProps = {}, EventSkeletonComponentProps = {} } = props, rest = tslib_1.__rest(props, ["id", "eventId", "event", "className", "template", "hideEventParticipants", "hideEventPlanner", "actions", "EventParticipantsButtonComponentProps", "EventSkeletonComponentProps"]);
|
|
109
|
+
const { id = `event_object_${props.eventId ? props.eventId : props.event ? props.event.id : ''}`, eventId = null, event = null, className = null, template = event_1.SCEventTemplateType.SNIPPET, hideInProgress = false, hideEventParticipants = false, hideEventPlanner = false, actions, EventParticipantsButtonComponentProps = {}, EventSkeletonComponentProps = {} } = props, rest = tslib_1.__rest(props, ["id", "eventId", "event", "className", "template", "hideInProgress", "hideEventParticipants", "hideEventPlanner", "actions", "EventParticipantsButtonComponentProps", "EventSkeletonComponentProps"]);
|
|
105
110
|
// STATE
|
|
106
111
|
const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
|
|
112
|
+
const inProgress = (0, react_1.useMemo)(() => scEvent && scEvent.active && scEvent.running, [scEvent]);
|
|
107
113
|
// CONTEXT
|
|
108
114
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
109
115
|
// HOOKS
|
|
@@ -119,13 +125,13 @@ function Event(inProps) {
|
|
|
119
125
|
*/
|
|
120
126
|
let contentObj;
|
|
121
127
|
if (template === event_1.SCEventTemplateType.DETAIL) {
|
|
122
|
-
contentObj = ((0, jsx_runtime_1.jsxs)(DetailRoot, Object.assign({ className: classes.detailRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.detailImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.detailImage }), (0, jsx_runtime_1.jsx)(Calendar_1.default, { day: new Date(scEvent.start_date).getDate() })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.detailContent }, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.detailNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) })), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent }), !hideEventPlanner && ((0, jsx_runtime_1.jsx)(User_1.default, { user: scEvent.managed_by, elevation: 0, secondary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.myEventsWidget.planner", defaultMessage: "ui.myEventsWidget.planner" }) })), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), className: classes.detailUser })), !hideEventParticipants && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailFirstDivider }), (0, jsx_runtime_1.jsx)(EventParticipantsButton_1.default, Object.assign({ event: scEvent }, EventParticipantsButtonComponentProps))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailSecondDivider })] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.detailActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
|
|
128
|
+
contentObj = ((0, jsx_runtime_1.jsxs)(DetailRoot, Object.assign({ className: classes.detailRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.detailImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.detailImage }), !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.detailInProgress })), (0, jsx_runtime_1.jsx)(Calendar_1.default, { day: new Date(scEvent.start_date).getDate() })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.detailContent }, { children: [scEvent.active ? ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.detailNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.detailNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) }))), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent }), !hideEventPlanner && ((0, jsx_runtime_1.jsx)(User_1.default, { user: scEvent.managed_by, elevation: 0, secondary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.myEventsWidget.planner", defaultMessage: "ui.myEventsWidget.planner" }) })), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), className: classes.detailUser })), !hideEventParticipants && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailFirstDivider }), (0, jsx_runtime_1.jsx)(EventParticipantsButton_1.default, Object.assign({ event: scEvent }, EventParticipantsButtonComponentProps))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailSecondDivider })] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.detailActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
|
|
123
129
|
}
|
|
124
130
|
else if (template === event_1.SCEventTemplateType.PREVIEW) {
|
|
125
|
-
contentObj = ((0, jsx_runtime_1.jsxs)(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [(0, jsx_runtime_1.
|
|
131
|
+
contentObj = ((0, jsx_runtime_1.jsxs)(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.previewImage }), !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.previewInProgress }))] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.previewContent }, { children: [(0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hidePrivacyIcon: true, hasLocationInfo: false, beforePrivacyInfo: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.previewNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scEvent.name })) })) }), !hideEventParticipants && (0, jsx_runtime_1.jsx)(EventParticipantsButton_1.default, Object.assign({ event: scEvent, hideCaption: true }, EventParticipantsButtonComponentProps))] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.previewActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
|
|
126
132
|
}
|
|
127
133
|
else {
|
|
128
|
-
contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: (0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.snippetAvatar }), primary: (0, jsx_runtime_1.jsxs)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.snippetPrimary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, {
|
|
134
|
+
contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.snippetImage }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.snippetAvatar }), ' ', !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.snippetInProgress }))] })), primary: (0, jsx_runtime_1.jsxs)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.snippetPrimary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, {
|
|
129
135
|
weekday: 'long',
|
|
130
136
|
month: 'long',
|
|
131
137
|
day: 'numeric'
|
|
@@ -120,7 +120,7 @@ function EventHeader(inProps) {
|
|
|
120
120
|
/**
|
|
121
121
|
* Handles callback subscribe/unsubscribe event
|
|
122
122
|
*/
|
|
123
|
-
const handleSubscribe = (
|
|
123
|
+
const handleSubscribe = (_event, status) => {
|
|
124
124
|
setSCEvent(Object.assign({}, scEvent, { subscription_status: status }));
|
|
125
125
|
};
|
|
126
126
|
/**
|
|
@@ -74,6 +74,6 @@ function EventInfoWidget(inProps) {
|
|
|
74
74
|
if (!scEvent) {
|
|
75
75
|
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
76
76
|
}
|
|
77
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.titleWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "info" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.title", defaultMessage: "ui.infoEventWidget.title" }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.textWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "span", variant: "body1" }, { children: [description, showButton && !expanded && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "text", className: classes.showMore, onClick: handleToggleSummary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.showMore", defaultMessage: "ui.infoEventWidget.showMore" }) })))] })) })), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hasRecurringInfo: true, hasCreatedInfo: true, hasLocationInfo: showInfo
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.titleWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "info" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.title", defaultMessage: "ui.infoEventWidget.title" }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.textWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "span", variant: "body1" }, { children: [description, showButton && !expanded && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "text", className: classes.showMore, onClick: handleToggleSummary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.showMore", defaultMessage: "ui.infoEventWidget.showMore" }) })))] })) })), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hasRecurringInfo: true, hasCreatedInfo: true, hasLocationInfo: showInfo })] })) })));
|
|
78
78
|
}
|
|
79
79
|
exports.default = EventInfoWidget;
|
|
@@ -19,6 +19,7 @@ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
|
|
|
19
19
|
const constants_1 = require("./constants");
|
|
20
20
|
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
21
21
|
const TabContentComponent_1 = tslib_1.__importDefault(require("./TabContentComponent"));
|
|
22
|
+
const types_1 = require("./types");
|
|
22
23
|
const classes = {
|
|
23
24
|
root: `${constants_1.PREFIX}-root`,
|
|
24
25
|
content: `${constants_1.PREFIX}-content`,
|
|
@@ -61,18 +62,29 @@ function EventMembersWidget(inProps) {
|
|
|
61
62
|
cacheStrategy,
|
|
62
63
|
visibleItems: limit
|
|
63
64
|
}, widget_1.stateWidgetInitializer);
|
|
65
|
+
const [participantsCount, setParticipantsCount] = (0, react_1.useState)(0);
|
|
64
66
|
const [invitedCount, setInvitedCount] = (0, react_1.useState)(0);
|
|
65
67
|
const [requestsCount, setRequestsCount] = (0, react_1.useState)(0);
|
|
66
68
|
const [requestsUsers, setRequestsUsers] = (0, react_1.useState)([]);
|
|
67
69
|
const [tabValue, setTabValue] = (0, react_1.useState)('1');
|
|
68
|
-
const [refresh, setRefresh] = (0, react_1.useState)(
|
|
70
|
+
const [refresh, setRefresh] = (0, react_1.useState)(null);
|
|
69
71
|
// CONTEXT
|
|
70
72
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
71
73
|
// HOOKS
|
|
72
74
|
const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
|
|
73
75
|
// CONSTS
|
|
74
76
|
const hasAllow = (0, react_1.useMemo)(() => { var _a; return ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === (scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by.id); }, [scUserContext, scEvent]);
|
|
75
|
-
const title = (0, react_1.useMemo)(() =>
|
|
77
|
+
const title = (0, react_1.useMemo)(() => {
|
|
78
|
+
switch (tabValue) {
|
|
79
|
+
case types_1.TabValueEnum.THREE:
|
|
80
|
+
return 'ui.eventMembersWidget.requests';
|
|
81
|
+
case types_1.TabValueEnum.TWO:
|
|
82
|
+
return 'ui.eventMembersWidget.invited';
|
|
83
|
+
case types_1.TabValueEnum.ONE:
|
|
84
|
+
default:
|
|
85
|
+
return 'ui.eventMembersWidget.participants';
|
|
86
|
+
}
|
|
87
|
+
}, [tabValue]);
|
|
76
88
|
// CALLBACKS
|
|
77
89
|
const _initParticipants = (0, react_1.useCallback)(() => {
|
|
78
90
|
if (!participants.initialized && !participants.isLoadingNext) {
|
|
@@ -80,13 +92,14 @@ function EventMembersWidget(inProps) {
|
|
|
80
92
|
api_services_1.EventService.getUsersGoingToEvent(scEvent.id, Object.assign({}, endpointQueryParams))
|
|
81
93
|
.then((payload) => {
|
|
82
94
|
dispatchParticipants({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
|
|
95
|
+
setParticipantsCount(payload.count);
|
|
83
96
|
})
|
|
84
97
|
.catch((error) => {
|
|
85
98
|
dispatchParticipants({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
86
99
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
87
100
|
});
|
|
88
101
|
}
|
|
89
|
-
}, [participants.isLoadingNext, participants.initialized,
|
|
102
|
+
}, [participants.isLoadingNext, participants.initialized, scEvent]);
|
|
90
103
|
const _initInvited = (0, react_1.useCallback)(() => {
|
|
91
104
|
if (!invited.initialized && !invited.isLoadingNext && hasAllow) {
|
|
92
105
|
dispatchInvited({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
@@ -100,7 +113,7 @@ function EventMembersWidget(inProps) {
|
|
|
100
113
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
101
114
|
});
|
|
102
115
|
}
|
|
103
|
-
}, [invited.isLoadingNext, invited.initialized,
|
|
116
|
+
}, [invited.isLoadingNext, invited.initialized, scUserContext.user, scEvent]);
|
|
104
117
|
const _initRequests = (0, react_1.useCallback)(() => {
|
|
105
118
|
if (!requests.initialized && !requests.isLoadingNext && hasAllow) {
|
|
106
119
|
dispatchRequests({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
@@ -115,15 +128,19 @@ function EventMembersWidget(inProps) {
|
|
|
115
128
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
116
129
|
});
|
|
117
130
|
}
|
|
118
|
-
}, [requests.isLoadingNext, requests.initialized,
|
|
131
|
+
}, [requests.isLoadingNext, requests.initialized, scUserContext.user, scEvent]);
|
|
119
132
|
// EFFECTS
|
|
120
133
|
(0, react_1.useEffect)(() => {
|
|
121
134
|
let _t;
|
|
122
135
|
if (scUserContext.user && scEvent) {
|
|
123
136
|
_t = setTimeout(() => {
|
|
124
|
-
if (refresh) {
|
|
137
|
+
if (refresh === types_1.TabValueEnum.ONE) {
|
|
138
|
+
_initParticipants();
|
|
139
|
+
setRefresh(null);
|
|
140
|
+
}
|
|
141
|
+
else if (refresh === types_1.TabValueEnum.TWO) {
|
|
125
142
|
_initInvited();
|
|
126
|
-
setRefresh(
|
|
143
|
+
setRefresh(null);
|
|
127
144
|
}
|
|
128
145
|
else {
|
|
129
146
|
_initParticipants();
|
|
@@ -140,6 +157,15 @@ function EventMembersWidget(inProps) {
|
|
|
140
157
|
const handleTabChange = (0, react_1.useCallback)((_evt, newTabValue) => {
|
|
141
158
|
setTabValue(newTabValue);
|
|
142
159
|
}, []);
|
|
160
|
+
const handleRefresh = (0, react_1.useCallback)((_tabValue) => {
|
|
161
|
+
if (_tabValue === types_1.TabValueEnum.ONE) {
|
|
162
|
+
dispatchParticipants({ type: widget_1.actionWidgetTypes.RESET });
|
|
163
|
+
}
|
|
164
|
+
else if (_tabValue === types_1.TabValueEnum.TWO) {
|
|
165
|
+
dispatchInvited({ type: widget_1.actionWidgetTypes.RESET });
|
|
166
|
+
}
|
|
167
|
+
setRefresh(_tabValue);
|
|
168
|
+
}, []);
|
|
143
169
|
if (!scEvent && !participants.initialized) {
|
|
144
170
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
145
171
|
}
|
|
@@ -147,15 +173,15 @@ function EventMembersWidget(inProps) {
|
|
|
147
173
|
if (!scEvent) {
|
|
148
174
|
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
149
175
|
}
|
|
150
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), (0, jsx_runtime_1.jsxs)(lab_1.TabContext, Object.assign({ value: tabValue }, { children: [(0, jsx_runtime_1.jsxs)(lab_1.TabList, Object.assign({ className: classes.tabsWrapper, onChange: handleTabChange, textColor: "primary", indicatorColor: "primary", variant: "fullWidth" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children:
|
|
176
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), (0, jsx_runtime_1.jsxs)(lab_1.TabContext, Object.assign({ value: tabValue }, { children: [(0, jsx_runtime_1.jsxs)(lab_1.TabList, Object.assign({ className: classes.tabsWrapper, onChange: handleTabChange, textColor: "primary", indicatorColor: "primary", variant: "fullWidth" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: participantsCount })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.participants", defaultMessage: "ui.eventMembersWidget.participants" }) }))] })), value: types_1.TabValueEnum.ONE }), hasAllow && ((0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: invitedCount })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.invited", defaultMessage: "ui.eventMembersWidget.invited" }) }))] })), value: types_1.TabValueEnum.TWO })), hasAllow && ((0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: requestsCount })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.requests", defaultMessage: "ui.eventMembersWidget.requests" }) }))] })), value: types_1.TabValueEnum.THREE }))] })), (0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ value: types_1.TabValueEnum.ONE, className: classes.tabPanel }, { children: (0, jsx_runtime_1.jsx)(TabContentComponent_1.default, { tabValue: types_1.TabValueEnum.ONE, state: participants, dispatch: dispatchParticipants, userProps: userProps, dialogProps: dialogProps, handleRefresh: handleRefresh }) })), hasAllow && ((0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ value: types_1.TabValueEnum.TWO, className: classes.tabPanel }, { children: (0, jsx_runtime_1.jsx)(TabContentComponent_1.default, { tabValue: types_1.TabValueEnum.TWO, state: invited, dispatch: dispatchInvited, userProps: userProps, dialogProps: dialogProps, actionProps: {
|
|
151
177
|
scEvent,
|
|
152
178
|
setCount: setInvitedCount
|
|
153
|
-
},
|
|
179
|
+
}, handleRefresh: handleRefresh }) }))), hasAllow && ((0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ value: types_1.TabValueEnum.THREE, className: classes.tabPanel }, { children: (0, jsx_runtime_1.jsx)(TabContentComponent_1.default, { tabValue: types_1.TabValueEnum.THREE, state: requests, dispatch: dispatchRequests, userProps: userProps, dialogProps: dialogProps, actionProps: {
|
|
154
180
|
scEvent,
|
|
155
181
|
count: requestsCount,
|
|
156
182
|
setCount: setRequestsCount,
|
|
157
183
|
users: requestsUsers,
|
|
158
184
|
setUsers: setRequestsUsers
|
|
159
|
-
} }) })))] }))] })) })));
|
|
185
|
+
}, handleRefresh: handleRefresh }) })))] }))] })) })));
|
|
160
186
|
}
|
|
161
187
|
exports.default = EventMembersWidget;
|
|
@@ -2,8 +2,9 @@ import { SCEventType, SCUserType } from '@selfcommunity/types';
|
|
|
2
2
|
import { Dispatch, SetStateAction } from 'react';
|
|
3
3
|
import { BaseDialogProps } from '../../shared/BaseDialog';
|
|
4
4
|
import { UserProps } from '../User';
|
|
5
|
+
import { TabValueType } from './types';
|
|
5
6
|
interface TabComponentProps {
|
|
6
|
-
tabValue:
|
|
7
|
+
tabValue: TabValueType;
|
|
7
8
|
state: any;
|
|
8
9
|
dispatch: Dispatch<any>;
|
|
9
10
|
/**
|
|
@@ -23,7 +24,7 @@ interface TabComponentProps {
|
|
|
23
24
|
users?: SCUserType[];
|
|
24
25
|
setUsers?: Dispatch<SetStateAction<SCUserType[]>>;
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
handleRefresh?: (tabValue: TabValueType) => void;
|
|
27
28
|
}
|
|
28
29
|
export default function TabContentComponent(props: TabComponentProps): JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -6,9 +6,11 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
7
7
|
const utils_1 = require("@selfcommunity/utils");
|
|
8
8
|
const notistack_1 = require("notistack");
|
|
9
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
9
10
|
const react_1 = require("react");
|
|
10
11
|
const react_intl_1 = require("react-intl");
|
|
11
12
|
const Errors_1 = require("../../constants/Errors");
|
|
13
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
12
14
|
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
|
|
13
15
|
const InfiniteScroll_1 = tslib_1.__importDefault(require("../../shared/InfiniteScroll"));
|
|
14
16
|
const widget_1 = require("../../utils/widget");
|
|
@@ -17,6 +19,7 @@ const EventInviteButton_1 = tslib_1.__importDefault(require("../EventInviteButto
|
|
|
17
19
|
const InviteUserEventButton_1 = tslib_1.__importDefault(require("../InviteUserEventButton"));
|
|
18
20
|
const User_1 = tslib_1.__importStar(require("../User"));
|
|
19
21
|
const constants_1 = require("./constants");
|
|
22
|
+
const types_1 = require("./types");
|
|
20
23
|
const classes = {
|
|
21
24
|
actionButton: `${constants_1.PREFIX}-action-button`,
|
|
22
25
|
eventButton: `${constants_1.PREFIX}-event-button`,
|
|
@@ -31,13 +34,25 @@ const DialogRoot = (0, material_1.styled)(BaseDialog_1.default, {
|
|
|
31
34
|
})(() => ({}));
|
|
32
35
|
function TabContentComponent(props) {
|
|
33
36
|
// PROPS
|
|
34
|
-
const { state, dispatch, userProps, dialogProps, actionProps,
|
|
37
|
+
const { tabValue, state, dispatch, userProps, dialogProps, actionProps, handleRefresh } = props;
|
|
35
38
|
// STATE
|
|
36
39
|
const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
|
|
40
|
+
// REFS
|
|
41
|
+
const updatesInvited = (0, react_1.useRef)(null);
|
|
42
|
+
const updatesParticipants = (0, react_1.useRef)(null);
|
|
37
43
|
// HOOKS
|
|
38
44
|
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
39
45
|
// CONSTS
|
|
40
|
-
const users = (0, react_1.useMemo)(() => (tabValue ===
|
|
46
|
+
const users = (0, react_1.useMemo)(() => (tabValue === types_1.TabValueEnum.THREE ? actionProps === null || actionProps === void 0 ? void 0 : actionProps.users : state.results), [tabValue, actionProps, state]);
|
|
47
|
+
// EFFECTS
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
49
|
+
updatesInvited.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.EVENT}.${PubSub_1.SCGroupEventType.INVITE_MEMBER}`, handleInviteMember);
|
|
50
|
+
updatesParticipants.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.EVENT}.${PubSub_1.SCGroupEventType.ADD_MEMBER}`, handleToggleMember);
|
|
51
|
+
return () => {
|
|
52
|
+
updatesInvited.current && pubsub_js_1.default.unsubscribe(updatesInvited.current);
|
|
53
|
+
updatesParticipants.current && pubsub_js_1.default.unsubscribe(updatesParticipants.current);
|
|
54
|
+
};
|
|
55
|
+
}, []);
|
|
41
56
|
// HANDLERS
|
|
42
57
|
/**
|
|
43
58
|
* Handles pagination
|
|
@@ -55,13 +70,19 @@ function TabContentComponent(props) {
|
|
|
55
70
|
.catch((error) => {
|
|
56
71
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
57
72
|
});
|
|
58
|
-
}, [
|
|
73
|
+
}, [state.next, state.isLoadingNext, state.initialized]);
|
|
59
74
|
const handleToggleDialogOpen = (0, react_1.useCallback)(() => {
|
|
60
75
|
setOpenDialog((prev) => !prev);
|
|
61
76
|
}, []);
|
|
77
|
+
const handleToggleMember = (0, react_1.useCallback)(() => {
|
|
78
|
+
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.TabValueEnum.ONE);
|
|
79
|
+
}, []);
|
|
80
|
+
const handleInviteMember = (0, react_1.useCallback)(() => {
|
|
81
|
+
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.TabValueEnum.TWO);
|
|
82
|
+
}, []);
|
|
62
83
|
const getActionsComponent = (0, react_1.useCallback)((userId) => {
|
|
63
|
-
if (tabValue ===
|
|
64
|
-
const
|
|
84
|
+
if (tabValue === types_1.TabValueEnum.TWO && actionProps) {
|
|
85
|
+
const _handleInvitations = (invited) => {
|
|
65
86
|
var _a, _b;
|
|
66
87
|
if (invited) {
|
|
67
88
|
(_a = actionProps.setCount) === null || _a === void 0 ? void 0 : _a.call(actionProps, (prev) => prev - 1);
|
|
@@ -70,9 +91,9 @@ function TabContentComponent(props) {
|
|
|
70
91
|
(_b = actionProps.setCount) === null || _b === void 0 ? void 0 : _b.call(actionProps, (prev) => prev + 1);
|
|
71
92
|
}
|
|
72
93
|
};
|
|
73
|
-
return (0, jsx_runtime_1.jsx)(InviteUserEventButton_1.default, { event: actionProps.scEvent, userId: userId, handleInvitations:
|
|
94
|
+
return (0, jsx_runtime_1.jsx)(InviteUserEventButton_1.default, { event: actionProps.scEvent, userId: userId, handleInvitations: _handleInvitations });
|
|
74
95
|
}
|
|
75
|
-
else if (tabValue ===
|
|
96
|
+
else if (tabValue === types_1.TabValueEnum.THREE && actionProps) {
|
|
76
97
|
const handleConfirm = (id) => {
|
|
77
98
|
if (id) {
|
|
78
99
|
actionProps.setCount((prev) => prev - 1);
|
|
@@ -92,22 +113,21 @@ function TabContentComponent(props) {
|
|
|
92
113
|
return (0, jsx_runtime_1.jsx)(AcceptRequestUserEventButton_1.default, { event: actionProps.scEvent, userId: userId, handleConfirm: handleConfirm });
|
|
93
114
|
}
|
|
94
115
|
return undefined;
|
|
95
|
-
}, [tabValue, actionProps
|
|
96
|
-
if (tabValue ===
|
|
116
|
+
}, [tabValue, actionProps]);
|
|
117
|
+
if (tabValue === types_1.TabValueEnum.ONE && (actionProps === null || actionProps === void 0 ? void 0 : actionProps.count) === 0) {
|
|
97
118
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noParticipants", defaultMessage: "ui.eventMembersWidget.noParticipants" }) })));
|
|
98
119
|
}
|
|
99
|
-
if (tabValue ===
|
|
120
|
+
else if (tabValue === types_1.TabValueEnum.TWO && state.count === 0 && actionProps) {
|
|
100
121
|
const date = actionProps.scEvent.end_date || actionProps.scEvent.start_date;
|
|
101
122
|
const disabled = new Date(date).getTime() < new Date().getTime();
|
|
102
123
|
const handleInvitations = (invited) => {
|
|
103
124
|
if (invited) {
|
|
104
|
-
|
|
105
|
-
setRefresh(true);
|
|
125
|
+
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(tabValue);
|
|
106
126
|
}
|
|
107
127
|
};
|
|
108
128
|
return ((0, jsx_runtime_1.jsx)(EventInviteButton_1.default, { event: actionProps.scEvent, className: classes.eventButton, handleInvitations: handleInvitations, disabled: disabled }));
|
|
109
129
|
}
|
|
110
|
-
if (tabValue ===
|
|
130
|
+
else if (tabValue === types_1.TabValueEnum.THREE && (actionProps === null || actionProps === void 0 ? void 0 : actionProps.count) === 0) {
|
|
111
131
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noOtherRequests", defaultMessage: "ui.eventMembersWidget.noOtherRequests" }) })));
|
|
112
132
|
}
|
|
113
133
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), onClose: handleToggleDialogOpen, open: openDialog }, dialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: (0, jsx_runtime_1.jsx)(User_1.UserSkeleton, Object.assign({ elevation: 0 }, userProps)), className: classes.infiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: state.results.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps)) }, user.id))) }) })) })))] }));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TabValueEnum = void 0;
|
|
4
|
+
var TabValueEnum;
|
|
5
|
+
(function (TabValueEnum) {
|
|
6
|
+
TabValueEnum["ONE"] = "1";
|
|
7
|
+
TabValueEnum["TWO"] = "2";
|
|
8
|
+
TabValueEnum["THREE"] = "3";
|
|
9
|
+
})(TabValueEnum = exports.TabValueEnum || (exports.TabValueEnum = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SCEventType, SCUserType } from '@selfcommunity/types';
|
|
1
|
+
import { SCEventSubscriptionStatusType, SCEventType, SCUserType } from '@selfcommunity/types';
|
|
2
2
|
export interface EventSubscribeButtonProps {
|
|
3
3
|
/**
|
|
4
4
|
* Overrides or extends the styles applied to the component.
|
|
@@ -25,7 +25,7 @@ export interface EventSubscribeButtonProps {
|
|
|
25
25
|
* @param user
|
|
26
26
|
* @param joined
|
|
27
27
|
*/
|
|
28
|
-
onSubscribe?: (event: SCEventType, status:
|
|
28
|
+
onSubscribe?: (event: SCEventType, status: SCEventSubscriptionStatusType | null) => any;
|
|
29
29
|
/**
|
|
30
30
|
* Others properties
|
|
31
31
|
*/
|
|
@@ -10,9 +10,11 @@ const react_core_1 = require("@selfcommunity/react-core");
|
|
|
10
10
|
const types_1 = require("@selfcommunity/types");
|
|
11
11
|
const utils_1 = require("@selfcommunity/utils");
|
|
12
12
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
13
|
-
const
|
|
13
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
14
|
+
const react_1 = require("react");
|
|
14
15
|
const react_intl_1 = require("react-intl");
|
|
15
16
|
const Errors_1 = require("../../constants/Errors");
|
|
17
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
16
18
|
const PREFIX = 'SCEventSubscribeButton';
|
|
17
19
|
const classes = {
|
|
18
20
|
requestRoot: `${PREFIX}-request-root`,
|
|
@@ -83,7 +85,7 @@ function EventSubscribeButton(inProps) {
|
|
|
83
85
|
// STATE
|
|
84
86
|
const [status, setStatus] = (0, react_1.useState)(undefined);
|
|
85
87
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
86
|
-
const [anchorEl, setAnchorEl] = react_1.
|
|
88
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
87
89
|
const open = Boolean(anchorEl);
|
|
88
90
|
// CONTEXT
|
|
89
91
|
const scContext = (0, react_core_1.useSCContext)();
|
|
@@ -118,15 +120,16 @@ function EventSubscribeButton(inProps) {
|
|
|
118
120
|
const toggleEventAttendance = (eventStatus) => {
|
|
119
121
|
setLoading(true);
|
|
120
122
|
const isGoing = eventStatus === types_1.SCEventSubscriptionStatusType.GOING ||
|
|
121
|
-
!scEvent.subscription_status ||
|
|
123
|
+
!(scEvent === null || scEvent === void 0 ? void 0 : scEvent.subscription_status) ||
|
|
122
124
|
(scEvent === null || scEvent === void 0 ? void 0 : scEvent.subscription_status) === types_1.SCEventSubscriptionStatusType.INVITED;
|
|
123
125
|
const toggleAction = isGoing
|
|
124
|
-
? scEventsManager.toggleEventAttendance(scEvent, user
|
|
126
|
+
? scEventsManager.toggleEventAttendance(scEvent, (user === null || user === void 0 ? void 0 : user.id) || null)
|
|
125
127
|
: scEventsManager.toggleEventNonattendance(scEvent);
|
|
126
128
|
toggleAction
|
|
127
129
|
.then(() => {
|
|
128
|
-
onSubscribe
|
|
130
|
+
onSubscribe === null || onSubscribe === void 0 ? void 0 : onSubscribe(scEvent, (0, react_core_1.getEventStatus)(scEvent, isGoing));
|
|
129
131
|
setLoading(false);
|
|
132
|
+
pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.EVENT}.${PubSub_1.SCGroupEventType.ADD_MEMBER}`, scUserContext.user);
|
|
130
133
|
})
|
|
131
134
|
.catch((e) => {
|
|
132
135
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
@@ -39,6 +39,7 @@ const Feed_1 = require("../../constants/Feed");
|
|
|
39
39
|
const Composer_1 = tslib_1.__importDefault(require("../Composer"));
|
|
40
40
|
const FeedObjectMediaPreview_1 = tslib_1.__importDefault(require("../FeedObjectMediaPreview"));
|
|
41
41
|
const constants_1 = require("./constants");
|
|
42
|
+
const Media_1 = require("../../constants/Media");
|
|
42
43
|
const messages = (0, react_intl_1.defineMessages)({
|
|
43
44
|
visibleToAll: {
|
|
44
45
|
id: 'ui.feedObject.visibleToAll',
|
|
@@ -136,7 +137,7 @@ const Root = (0, styles_1.styled)(Widget_1.default, {
|
|
|
136
137
|
* @param inProps
|
|
137
138
|
*/
|
|
138
139
|
function FeedObject(inProps) {
|
|
139
|
-
var _a;
|
|
140
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m;
|
|
140
141
|
// PROPS
|
|
141
142
|
const props = (0, system_1.useThemeProps)({
|
|
142
143
|
props: inProps,
|
|
@@ -165,6 +166,8 @@ function FeedObject(inProps) {
|
|
|
165
166
|
const [isReplying, setIsReplying] = (0, react_1.useState)(false);
|
|
166
167
|
const [selectedActivities, setSelectedActivities] = (0, react_1.useState)(getInitialSelectedActivitiesType());
|
|
167
168
|
const [expanded, setExpanded] = (0, react_1.useState)(summaryExpanded);
|
|
169
|
+
const hasEvent = (0, react_1.useMemo)(() => { var _a; return (obj === null || obj === void 0 ? void 0 : obj.medias.length) && ((_a = obj.medias[0].embed) === null || _a === void 0 ? void 0 : _a.embed_type) === Media_1.MEDIA_EMBED_SC_SHARED_EVENT; }, [obj === null || obj === void 0 ? void 0 : obj.medias]);
|
|
170
|
+
const _hideFollowAction = (0, react_1.useMemo)(() => { var _a, _b, _c, _d; return hideFollowAction || (hasEvent && ((_d = (_c = (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.medias) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.embed) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.active) === false); }, [hideFollowAction, hasEvent, obj]);
|
|
168
171
|
// INTL
|
|
169
172
|
const intl = (0, react_intl_1.useIntl)();
|
|
170
173
|
/**
|
|
@@ -430,7 +433,8 @@ function FeedObject(inProps) {
|
|
|
430
433
|
template === feedObject_1.SCFeedObjectTemplateType.SEARCH) {
|
|
431
434
|
objElement = ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: obj ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: (0, classnames_1.default)({ [classes.deleted]: obj && obj.deleted }) }, { children: [obj.categories.length > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: classes.category }, { children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [obj.group && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.group }, { children: (0, jsx_runtime_1.jsx)(material_1.Chip, { color: "secondary", size: "small", icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "groups" }), component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id) }))), obj.event && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.event }, { children: (0, jsx_runtime_1.jsx)(material_1.Chip, { color: "secondary", size: "small", label: obj.event.name, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "CalendarIcon" }), component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id) })))] }), obj.categories.map((c) => ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.CATEGORY_ROUTE_NAME, c) }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "overline" }, { children: c.name })) }), c.id)))] }))), obj.group && !obj.categories.length && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.group }, { children: (0, jsx_runtime_1.jsx)(material_1.Chip, { color: "secondary", size: "small", icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "groups" }), label: obj.group.name, component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id) }))), obj.event && !obj.categories.length && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.event }, { children: (0, jsx_runtime_1.jsx)(material_1.Chip, { color: "secondary", size: "small", icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "CalendarIcon" }), label: obj.event.name, component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id) }))), (0, jsx_runtime_1.jsx)(material_1.CardHeader, { className: classes.header, avatar: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null }, { children: (0, jsx_runtime_1.jsx)(UserAvatar_1.default, Object.assign({ hide: !obj.author.community_badge }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, { children: obj.author.username })) })) })), title: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: obj.author.username })), subheader: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(obj), (0, contribution_1.getRouteData)(obj)), className: classes.activityAt }, { children: (0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { component: 'span', date: obj.added_at }) })), obj.location && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Bullet_1.default, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.location }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { children: "add_location_alt" }), (_a = obj.location) === null || _a === void 0 ? void 0 : _a.location] }))] })), (0, jsx_runtime_1.jsx)(Bullet_1.default, {}), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.tag }, { children: obj.addressing.length > 0 ? ((0, jsx_runtime_1.jsx)(Tags_1.default, { tags: obj.addressing, TagChipProps: { disposable: false, clickable: false } })) : obj.group ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: `${intl.formatMessage(messages.visibleToGroup, { group: obj.group.name })}` }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, Object.assign({ color: "disabled", fontSize: "small" }, { children: "groups" })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: `${intl.formatMessage(messages.visibleToAll)}` }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, Object.assign({ color: "disabled", fontSize: "small" }, { children: "public" })) }))) }))] }), action: renderHeaderAction() }), (0, jsx_runtime_1.jsxs)(CardContent_1.default, Object.assign({ classes: { root: classes.content } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.titleSection }, { children: 'title' in obj && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: template === feedObject_1.SCFeedObjectTemplateType.DETAIL ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", gutterBottom: true, className: classes.title }, { children: obj.title }))) : ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(obj), (0, contribution_1.getRouteData)(obj)) }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", gutterBottom: true, className: classes.title }, { children: obj.title })) }))) })) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.textSection }, { children: getContributionSummary(obj, template) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.mediasSection }, { children: (0, jsx_runtime_1.jsx)(FeedObjectMediaPreview_1.default, Object.assign({ medias: obj.medias }, FeedObjectMediaPreviewProps)) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.pollsSection }, { children: obj['poll'] && ((0, jsx_runtime_1.jsx)(Poll_1.default, Object.assign({ visible: pollVisible ||
|
|
432
435
|
template === feedObject_1.SCFeedObjectTemplateType.DETAIL ||
|
|
433
|
-
Boolean(obj.type !== types_1.SCContributionType.DISCUSSION && !obj.html && !obj.medias.length), feedObject: obj, pollObject: obj['poll'], onChange: handleChangePoll, onToggleVisibility: handleTogglePollVisibility }, PollObjectProps))) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.infoSection }, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [!hideParticipantsPreview && ((0, jsx_runtime_1.jsx)(Contributors_1.default, Object.assign({ feedObject: obj, feedObjectType: obj.type }, ContributorsFeedObjectProps, { cacheStrategy: cacheStrategy }))), !
|
|
436
|
+
Boolean(obj.type !== types_1.SCContributionType.DISCUSSION && !obj.html && !obj.medias.length), feedObject: obj, pollObject: obj['poll'], onChange: handleChangePoll, onToggleVisibility: handleTogglePollVisibility }, PollObjectProps))) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.infoSection }, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [!hideParticipantsPreview && ((0, jsx_runtime_1.jsx)(Contributors_1.default, Object.assign({ feedObject: obj, feedObjectType: obj.type }, ContributorsFeedObjectProps, { cacheStrategy: cacheStrategy }))), !_hideFollowAction && (0, jsx_runtime_1.jsx)(Follow_1.default, Object.assign({ feedObject: obj, feedObjectType: obj.type, handleFollow: handleFollow }, FollowButtonProps))] })) }))] })), (0, jsx_runtime_1.jsxs)(material_1.CardActions, Object.assign({ className: classes.actionsSection }, { children: [(0, jsx_runtime_1.jsx)(Actions_1.default, Object.assign({ feedObjectId: feedObjectId, feedObjectType: feedObjectType, feedObject: obj, hideCommentAction: template === feedObject_1.SCFeedObjectTemplateType.DETAIL || (hasEvent && !((_c = (_b = obj === null || obj === void 0 ? void 0 : obj.medias[0].embed) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.active)), handleExpandActivities: template === feedObject_1.SCFeedObjectTemplateType.PREVIEW ? handleExpandActivities : null, hideVoteAction: hasEvent && !((_f = (_d = obj === null || obj === void 0 ? void 0 : obj.medias[0].embed) === null || _d === void 0 ? void 0 : _d.metadata) === null || _f === void 0 ? void 0 : _f.active), hideShareAction: hasEvent && !((_h = (_g = obj === null || obj === void 0 ? void 0 : obj.medias[0].embed) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.active), VoteActionProps: { onVoteAction: handleVoteSuccess } }, ActionsProps)), (template === feedObject_1.SCFeedObjectTemplateType.DETAIL && (!hasEvent || ((_m = (_l = (_k = (_j = obj === null || obj === void 0 ? void 0 : obj.medias) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.embed) === null || _l === void 0 ? void 0 : _l.metadata) === null || _m === void 0 ? void 0 : _m.active) === true)) ||
|
|
437
|
+
(expandedActivities && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.replyContent }, { children: (0, jsx_runtime_1.jsx)(CommentObjectReplyComponent, Object.assign({ id: `reply-feedObject-${obj.id}`, onReply: handleReply, editable: !isReplying || Boolean(obj) }, CommentObjectReplyComponentProps), Number(isReplying)) }))))] })), template === feedObject_1.SCFeedObjectTemplateType.PREVIEW && (obj.comment_count > 0 || (feedObjectActivities && feedObjectActivities.length > 0)) && ((0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ in: expandedActivities, timeout: "auto", classes: { root: classes.activitiesSection } }, { children: (0, jsx_runtime_1.jsx)(CardContent_1.default, Object.assign({ className: classes.activitiesContent }, { children: (0, jsx_runtime_1.jsx)(Activities_1.default, Object.assign({ feedObject: obj, feedObjectActivities: feedObjectActivities, activitiesType: selectedActivities, onSetSelectedActivities: handleSelectedActivities, comments: comments, CommentsObjectProps: {
|
|
434
438
|
CommentComponentProps: Object.assign({ onDelete: handleDeleteComment, truncateContent: true, CommentsObjectComponentProps: { inPlaceLoadMoreContents: false } }, CommentComponentProps),
|
|
435
439
|
CommentObjectSkeletonProps: CommentObjectSkeletonProps
|
|
436
440
|
}, cacheStrategy: cacheStrategy }, ActivitiesProps), selectedActivities) })) }))), composerOpen && ((0, jsx_runtime_1.jsx)(Composer_1.default, { open: composerOpen, feedObject: obj, onClose: handleToggleEdit, onSuccess: handleEditSuccess, maxWidth: "sm", fullWidth: true }))] }))) : ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ template: template }, FeedObjectSkeletonProps))) }));
|
|
@@ -77,6 +77,7 @@ const messages = (0, react_intl_1.defineMessages)({
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
function ContributionActionsMenu(props) {
|
|
80
|
+
var _a, _b, _c;
|
|
80
81
|
// PROPS
|
|
81
82
|
const { className, feedObjectId, feedObject, feedObjectType = types_1.SCContributionType.POST, commentObjectId, commentObject, onFlagContribution, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onSuspendNotificationContribution, onSuspendNotificationEvent, PopperProps = {} } = props, rest = tslib_1.__rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onFlagContribution", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onSuspendNotificationContribution", "onSuspendNotificationEvent", "PopperProps"]);
|
|
82
83
|
// INTL
|
|
@@ -721,7 +722,13 @@ function ContributionActionsMenu(props) {
|
|
|
721
722
|
/**
|
|
722
723
|
* Renders component
|
|
723
724
|
*/
|
|
724
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton
|
|
725
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton
|
|
726
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
727
|
+
// @ts-ignore
|
|
728
|
+
, Object.assign({
|
|
729
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
730
|
+
// @ts-ignore
|
|
731
|
+
disabled: contributionObj && ((_a = contributionObj === null || contributionObj === void 0 ? void 0 : contributionObj.medias) === null || _a === void 0 ? void 0 : _a.length) && !((_c = (_b = contributionObj.medias[0].embed) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.active), ref: (ref) => {
|
|
725
732
|
popperRef.current = ref;
|
|
726
733
|
}, "aria-haspopup": "true", onClick: handleOpen, className: classes.button, size: "small" }, { children: contributionObj && (contributionObj.collapsed || contributionObj.deleted) ? ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: classes.visibilityIcons }, { children: [contributionObj.collapsed ? (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "visibility_off" }) : (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "delete" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "expand_more" })] }))) : ((0, jsx_runtime_1.jsx)(Icon_1.default, { children: "more_vert" })) })), isMobile ? ((0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, Object.assign({ open: open, onClose: handleClose, onOpen: handleOpen, anchor: "bottom", disableSwipeToOpen: true }, { children: renderContent() }))) : ((0, jsx_runtime_1.jsx)(PopperRoot, Object.assign({ open: open, anchorEl: popperRef.current, role: undefined, transition: true, className: classes.popperRoot }, PopperProps, { placement: "bottom-end" }, { children: ({ TransitionProps, placement }) => ((0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ variant: 'outlined', className: classes.paper }, { children: (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: handleClose }, { children: renderContent() })) })) }))) }))), openConfirmDialog && ((0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, Object.assign({ open: openConfirmDialog }, (currentAction === ContributionsActionsMenu_1.DELETE_CONTRIBUTION
|
|
727
734
|
? {
|