@selfcommunity/react-ui 0.7.50-events.106 → 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/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/cjs/components/MyEventsWidget/MyEventsWidget.d.ts +1 -1
- package/lib/cjs/components/MyEventsWidget/MyEventsWidget.js +7 -3
- 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 +1 -0
- package/lib/cjs/shared/EventInfoDetails/index.js +3 -2
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/esm/components/MyEventsWidget/MyEventsWidget.d.ts +1 -1
- package/lib/esm/components/MyEventsWidget/MyEventsWidget.js +8 -4
- 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 +1 -0
- package/lib/esm/shared/EventInfoDetails/index.js +4 -3
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
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
5
|
import { useMemo } from 'react';
|
|
@@ -8,6 +8,7 @@ const PREFIX = 'SCEventInfoDetails';
|
|
|
8
8
|
const classes = {
|
|
9
9
|
root: `${PREFIX}-root`,
|
|
10
10
|
iconTextWrapper: `${PREFIX}-icon-text-wrapper`,
|
|
11
|
+
live: `${PREFIX}-live`,
|
|
11
12
|
link: `${PREFIX}-link`,
|
|
12
13
|
url: `${PREFIX}-url`,
|
|
13
14
|
creationWrapper: `${PREFIX}-creation-wrapper`
|
|
@@ -23,7 +24,7 @@ export default function EventInfoDetails(inProps) {
|
|
|
23
24
|
props: inProps,
|
|
24
25
|
name: PREFIX
|
|
25
26
|
});
|
|
26
|
-
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;
|
|
27
28
|
// HOOKS
|
|
28
29
|
const intl = useIntl();
|
|
29
30
|
const privacy = useMemo(() => (event.privacy === SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private'), [event]);
|
|
@@ -36,7 +37,7 @@ export default function EventInfoDetails(inProps) {
|
|
|
36
37
|
month: 'long'
|
|
37
38
|
}),
|
|
38
39
|
start: intl.formatDate(event.running ? event.running_start_date : event.next_start_date, { hour: 'numeric', minute: 'numeric' })
|
|
39
|
-
} }) }))] }))), 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: {
|
|
40
41
|
date: intl.formatDate(event.created_at, {
|
|
41
42
|
weekday: 'long',
|
|
42
43
|
day: 'numeric',
|