@selfcommunity/react-ui 0.7.50-events.105 → 0.7.50-events.107
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/EventHeader/EventHeader.js +2 -3
- package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +8 -2
- package/lib/cjs/components/Events/Events.js +9 -5
- package/lib/cjs/components/MyEventsWidget/MyEventsWidget.d.ts +1 -1
- package/lib/cjs/components/MyEventsWidget/MyEventsWidget.js +7 -3
- package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -1
- package/lib/cjs/components/RelatedEventsWidget/Skeleton.js +2 -2
- package/lib/cjs/constants/ContributionsActionsMenu.d.ts +1 -0
- package/lib/cjs/constants/ContributionsActionsMenu.js +2 -1
- package/lib/cjs/shared/ContributionActionsMenu/index.d.ts +4 -0
- package/lib/cjs/shared/ContributionActionsMenu/index.js +66 -13
- package/lib/cjs/shared/EventInfoDetails/index.d.ts +7 -6
- package/lib/cjs/shared/EventInfoDetails/index.js +6 -4
- package/lib/esm/components/EventHeader/EventHeader.js +2 -3
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +9 -3
- package/lib/esm/components/Events/Events.js +10 -6
- package/lib/esm/components/MyEventsWidget/MyEventsWidget.d.ts +1 -1
- package/lib/esm/components/MyEventsWidget/MyEventsWidget.js +8 -4
- package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +3 -3
- package/lib/esm/components/RelatedEventsWidget/Skeleton.js +3 -3
- package/lib/esm/constants/ContributionsActionsMenu.d.ts +1 -0
- package/lib/esm/constants/ContributionsActionsMenu.js +1 -0
- package/lib/esm/shared/ContributionActionsMenu/index.d.ts +4 -0
- package/lib/esm/shared/ContributionActionsMenu/index.js +67 -14
- package/lib/esm/shared/EventInfoDetails/index.d.ts +7 -6
- package/lib/esm/shared/EventInfoDetails/index.js +7 -5
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Box, Button, Chip, FormControl, Grid, Icon, InputLabel, MenuItem, Radio, Select, TextField, Typography } from '@mui/material';
|
|
3
|
+
import { Box, Button, Chip, FormControl, Grid, Icon, IconButton, InputLabel, MenuItem, Radio, Select, TextField, Typography } from '@mui/material';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { useThemeProps } from '@mui/system';
|
|
6
6
|
import { Endpoints, http } from '@selfcommunity/api-services';
|
|
@@ -81,7 +81,8 @@ export default function Events(inProps) {
|
|
|
81
81
|
const [events, setEvents] = useState([]);
|
|
82
82
|
const [loading, setLoading] = useState(true);
|
|
83
83
|
const [next, setNext] = useState(null);
|
|
84
|
-
const [
|
|
84
|
+
const [query, setQuery] = useState('');
|
|
85
|
+
const [search, setSearch] = useState(false);
|
|
85
86
|
const [dateSearch, setDateSearch] = useState(options[0].value);
|
|
86
87
|
const [showFollowed, setShowFollowed] = useState(false);
|
|
87
88
|
const [showPastEvents, setShowPastEvents] = useState(false);
|
|
@@ -111,13 +112,13 @@ export default function Events(inProps) {
|
|
|
111
112
|
* Fetches events list
|
|
112
113
|
*/
|
|
113
114
|
const fetchEvents = () => {
|
|
114
|
-
|
|
115
|
+
setLoading(true);
|
|
115
116
|
return http
|
|
116
117
|
.request({
|
|
117
118
|
url: endpoint.url({}),
|
|
118
119
|
method: endpoint.method,
|
|
119
120
|
params: Object.assign(Object.assign({}, endpointQueryParams), (general
|
|
120
|
-
? Object.assign(Object.assign(Object.assign(Object.assign({}, (search
|
|
121
|
+
? Object.assign(Object.assign(Object.assign(Object.assign({}, (search && { search: query })), (dateSearch !== SCEventDateFilterType.ANY && { date_filter: dateSearch })), (showFollowed && { follows: showFollowed })), (showPastEvents && { date_filter: SCEventDateFilterType.PAST })) : Object.assign({ subscription_status: SCEventSubscriptionStatusType.GOING }, (showPastEvents && { past: showPastEvents }))))
|
|
121
122
|
})
|
|
122
123
|
.then((res) => {
|
|
123
124
|
setEvents(res.data.results);
|
|
@@ -160,7 +161,8 @@ export default function Events(inProps) {
|
|
|
160
161
|
* @param event
|
|
161
162
|
*/
|
|
162
163
|
const handleOnChangeFilterName = (event) => {
|
|
163
|
-
|
|
164
|
+
setQuery(event.target.value);
|
|
165
|
+
setSearch(false);
|
|
164
166
|
};
|
|
165
167
|
/**
|
|
166
168
|
* Handle change time frame
|
|
@@ -172,7 +174,9 @@ export default function Events(inProps) {
|
|
|
172
174
|
/**
|
|
173
175
|
* Renders events list
|
|
174
176
|
*/
|
|
175
|
-
const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, autoHide: !events.length && !showPastEvents }) }))) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, md: 4 }, { children: _jsx(TextField, { size: 'small', fullWidth: true, value:
|
|
177
|
+
const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, autoHide: !events.length && !showPastEvents }) }))) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, md: 4 }, { children: _jsx(TextField, { size: 'small', fullWidth: true, value: query, label: _jsx(FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, InputProps: {
|
|
178
|
+
endAdornment: (_jsx(IconButton, Object.assign({ onClick: () => setSearch(true) }, { children: _jsx(Icon, { children: "search" }) })))
|
|
179
|
+
} }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), _jsx(Select, Object.assign({ disabled: showPastEvents, size: 'small', label: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), authUserId && (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(EventsChipRoot
|
|
176
180
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
177
181
|
// @ts-ignore
|
|
178
182
|
, {
|
|
@@ -3,7 +3,7 @@ import { WidgetProps } from '../Widget';
|
|
|
3
3
|
export interface MyEventsWidgetProps extends WidgetProps {
|
|
4
4
|
/**
|
|
5
5
|
* Feed API Query Params
|
|
6
|
-
* @default [{'limit': 20, 'offset': 0}]
|
|
6
|
+
* @default [{'limit': 20, 'offset': 0, subscription_status: 'going'}]
|
|
7
7
|
*/
|
|
8
8
|
endpointQueryParams?: Record<string, string | number>;
|
|
9
9
|
/**
|
|
@@ -5,19 +5,19 @@ import { styled } from '@mui/material/styles';
|
|
|
5
5
|
import { Box, useThemeProps } from '@mui/system';
|
|
6
6
|
import { Endpoints, EventService, http } from '@selfcommunity/api-services';
|
|
7
7
|
import { SCCache, SCRoutes, useSCPreferences, useSCRouting, useSCUser } from '@selfcommunity/react-core';
|
|
8
|
-
import { SCFeatureName } from '@selfcommunity/types';
|
|
8
|
+
import { SCEventSubscriptionStatusType, SCFeatureName } from '@selfcommunity/types';
|
|
9
9
|
import { Logger } from '@selfcommunity/utils';
|
|
10
10
|
import { useCallback, useEffect, useMemo, useReducer, useState } from 'react';
|
|
11
11
|
import { FormattedMessage } from 'react-intl';
|
|
12
12
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
13
13
|
import { DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET } from '../../constants/Pagination';
|
|
14
14
|
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
15
|
+
import { SCEventTemplateType } from '../../types/event';
|
|
15
16
|
import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../utils/widget';
|
|
17
|
+
import Event from '../Event';
|
|
16
18
|
import Widget from '../Widget';
|
|
17
19
|
import { PREFIX } from './constants';
|
|
18
20
|
import Skeleton from './Skeleton';
|
|
19
|
-
import { SCEventTemplateType } from '../../types/event';
|
|
20
|
-
import Event from '../Event';
|
|
21
21
|
const classes = {
|
|
22
22
|
root: `${PREFIX}-root`,
|
|
23
23
|
titleWrapper: `${PREFIX}-title-wrapper`,
|
|
@@ -45,7 +45,11 @@ export default function MyEventsWidget(inProps) {
|
|
|
45
45
|
name: PREFIX
|
|
46
46
|
});
|
|
47
47
|
// CONST
|
|
48
|
-
const { endpointQueryParams = {
|
|
48
|
+
const { endpointQueryParams = {
|
|
49
|
+
limit: DEFAULT_PAGINATION_LIMIT,
|
|
50
|
+
offset: DEFAULT_PAGINATION_OFFSET,
|
|
51
|
+
subscription_status: SCEventSubscriptionStatusType.GOING
|
|
52
|
+
}, cacheStrategy } = props, rest = __rest(props, ["endpointQueryParams", "cacheStrategy"]);
|
|
49
53
|
// STATE
|
|
50
54
|
const [state, dispatch] = useReducer(dataWidgetReducer, {
|
|
51
55
|
isLoadingNext: false,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Avatar, Button, CardActions, CardContent, Divider, List, ListItem, Stack, Typography, useThemeProps } from '@mui/material';
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import { Endpoints, EventService, http } from '@selfcommunity/api-services';
|
|
6
6
|
import { Link, SCCache, SCRoutes, useSCFetchEvent, useSCRouting, useSCUser } from '@selfcommunity/react-core';
|
|
7
7
|
import { Logger } from '@selfcommunity/utils';
|
|
8
|
-
import { useCallback, useEffect, useReducer, useState } from 'react';
|
|
8
|
+
import { Fragment, useCallback, useEffect, useReducer, useState } from 'react';
|
|
9
9
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
10
10
|
import 'swiper/css';
|
|
11
11
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
@@ -119,5 +119,5 @@ export default function RelatedEventsWidget(inProps) {
|
|
|
119
119
|
if (!scEvent || (state === null || state === void 0 ? void 0 : state.count) === 0) {
|
|
120
120
|
return _jsx(HiddenPlaceholder, {});
|
|
121
121
|
}
|
|
122
|
-
return (_jsxs(Root, Object.assign({ className: classes.root }, rest, { children: [_jsxs(CardContent, Object.assign({ className: classes.content }, { children: [_jsxs(Stack, Object.assign({ className: classes.header }, { children: [_jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, { id: (_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id }), className: classes.avatarWrapper }, { children: _jsx(Avatar, { variant: "rounded", src: scEvent.managed_by.avatar, alt: scEvent.managed_by.username, className: classes.avatar }) })), _jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx("b", { children: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }) }) }))] })), _jsx(Stack, Object.assign({ className: classes.eventWrapper }, { children: state === null || state === void 0 ? void 0 : state.results.map((_event, i, array) => (_jsxs(
|
|
122
|
+
return (_jsxs(Root, Object.assign({ className: classes.root }, rest, { children: [_jsxs(CardContent, Object.assign({ className: classes.content }, { children: [_jsxs(Stack, Object.assign({ className: classes.header }, { children: [_jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, { id: (_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id }), className: classes.avatarWrapper }, { children: _jsx(Avatar, { variant: "rounded", src: scEvent.managed_by.avatar, alt: scEvent.managed_by.username, className: classes.avatar }) })), _jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx("b", { children: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }) }) }))] })), _jsx(Stack, Object.assign({ className: classes.eventWrapper }, { children: state === null || state === void 0 ? void 0 : state.results.map((_event, i, array) => (_jsxs(Fragment, { children: [_jsx(Event, Object.assign({ event: _event, eventId: _event.id }, eventComponentProps, { className: classes.event })), i < array.length - 1 && _jsx(Divider, {})] }, i))) }))] })), state.count > state.visibleItems && (_jsx(CardActions, Object.assign({ className: classes.actions }, { children: _jsx(Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: _jsx(Typography, Object.assign({ variant: "caption" }, { children: _jsx(FormattedMessage, { id: "ui.relatedEventsWidget.showAll", defaultMessage: "ui.relatedEventsWidget.showAll" }) })) })) }))), openDialog && (_jsx(DialogRoot, Object.assign({ className: classes.dialogRoot, title: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }), onClose: handleToggleDialogOpen, open: openDialog }, dialogProps, { children: _jsx(InfiniteScroll, Object.assign({ dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: _jsx(EventSkeleton, Object.assign({ elevation: 0 }, eventComponentProps)), className: classes.infiniteScroll, endMessage: _jsx(Typography, Object.assign({ className: classes.endMessage }, { children: _jsx(FormattedMessage, { id: "ui.relatedEventsWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: _jsx(List, { children: state.results.map((event) => (_jsx(ListItem, { children: _jsx(Event, Object.assign({ elevation: 0, event: event }, eventComponentProps)) }, event.id))) }) })) })))] })));
|
|
123
123
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CardActions, CardContent, Divider, Skeleton, Stack } from '@mui/material';
|
|
3
3
|
import { styled } from '@mui/system';
|
|
4
|
+
import { Fragment } from 'react';
|
|
4
5
|
import 'swiper/css';
|
|
5
6
|
import { EventSkeleton } from '../Event';
|
|
6
|
-
import { UserSkeleton } from '../User';
|
|
7
7
|
import Widget from '../Widget';
|
|
8
8
|
import { PREFIX } from './constants';
|
|
9
9
|
const classes = {
|
|
@@ -20,5 +20,5 @@ const Root = styled(Widget, {
|
|
|
20
20
|
overridesResolver: (_props, styles) => styles.skeletonRoot
|
|
21
21
|
})(() => ({}));
|
|
22
22
|
export default function RelatedEventsWidgetSkeleton() {
|
|
23
|
-
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [
|
|
23
|
+
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(CardContent, Object.assign({ className: classes.content }, { children: _jsx(Stack, Object.assign({ className: classes.eventWrapper }, { children: [1, 2, 3, 4].map((_event, i, array) => (_jsxs(Fragment, { children: [_jsx(EventSkeleton, { elevation: 0, className: classes.event }), i < array.length - 1 && _jsx(Divider, {})] }, i))) })) })), _jsx(CardActions, Object.assign({ className: classes.actions }, { children: _jsx(Skeleton, { animation: "wave", width: "52px", height: "20px" }) }))] })));
|
|
24
24
|
}
|
|
@@ -14,5 +14,6 @@ export declare const EDIT_CONTRIBUTION = "_edit_contribution";
|
|
|
14
14
|
export declare const DELETE_CONTRIBUTION = "_delete_contribution";
|
|
15
15
|
export declare const RESTORE_CONTRIBUTION = "_restore_contribution";
|
|
16
16
|
export declare const SUSPEND_NOTIFICATION_CONTRIBUTION = "_suspend_notification_contribution";
|
|
17
|
+
export declare const SUSPEND_NOTIFICATION_EVENT = "_suspend_notification_event";
|
|
17
18
|
export declare const MODERATE_CONTRIBUTION_HIDDEN = "_moderate_contribution_hidden";
|
|
18
19
|
export declare const MODERATE_CONTRIBUTION_DELETED = "_moderate_contribution_deleted";
|
|
@@ -14,5 +14,6 @@ export const EDIT_CONTRIBUTION = '_edit_contribution';
|
|
|
14
14
|
export const DELETE_CONTRIBUTION = '_delete_contribution';
|
|
15
15
|
export const RESTORE_CONTRIBUTION = '_restore_contribution';
|
|
16
16
|
export const SUSPEND_NOTIFICATION_CONTRIBUTION = '_suspend_notification_contribution';
|
|
17
|
+
export const SUSPEND_NOTIFICATION_EVENT = '_suspend_notification_event';
|
|
17
18
|
export const MODERATE_CONTRIBUTION_HIDDEN = '_moderate_contribution_hidden';
|
|
18
19
|
export const MODERATE_CONTRIBUTION_DELETED = '_moderate_contribution_deleted';
|
|
@@ -54,6 +54,10 @@ export interface ContributionActionsMenuProps {
|
|
|
54
54
|
* Handle suspend notification obj
|
|
55
55
|
*/
|
|
56
56
|
onSuspendNotificationContribution?: (obj: SCCommentType | SCFeedObjectType) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Handle suspend notification event embedded in obj
|
|
59
|
+
*/
|
|
60
|
+
onSuspendNotificationEvent?: (obj: SCCommentType | SCFeedObjectType) => void;
|
|
57
61
|
/**
|
|
58
62
|
* Props to spread to popper
|
|
59
63
|
* @default empty object
|
|
@@ -17,7 +17,7 @@ import { MODERATION_CONTRIBUTION_STATE_DELETED, MODERATION_CONTRIBUTION_STATE_HI
|
|
|
17
17
|
import { Endpoints, http } from '@selfcommunity/api-services';
|
|
18
18
|
import { SCContext, SCUserContext, UserUtils, useSCFetchCommentObject, useSCFetchFeedObject, useSCRouting } from '@selfcommunity/react-core';
|
|
19
19
|
import { SCContributionType } from '@selfcommunity/types';
|
|
20
|
-
import { DELETE_CONTRIBUTION, DELETE_CONTRIBUTION_SECTION, EDIT_CONTRIBUTION, FLAG_CONTRIBUTION_SECTION, GENERAL_SECTION, GET_CONTRIBUTION_PERMALINK, HIDE_CONTRIBUTION_SECTION, MODERATE_CONTRIBUTION_DELETED, MODERATE_CONTRIBUTION_HIDDEN, RESTORE_CONTRIBUTION, SUSPEND_NOTIFICATION_CONTRIBUTION } from '../../constants/ContributionsActionsMenu';
|
|
20
|
+
import { DELETE_CONTRIBUTION, DELETE_CONTRIBUTION_SECTION, EDIT_CONTRIBUTION, FLAG_CONTRIBUTION_SECTION, GENERAL_SECTION, GET_CONTRIBUTION_PERMALINK, HIDE_CONTRIBUTION_SECTION, MODERATE_CONTRIBUTION_DELETED, MODERATE_CONTRIBUTION_HIDDEN, RESTORE_CONTRIBUTION, SUSPEND_NOTIFICATION_CONTRIBUTION, SUSPEND_NOTIFICATION_EVENT } from '../../constants/ContributionsActionsMenu';
|
|
21
21
|
const PREFIX = 'SCContributionActionsMenu';
|
|
22
22
|
const classes = {
|
|
23
23
|
root: `${PREFIX}-root`,
|
|
@@ -76,7 +76,7 @@ const messages = defineMessages({
|
|
|
76
76
|
});
|
|
77
77
|
export default function ContributionActionsMenu(props) {
|
|
78
78
|
// PROPS
|
|
79
|
-
const { className, feedObjectId, feedObject, feedObjectType = SCContributionType.POST, commentObjectId, commentObject, onFlagContribution, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onSuspendNotificationContribution, PopperProps = {} } = props, rest = __rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onFlagContribution", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onSuspendNotificationContribution", "PopperProps"]);
|
|
79
|
+
const { className, feedObjectId, feedObject, feedObjectType = SCContributionType.POST, commentObjectId, commentObject, onFlagContribution, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onSuspendNotificationContribution, onSuspendNotificationEvent, PopperProps = {} } = props, rest = __rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onFlagContribution", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onSuspendNotificationContribution", "onSuspendNotificationEvent", "PopperProps"]);
|
|
80
80
|
// INTL
|
|
81
81
|
const intl = useIntl();
|
|
82
82
|
// CONTEXT
|
|
@@ -171,7 +171,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
|
-
* Performs
|
|
174
|
+
* Performs notification suspension
|
|
175
175
|
*/
|
|
176
176
|
const performSuspendNotification = useMemo(() => () => {
|
|
177
177
|
return http
|
|
@@ -186,14 +186,30 @@ export default function ContributionActionsMenu(props) {
|
|
|
186
186
|
return Promise.resolve(res.data);
|
|
187
187
|
});
|
|
188
188
|
}, [contributionObj]);
|
|
189
|
+
/**
|
|
190
|
+
* Performs notification suspension of event embedded
|
|
191
|
+
*/
|
|
192
|
+
const performSuspendNotificationEvent = useMemo(() => () => {
|
|
193
|
+
const _endpoint = contributionObj.event.show_on_feed ? Endpoints.HideEvent : Endpoints.ShowEvent;
|
|
194
|
+
return http
|
|
195
|
+
.request({
|
|
196
|
+
url: _endpoint.url({ id: contributionObj.event.id }),
|
|
197
|
+
method: _endpoint.method
|
|
198
|
+
})
|
|
199
|
+
.then((res) => {
|
|
200
|
+
if (res.status >= 300) {
|
|
201
|
+
return Promise.reject(res);
|
|
202
|
+
}
|
|
203
|
+
return Promise.resolve(res.data);
|
|
204
|
+
});
|
|
205
|
+
}, [contributionObj]);
|
|
189
206
|
/**
|
|
190
207
|
* Handles stop notification for contributionObj
|
|
191
|
-
* @param contribution
|
|
192
208
|
*/
|
|
193
209
|
function handleSuspendContentNotification() {
|
|
194
210
|
setCurrentActionLoading(SUSPEND_NOTIFICATION_CONTRIBUTION);
|
|
195
211
|
performSuspendNotification()
|
|
196
|
-
.then((
|
|
212
|
+
.then(() => {
|
|
197
213
|
const _feedObj = Object.assign({}, feedObj, { suspended: !feedObj.suspended });
|
|
198
214
|
setFeedObj(_feedObj);
|
|
199
215
|
onSuspendNotificationContribution && onSuspendNotificationContribution(_feedObj);
|
|
@@ -209,6 +225,29 @@ export default function ContributionActionsMenu(props) {
|
|
|
209
225
|
});
|
|
210
226
|
});
|
|
211
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Handles stop notification for event embedded in contributionObj
|
|
230
|
+
*/
|
|
231
|
+
function handleSuspendEventNotification() {
|
|
232
|
+
setCurrentActionLoading(SUSPEND_NOTIFICATION_EVENT);
|
|
233
|
+
performSuspendNotificationEvent()
|
|
234
|
+
.then(() => {
|
|
235
|
+
const _eventObj = Object.assign({}, feedObj.event, { show_on_feed: !feedObj.event.show_on_feed });
|
|
236
|
+
const _feedObj = Object.assign({}, feedObj, { event: _eventObj });
|
|
237
|
+
setFeedObj(_feedObj);
|
|
238
|
+
onSuspendNotificationEvent && onSuspendNotificationEvent(_feedObj);
|
|
239
|
+
setCurrentActionLoading(null);
|
|
240
|
+
})
|
|
241
|
+
.catch((error) => {
|
|
242
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
243
|
+
setCurrentAction(null);
|
|
244
|
+
setCurrentActionLoading(null);
|
|
245
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.contributionActionMenu.actionError", defaultMessage: "ui.contributionActionMenu.actionError" }), {
|
|
246
|
+
variant: 'error',
|
|
247
|
+
autoHideDuration: 3000
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}
|
|
212
251
|
/**
|
|
213
252
|
* Get Status Flag
|
|
214
253
|
*/
|
|
@@ -353,7 +392,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
353
392
|
else if (contributionObj && !isLoading && !isFlagging && type !== 'undefined') {
|
|
354
393
|
setIsFlagging(true);
|
|
355
394
|
performFlag(type)
|
|
356
|
-
.then((
|
|
395
|
+
.then(() => {
|
|
357
396
|
setFlagType(flagType === type ? null : type);
|
|
358
397
|
setIsFlagging(false);
|
|
359
398
|
onFlagContribution && onFlagContribution(contributionObj, type, flagType !== type);
|
|
@@ -441,6 +480,10 @@ export default function ContributionActionsMenu(props) {
|
|
|
441
480
|
setCurrentAction(SUSPEND_NOTIFICATION_CONTRIBUTION);
|
|
442
481
|
handleSuspendContentNotification();
|
|
443
482
|
}
|
|
483
|
+
else if (action === SUSPEND_NOTIFICATION_EVENT) {
|
|
484
|
+
setCurrentAction(SUSPEND_NOTIFICATION_EVENT);
|
|
485
|
+
handleSuspendEventNotification();
|
|
486
|
+
}
|
|
444
487
|
else if (action === MODERATE_CONTRIBUTION_HIDDEN) {
|
|
445
488
|
setCurrentAction(MODERATE_CONTRIBUTION_HIDDEN);
|
|
446
489
|
setOpenConfirmDialog(true);
|
|
@@ -494,7 +537,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
494
537
|
if (currentAction === DELETE_CONTRIBUTION) {
|
|
495
538
|
setCurrentActionLoading(DELETE_CONTRIBUTION);
|
|
496
539
|
performDeleteContribution()
|
|
497
|
-
.then((
|
|
540
|
+
.then(() => {
|
|
498
541
|
const _contributionObj = Object.assign({}, contributionObj, { deleted: true });
|
|
499
542
|
onDeleteContribution && onDeleteContribution(_contributionObj);
|
|
500
543
|
performPostConfirmAction(true);
|
|
@@ -507,7 +550,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
507
550
|
else if (currentAction === RESTORE_CONTRIBUTION) {
|
|
508
551
|
setCurrentActionLoading(RESTORE_CONTRIBUTION);
|
|
509
552
|
performRestoreContribution()
|
|
510
|
-
.then((
|
|
553
|
+
.then(() => {
|
|
511
554
|
const _contributionObj = Object.assign({}, contributionObj, { deleted: false });
|
|
512
555
|
onRestoreContribution && onRestoreContribution(_contributionObj);
|
|
513
556
|
performPostConfirmAction(true);
|
|
@@ -520,7 +563,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
520
563
|
else if (currentAction === MODERATE_CONTRIBUTION_HIDDEN) {
|
|
521
564
|
setCurrentActionLoading(MODERATE_CONTRIBUTION_HIDDEN);
|
|
522
565
|
performModerationContribution(MODERATION_TYPE_ACTION_HIDE, hideFlagType)
|
|
523
|
-
.then((
|
|
566
|
+
.then(() => {
|
|
524
567
|
const _contributionObj = Object.assign({}, contributionObj, { collapsed: !contributionObj.collapsed });
|
|
525
568
|
setHideType(hideType === hideFlagType ? null : hideFlagType);
|
|
526
569
|
setHideFlagType(null);
|
|
@@ -535,7 +578,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
535
578
|
else if (currentAction === MODERATE_CONTRIBUTION_DELETED) {
|
|
536
579
|
setCurrentActionLoading(MODERATE_CONTRIBUTION_DELETED);
|
|
537
580
|
performModerationContribution(MODERATION_TYPE_ACTION_DELETE, deleteFlagType)
|
|
538
|
-
.then((
|
|
581
|
+
.then(() => {
|
|
539
582
|
const _contributionObj = Object.assign({}, contributionObj, { deleted: !contributionObj.deleted });
|
|
540
583
|
setDeleteType(deleteType === deleteFlagType ? null : deleteFlagType);
|
|
541
584
|
setDeleteFlagType(null);
|
|
@@ -578,9 +621,9 @@ export default function ContributionActionsMenu(props) {
|
|
|
578
621
|
return name;
|
|
579
622
|
}
|
|
580
623
|
/**
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
624
|
+
* action
|
|
625
|
+
* @param sectionId
|
|
626
|
+
*/
|
|
584
627
|
function handleOpenSection(sectionId) {
|
|
585
628
|
if (sectionId) {
|
|
586
629
|
if (sectionId === openSection) {
|
|
@@ -651,11 +694,21 @@ export default function ContributionActionsMenu(props) {
|
|
|
651
694
|
contributionObj &&
|
|
652
695
|
contributionObj.type !== SCContributionType.COMMENT);
|
|
653
696
|
}
|
|
697
|
+
/**
|
|
698
|
+
* Can authenticated user suspend notification for the event related to the contribution
|
|
699
|
+
*/
|
|
700
|
+
function canSuspendNotificationEvent() {
|
|
701
|
+
return (scUserContext.user &&
|
|
702
|
+
scUserContext.user.id !== contributionObj.author.id &&
|
|
703
|
+
contributionObj &&
|
|
704
|
+
contributionObj.type !== SCContributionType.COMMENT &&
|
|
705
|
+
Boolean(contributionObj.event));
|
|
706
|
+
}
|
|
654
707
|
/**
|
|
655
708
|
* Renders section general
|
|
656
709
|
*/
|
|
657
710
|
function renderGeneralSection() {
|
|
658
|
-
return (_jsxs(Box, { children: [_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "link" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.permanentLink", defaultMessage: "ui.contributionActionMenu.permanentLink" }), onClick: () => handleAction(GET_CONTRIBUTION_PERMALINK), classes: { root: classes.itemText } })] })), canModifyContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "edit" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.editContribution", defaultMessage: "ui.contributionActionMenu.editContribution" }), onClick: () => handleAction(EDIT_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canDeleteContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === DELETE_CONTRIBUTION || currentActionLoading === RESTORE_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : (_jsx(Icon, { children: "delete" })) }), contributionObj.deleted ? (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.restoreContribution", defaultMessage: "ui.contributionActionMenu.restoreContribution" }), onClick: () => handleAction(RESTORE_CONTRIBUTION), classes: { root: classes.itemText } })) : (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.deleteContribution", defaultMessage: "ui.contributionActionMenu.deleteContribution" }), onClick: () => handleAction(DELETE_CONTRIBUTION), classes: { root: classes.itemText } }))] }))), canSuspendNotificationContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === SUSPEND_NOTIFICATION_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : contributionObj['suspended'] ? (_jsx(Icon, { children: "notifications_active" })) : (_jsx(Icon, { children: "notifications_off" })) }), _jsx(ListItemText, { primary: contributionObj['suspended'] ? (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(SUSPEND_NOTIFICATION_CONTRIBUTION), classes: { root: classes.itemText } })] })))] }, GENERAL_SECTION));
|
|
711
|
+
return (_jsxs(Box, { children: [_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "link" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.permanentLink", defaultMessage: "ui.contributionActionMenu.permanentLink" }), onClick: () => handleAction(GET_CONTRIBUTION_PERMALINK), classes: { root: classes.itemText } })] })), canModifyContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "edit" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.editContribution", defaultMessage: "ui.contributionActionMenu.editContribution" }), onClick: () => handleAction(EDIT_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canDeleteContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === DELETE_CONTRIBUTION || currentActionLoading === RESTORE_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : (_jsx(Icon, { children: "delete" })) }), contributionObj.deleted ? (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.restoreContribution", defaultMessage: "ui.contributionActionMenu.restoreContribution" }), onClick: () => handleAction(RESTORE_CONTRIBUTION), classes: { root: classes.itemText } })) : (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.deleteContribution", defaultMessage: "ui.contributionActionMenu.deleteContribution" }), onClick: () => handleAction(DELETE_CONTRIBUTION), classes: { root: classes.itemText } }))] }))), canSuspendNotificationContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === SUSPEND_NOTIFICATION_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : contributionObj['suspended'] ? (_jsx(Icon, { children: "notifications_active" })) : (_jsx(Icon, { children: "notifications_off" })) }), _jsx(ListItemText, { primary: contributionObj['suspended'] ? (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(SUSPEND_NOTIFICATION_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canSuspendNotificationEvent() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === SUSPEND_NOTIFICATION_EVENT ? (_jsx(CircularProgress, { size: 20 })) : contributionObj.event['show_on_feed'] ? (_jsx(Icon, { children: "notifications_active" })) : (_jsx(Icon, { children: "notifications_off" })) }), _jsx(ListItemText, { primary: !contributionObj.event['show_on_feed'] ? (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(SUSPEND_NOTIFICATION_EVENT), classes: { root: classes.itemText } })] })))] }, GENERAL_SECTION));
|
|
659
712
|
}
|
|
660
713
|
/**
|
|
661
714
|
* Renders contribution menu content
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
-
import
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
export interface EventInfoDetailsProps {
|
|
4
4
|
event: SCEventType;
|
|
5
5
|
hideDateIcon?: boolean;
|
|
@@ -12,10 +12,11 @@ export interface EventInfoDetailsProps {
|
|
|
12
12
|
hasPrivacyInfo?: boolean;
|
|
13
13
|
hasLocationInfo?: boolean;
|
|
14
14
|
hasCreatedInfo?: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
hasInProgress?: boolean;
|
|
16
|
+
beforeDateInfo?: ReactNode | null;
|
|
17
|
+
beforeRecurringInfo?: ReactNode | null;
|
|
18
|
+
beforePrivacyInfo?: ReactNode | null;
|
|
19
|
+
beforeLocationInfo?: ReactNode | null;
|
|
20
|
+
beforeCreatedInfo?: ReactNode | null;
|
|
20
21
|
}
|
|
21
22
|
export default function EventInfoDetails(inProps: EventInfoDetailsProps): JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Icon, Stack, styled, Typography, useThemeProps } from '@mui/material';
|
|
2
|
+
import { Box, Icon, Stack, styled, Tooltip, Typography, useThemeProps } from '@mui/material';
|
|
3
3
|
import { Link } from '@selfcommunity/react-core';
|
|
4
4
|
import { SCEventLocationType, SCEventPrivacyType, SCEventRecurrenceType } from '@selfcommunity/types';
|
|
5
|
+
import { useMemo } from 'react';
|
|
5
6
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
6
7
|
const PREFIX = 'SCEventInfoDetails';
|
|
7
8
|
const classes = {
|
|
8
9
|
root: `${PREFIX}-root`,
|
|
9
10
|
iconTextWrapper: `${PREFIX}-icon-text-wrapper`,
|
|
11
|
+
live: `${PREFIX}-live`,
|
|
10
12
|
link: `${PREFIX}-link`,
|
|
11
13
|
url: `${PREFIX}-url`,
|
|
12
14
|
creationWrapper: `${PREFIX}-creation-wrapper`
|
|
@@ -22,11 +24,11 @@ export default function EventInfoDetails(inProps) {
|
|
|
22
24
|
props: inProps,
|
|
23
25
|
name: PREFIX
|
|
24
26
|
});
|
|
25
|
-
const { event, hideDateIcon = false, hideRecurringIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasRecurringInfo = false, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, beforeDateInfo, beforeRecurringInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
|
|
27
|
+
const { event, hideDateIcon = false, hideRecurringIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasRecurringInfo = false, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, hasInProgress = true, beforeDateInfo, beforeRecurringInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
|
|
26
28
|
// HOOKS
|
|
27
29
|
const intl = useIntl();
|
|
28
|
-
const privacy = event.privacy === SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private';
|
|
29
|
-
const location = event.location === SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson';
|
|
30
|
+
const privacy = useMemo(() => (event.privacy === SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private'), [event]);
|
|
31
|
+
const location = useMemo(() => (event.location === SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson'), [event]);
|
|
30
32
|
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "CalendarIcon" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.date.startEndTime", defaultMessage: "ui.eventInfoDetails.date.startEndTime", values: {
|
|
31
33
|
date: intl.formatDate(event.running ? event.running_start_date : event.next_start_date, {
|
|
32
34
|
weekday: 'long',
|
|
@@ -35,7 +37,7 @@ export default function EventInfoDetails(inProps) {
|
|
|
35
37
|
month: 'long'
|
|
36
38
|
}),
|
|
37
39
|
start: intl.formatDate(event.running ? event.running_start_date : event.next_start_date, { hour: 'numeric', minute: 'numeric' })
|
|
38
|
-
} }) }))] }))), beforeRecurringInfo, hasRecurringInfo && event.recurring !== SCEventRecurrenceType.NEVER && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideRecurringIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "frequency" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder`, defaultMessage: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder` }) }))] }))), beforePrivacyInfo, hasPrivacyInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.privacy === SCEventPrivacyType.PUBLIC ? 'public' : 'private' })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: privacy, defaultMessage: privacy }) })), "-", _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: location, defaultMessage: location }) }))] }))), beforeLocationInfo, hasLocationInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && (_jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.location === SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), event.location === SCEventLocationType.ONLINE ? (_jsx(Link, Object.assign({ to: event.link, target: "_blank", className: classes.link }, { children: _jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.link })) }))) : (_jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.geolocation })))] }))), beforeCreatedInfo, hasCreatedInfo && (_jsxs(Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "create" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
|
|
40
|
+
} }) })), hasInProgress && (_jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.inProgress", defaultMessage: "ui.eventInfoDetails.inProgress" }) }, { children: _jsx(Box, { className: classes.live }) })))] }))), beforeRecurringInfo, hasRecurringInfo && event.recurring !== SCEventRecurrenceType.NEVER && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideRecurringIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "frequency" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder`, defaultMessage: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder` }) }))] }))), beforePrivacyInfo, hasPrivacyInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.privacy === SCEventPrivacyType.PUBLIC ? 'public' : 'private' })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: privacy, defaultMessage: privacy }) })), "-", _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: location, defaultMessage: location }) }))] }))), beforeLocationInfo, hasLocationInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && (_jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.location === SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), event.location === SCEventLocationType.ONLINE ? (_jsx(Link, Object.assign({ to: event.link, target: "_blank", className: classes.link }, { children: _jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.link })) }))) : (_jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.geolocation })))] }))), beforeCreatedInfo, hasCreatedInfo && (_jsxs(Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "create" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
|
|
39
41
|
date: intl.formatDate(event.created_at, {
|
|
40
42
|
weekday: 'long',
|
|
41
43
|
day: 'numeric',
|