@selfcommunity/react-ui 0.8.0-live.75 → 0.8.0-live.78
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/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -1
- package/lib/cjs/components/EventForm/EventAddress.d.ts +2 -1
- package/lib/cjs/components/EventForm/EventAddress.js +17 -7
- package/lib/cjs/components/EventForm/EventForm.d.ts +6 -0
- package/lib/cjs/components/EventForm/EventForm.js +12 -8
- package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +10 -5
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +1 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +0 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +2 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +8 -8
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +1 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +1 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +3 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +58 -15
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +24 -7
- package/lib/cjs/components/LiveStreamRoom/constants.d.ts +1 -1
- package/lib/cjs/components/LiveStreamRoom/constants.js +1 -1
- package/lib/cjs/components/Notification/LiveStream/LiveStream.js +3 -1
- package/lib/cjs/shared/EventInfoDetails/index.js +9 -1
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -1
- package/lib/esm/components/EventForm/EventAddress.d.ts +2 -1
- package/lib/esm/components/EventForm/EventAddress.js +17 -7
- package/lib/esm/components/EventForm/EventForm.d.ts +6 -0
- package/lib/esm/components/EventForm/EventForm.js +12 -8
- package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +10 -5
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +3 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +1 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +0 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +2 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +8 -8
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +3 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +58 -15
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +25 -8
- package/lib/esm/components/LiveStreamRoom/constants.d.ts +1 -1
- package/lib/esm/components/LiveStreamRoom/constants.js +1 -1
- package/lib/esm/components/Notification/LiveStream/LiveStream.js +3 -1
- package/lib/esm/shared/EventInfoDetails/index.js +12 -4
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -9,15 +9,39 @@ import { ControlBar } from './ControlBar';
|
|
|
9
9
|
import { useEffect } from 'react';
|
|
10
10
|
import { useLivestreamCheck } from './useLiveStreamCheck';
|
|
11
11
|
import { FocusLayout, FocusLayoutContainer, FocusLayoutContainerNoParticipants } from './FocusLayout';
|
|
12
|
+
import { useSCUser } from '@selfcommunity/react-core';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import { Box } from '@mui/material';
|
|
16
|
+
import { useThemeProps } from '@mui/system';
|
|
17
|
+
const PREFIX = 'SCVideoConference';
|
|
18
|
+
const classes = {
|
|
19
|
+
root: `${PREFIX}-root`
|
|
20
|
+
};
|
|
21
|
+
const Root = styled(Box, {
|
|
22
|
+
name: PREFIX,
|
|
23
|
+
slot: 'Root',
|
|
24
|
+
overridesResolver: (props, styles) => styles.root
|
|
25
|
+
})(({ theme }) => ({
|
|
26
|
+
'& .lk-chat': {
|
|
27
|
+
height: '100%'
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
12
30
|
/**
|
|
13
31
|
* The `VideoConference` ready-made component is your drop-in solution for a classic video conferencing application.
|
|
14
32
|
* It provides functionality such as focusing on one participant, grid view with pagination to handle large numbers
|
|
15
33
|
* of participants, basic non-persistent chat, screen sharing, and more.
|
|
16
34
|
*
|
|
17
35
|
*/
|
|
18
|
-
export function VideoConference(
|
|
19
|
-
var
|
|
20
|
-
|
|
36
|
+
export function VideoConference(inProps) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
// PROPS
|
|
39
|
+
const props = useThemeProps({
|
|
40
|
+
props: inProps,
|
|
41
|
+
name: PREFIX
|
|
42
|
+
});
|
|
43
|
+
const { className, chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat = false, disableMicrophone = false, disableCamera = false, disableShareScreen = false, hideParticipantsList = false, showSettings } = props, rest = __rest(props, ["className", "chatMessageFormatter", "chatMessageDecoder", "chatMessageEncoder", "SettingsComponent", "speakerFocused", "disableChat", "disableMicrophone", "disableCamera", "disableShareScreen", "hideParticipantsList", "showSettings"]);
|
|
44
|
+
// STATE
|
|
21
45
|
const [widgetState, setWidgetState] = React.useState({
|
|
22
46
|
showChat: false,
|
|
23
47
|
unreadMessages: 0,
|
|
@@ -25,15 +49,30 @@ export function VideoConference(_a) {
|
|
|
25
49
|
});
|
|
26
50
|
const [focusInitialized, setFocusInitialized] = React.useState(false);
|
|
27
51
|
const lastAutoFocusedScreenShareTrack = React.useRef(null);
|
|
52
|
+
// HOOKS
|
|
53
|
+
const scUserContext = useSCUser();
|
|
28
54
|
const tracks = useTracks([
|
|
29
55
|
{ source: Track.Source.Camera, withPlaceholder: true },
|
|
30
56
|
{ source: Track.Source.ScreenShare, withPlaceholder: false }
|
|
31
57
|
], { updateOnlyOn: [RoomEvent.ActiveSpeakersChanged], onlySubscribed: false });
|
|
32
58
|
const participants = useParticipants();
|
|
59
|
+
const layoutContext = useCreateLayoutContext();
|
|
60
|
+
const screenShareTracks = tracks.filter(isTrackReference).filter((track) => track.publication.source === Track.Source.ScreenShare);
|
|
61
|
+
const focusTrack = (_a = usePinnedTracks(layoutContext)) === null || _a === void 0 ? void 0 : _a[0];
|
|
62
|
+
const carouselTracks = tracks.filter((track) => !isEqualTrackRef(track, focusTrack));
|
|
63
|
+
useLivestreamCheck();
|
|
64
|
+
/**
|
|
65
|
+
* widgetUpdate
|
|
66
|
+
* @param state
|
|
67
|
+
*/
|
|
33
68
|
const widgetUpdate = (state) => {
|
|
34
69
|
log.debug('updating widget state', state);
|
|
35
70
|
setWidgetState(state);
|
|
36
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* handleFocusStateChange
|
|
74
|
+
* @param state
|
|
75
|
+
*/
|
|
37
76
|
const handleFocusStateChange = (state) => {
|
|
38
77
|
var _a, _b;
|
|
39
78
|
log.debug('updating widget state', state);
|
|
@@ -44,14 +83,8 @@ export function VideoConference(_a) {
|
|
|
44
83
|
}
|
|
45
84
|
}
|
|
46
85
|
};
|
|
47
|
-
const layoutContext = useCreateLayoutContext();
|
|
48
|
-
const screenShareTracks = tracks.filter(isTrackReference).filter((track) => track.publication.source === Track.Source.ScreenShare);
|
|
49
|
-
const focusTrack = (_b = usePinnedTracks(layoutContext)) === null || _b === void 0 ? void 0 : _b[0];
|
|
50
|
-
const carouselTracks = tracks.filter((track) => !isEqualTrackRef(track, focusTrack));
|
|
51
|
-
// HOOKS
|
|
52
|
-
useLivestreamCheck();
|
|
53
86
|
useEffect(() => {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f;
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
55
88
|
// If screen share tracks are published, and no pin is set explicitly, auto set the screen share.
|
|
56
89
|
if (screenShareTracks.some((track) => track.publication.isSubscribed) && lastAutoFocusedScreenShareTrack.current === null) {
|
|
57
90
|
log.debug('Auto set screen share focus:', { newScreenShareTrack: screenShareTracks[0] });
|
|
@@ -64,15 +97,25 @@ export function VideoConference(_a) {
|
|
|
64
97
|
(_d = (_c = layoutContext.pin).dispatch) === null || _d === void 0 ? void 0 : _d.call(_c, { msg: 'clear_pin' });
|
|
65
98
|
lastAutoFocusedScreenShareTrack.current = null;
|
|
66
99
|
}
|
|
67
|
-
if (focusTrack
|
|
68
|
-
|
|
69
|
-
|
|
100
|
+
if (focusTrack) {
|
|
101
|
+
let updatedFocusTrack;
|
|
102
|
+
const isFocusTrackParticipantExist = participants.find((pt) => pt.identity === focusTrack.participant.identity);
|
|
103
|
+
if (!isFocusTrackParticipantExist) {
|
|
104
|
+
// Focus track is relative to a participant that has left the room
|
|
105
|
+
updatedFocusTrack = tracks.find((tr) => tr.participant.identity === scUserContext.user.id.toString());
|
|
70
106
|
(_f = (_e = layoutContext.pin).dispatch) === null || _f === void 0 ? void 0 : _f.call(_e, { msg: 'set_pin', trackReference: updatedFocusTrack });
|
|
71
107
|
}
|
|
108
|
+
else if (!isTrackReference(focusTrack)) {
|
|
109
|
+
// You are not subscribet to the track
|
|
110
|
+
updatedFocusTrack = tracks.find((tr) => tr.participant.identity === focusTrack.participant.identity && tr.source === focusTrack.source);
|
|
111
|
+
if (updatedFocusTrack !== focusTrack && isTrackReference(updatedFocusTrack)) {
|
|
112
|
+
(_h = (_g = layoutContext.pin).dispatch) === null || _h === void 0 ? void 0 : _h.call(_g, { msg: 'set_pin', trackReference: updatedFocusTrack });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
72
115
|
}
|
|
73
116
|
}, [
|
|
74
117
|
screenShareTracks.map((ref) => `${ref.publication.trackSid}_${ref.publication.isSubscribed}`).join(),
|
|
75
|
-
(
|
|
118
|
+
(_b = focusTrack === null || focusTrack === void 0 ? void 0 : focusTrack.publication) === null || _b === void 0 ? void 0 : _b.trackSid,
|
|
76
119
|
tracks,
|
|
77
120
|
participants,
|
|
78
121
|
speakerFocused
|
|
@@ -95,7 +138,7 @@ export function VideoConference(_a) {
|
|
|
95
138
|
}
|
|
96
139
|
}
|
|
97
140
|
}, [tracks, participants, speakerFocused]);
|
|
98
|
-
return (_jsxs(
|
|
141
|
+
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root, 'lk-video-conference') }, rest, { children: [isWeb() && (_jsxs(LayoutContextProvider, Object.assign({ value: layoutContext, onPinChange: handleFocusStateChange, onWidgetChange: widgetUpdate }, { children: [_jsxs("div", Object.assign({ className: "lk-video-conference-inner" }, { children: [!focusTrack ? (_jsx("div", Object.assign({ className: "lk-grid-layout-wrapper" }, { children: _jsx(GridLayout, Object.assign({ tracks: tracks }, { children: _jsx(ParticipantTile, {}) })) }))) : (_jsx("div", Object.assign({ className: "lk-focus-layout-wrapper" }, { children: hideParticipantsList ? (_jsx(FocusLayoutContainerNoParticipants, { children: focusTrack && _jsx(FocusLayout, { trackRef: focusTrack }) })) : (_jsxs(FocusLayoutContainer, { children: [_jsx(CarouselLayout, Object.assign({ tracks: carouselTracks }, { children: _jsx(ParticipantTile, {}) })), focusTrack && _jsx(FocusLayout, { trackRef: focusTrack })] })) }))), _jsx(ControlBar, { controls: Object.assign({
|
|
99
142
|
chat: !disableChat,
|
|
100
143
|
microphone: !disableMicrophone,
|
|
101
144
|
camera: !disableCamera,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { LiveStreamApiClient } from '@selfcommunity/api-services';
|
|
3
3
|
import { useDisconnectButton, useParticipants } from '@livekit/components-react';
|
|
4
4
|
import { useLiveStream } from './LiveStreamProvider';
|
|
@@ -6,6 +6,7 @@ import { useSnackbar } from 'notistack';
|
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { useSCUser } from '@selfcommunity/react-core';
|
|
8
8
|
import { LIVE_CHECKING_INTERVAL, WARNING_THRESHOLD_EXPIRING_SOON } from '../constants';
|
|
9
|
+
import { RoomEvent } from 'livekit-client';
|
|
9
10
|
/**
|
|
10
11
|
* Custom hook for monitoring livestream.
|
|
11
12
|
* @param {number} warningThreshold
|
|
@@ -13,20 +14,33 @@ import { LIVE_CHECKING_INTERVAL, WARNING_THRESHOLD_EXPIRING_SOON } from '../cons
|
|
|
13
14
|
* @param performDisconnect
|
|
14
15
|
*/
|
|
15
16
|
export function useLivestreamCheck(warningThreshold = WARNING_THRESHOLD_EXPIRING_SOON, showWarnings = true, performDisconnect = true) {
|
|
17
|
+
// STATE
|
|
18
|
+
const [timeRemaining, setTimeRemaining] = useState(60);
|
|
19
|
+
const [isExpiringSoon, setIsExpiringSoon] = useState(false);
|
|
20
|
+
const [isExpired, setIsExpired] = useState(false);
|
|
21
|
+
const intervalRef = useRef(null);
|
|
16
22
|
// HOOKS
|
|
17
23
|
const scUserContext = useSCUser();
|
|
18
|
-
const participants = useParticipants(
|
|
24
|
+
const participants = useParticipants({
|
|
25
|
+
updateOnlyOn: [
|
|
26
|
+
RoomEvent.ParticipantConnected,
|
|
27
|
+
RoomEvent.ParticipantDisconnected,
|
|
28
|
+
RoomEvent.ConnectionStateChanged,
|
|
29
|
+
RoomEvent.Connected,
|
|
30
|
+
RoomEvent.Disconnected,
|
|
31
|
+
RoomEvent.TrackSubscribed,
|
|
32
|
+
RoomEvent.TrackUnsubscribed
|
|
33
|
+
]
|
|
34
|
+
});
|
|
19
35
|
const { liveStream } = useLiveStream();
|
|
20
36
|
const { buttonProps } = useDisconnectButton({});
|
|
21
37
|
const { enqueueSnackbar } = useSnackbar();
|
|
22
38
|
const __DEBUG = useRef(true);
|
|
23
|
-
// STATE
|
|
24
|
-
const [timeRemaining, setTimeRemaining] = useState(60);
|
|
25
|
-
const [isExpiringSoon, setIsExpiringSoon] = useState(false);
|
|
26
|
-
const [isExpired, setIsExpired] = useState(false);
|
|
27
|
-
const intervalRef = useRef(null);
|
|
28
39
|
// INTL
|
|
29
40
|
const intl = useIntl();
|
|
41
|
+
/**
|
|
42
|
+
* fetchLivestreamStatus
|
|
43
|
+
*/
|
|
30
44
|
const fetchLivestreamStatus = () => {
|
|
31
45
|
LiveStreamApiClient.getMonthlyDuration()
|
|
32
46
|
.then((r) => {
|
|
@@ -54,6 +68,9 @@ export function useLivestreamCheck(warningThreshold = WARNING_THRESHOLD_EXPIRING
|
|
|
54
68
|
console.error('Error fetching live status:', error);
|
|
55
69
|
});
|
|
56
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* Check live
|
|
73
|
+
*/
|
|
57
74
|
const check = useCallback(() => {
|
|
58
75
|
if (__DEBUG) {
|
|
59
76
|
console.log('Checking live status');
|
|
@@ -105,6 +122,6 @@ export function useLivestreamCheck(warningThreshold = WARNING_THRESHOLD_EXPIRING
|
|
|
105
122
|
useEffect(() => {
|
|
106
123
|
intervalRef.current = setInterval(check, LIVE_CHECKING_INTERVAL * 60000);
|
|
107
124
|
return () => intervalRef.current && clearInterval(intervalRef.current);
|
|
108
|
-
}, [isExpired, isExpiringSoon]);
|
|
125
|
+
}, [isExpired, isExpiringSoon, participants]);
|
|
109
126
|
return { timeRemaining, isExpiringSoon, isExpired };
|
|
110
127
|
}
|
|
@@ -7,7 +7,7 @@ export declare const defaultVideoOptions: {
|
|
|
7
7
|
* Checking live status on VideoLiveConference
|
|
8
8
|
* In minutes
|
|
9
9
|
*/
|
|
10
|
-
export declare const LIVE_CHECKING_INTERVAL =
|
|
10
|
+
export declare const LIVE_CHECKING_INTERVAL = 1;
|
|
11
11
|
/**
|
|
12
12
|
* Warning threshold expiring soon
|
|
13
13
|
* In minutes
|
|
@@ -42,7 +42,9 @@ export default function LiveStreamNotification(props) {
|
|
|
42
42
|
// CONST
|
|
43
43
|
const isSnippetTemplate = template === SCNotificationObjectTemplateType.SNIPPET;
|
|
44
44
|
const isToastTemplate = template === SCNotificationObjectTemplateType.TOAST;
|
|
45
|
-
const inProgress = Boolean(!notificationObject.live_stream.closed_at_by_host &&
|
|
45
|
+
const inProgress = Boolean(!notificationObject.live_stream.closed_at_by_host &&
|
|
46
|
+
notificationObject.live_stream.last_started_at &&
|
|
47
|
+
!notificationObject.live_stream.last_finished_at);
|
|
46
48
|
// RENDER
|
|
47
49
|
if (isSnippetTemplate) {
|
|
48
50
|
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.live_stream.host.deleted && {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Icon, Stack, styled, Tooltip, Typography, useThemeProps } from '@mui/material';
|
|
3
|
-
import { Link, useSCFetchEvent } from '@selfcommunity/react-core';
|
|
2
|
+
import { Box, Button, Icon, Stack, styled, Tooltip, Typography, useThemeProps } from '@mui/material';
|
|
3
|
+
import { Link, SCRoutes, SCUserContext, useSCFetchEvent, useSCRouting } from '@selfcommunity/react-core';
|
|
4
4
|
import { SCEventLocationType, SCEventPrivacyType, SCEventRecurrenceType } from '@selfcommunity/types';
|
|
5
|
-
import { useMemo } from 'react';
|
|
5
|
+
import { useContext, useMemo } from 'react';
|
|
6
6
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
7
7
|
const PREFIX = 'SCEventInfoDetails';
|
|
8
8
|
const classes = {
|
|
@@ -10,6 +10,7 @@ const classes = {
|
|
|
10
10
|
iconTextWrapper: `${PREFIX}-icon-text-wrapper`,
|
|
11
11
|
inProgress: `${PREFIX}-in-progress`,
|
|
12
12
|
link: `${PREFIX}-link`,
|
|
13
|
+
joinLive: `${PREFIX}-join-live`,
|
|
13
14
|
url: `${PREFIX}-url`,
|
|
14
15
|
creationWrapper: `${PREFIX}-creation-wrapper`
|
|
15
16
|
};
|
|
@@ -28,6 +29,9 @@ export default function EventInfoDetails(inProps) {
|
|
|
28
29
|
// HOOKS
|
|
29
30
|
const intl = useIntl();
|
|
30
31
|
const { scEvent } = useSCFetchEvent({ id: eventId, event });
|
|
32
|
+
// CONTEXT
|
|
33
|
+
const scRoutingContext = useSCRouting();
|
|
34
|
+
const scUserContext = useContext(SCUserContext);
|
|
31
35
|
const privacy = useMemo(() => (scEvent && scEvent.privacy === SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private'), [scEvent]);
|
|
32
36
|
const location = useMemo(() => scEvent && scEvent.location === SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson', [scEvent]);
|
|
33
37
|
if (!scEvent) {
|
|
@@ -41,7 +45,11 @@ export default function EventInfoDetails(inProps) {
|
|
|
41
45
|
month: 'long'
|
|
42
46
|
}),
|
|
43
47
|
start: intl.formatDate(scEvent.running ? scEvent.running_start_date : scEvent.next_start_date ? scEvent.next_start_date : scEvent.start_date, { hour: 'numeric', minute: 'numeric' })
|
|
44
|
-
} }) })) })), hasInProgress && scEvent.active && scEvent.running && (_jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.inProgress", defaultMessage: "ui.eventInfoDetails.inProgress" }) }, { children: _jsx(Box, { className: classes.inProgress }) })))] }))), beforeRecurringInfo, hasRecurringInfo && scEvent.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.${scEvent.recurring}.placeholder`, defaultMessage: `ui.eventInfoDetails.frequency.${scEvent.recurring}.placeholder` }) }))] }))), beforePrivacyInfo, hasPrivacyInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: scEvent.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: scEvent.location === SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), scEvent.location === SCEventLocationType.ONLINE ? (
|
|
48
|
+
} }) })) })), hasInProgress && scEvent.active && scEvent.running && (_jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.inProgress", defaultMessage: "ui.eventInfoDetails.inProgress" }) }, { children: _jsx(Box, { className: classes.inProgress }) })))] }))), beforeRecurringInfo, hasRecurringInfo && scEvent.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.${scEvent.recurring}.placeholder`, defaultMessage: `ui.eventInfoDetails.frequency.${scEvent.recurring}.placeholder` }) }))] }))), beforePrivacyInfo, hasPrivacyInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: scEvent.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: scEvent.location === SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), scEvent.location === SCEventLocationType.ONLINE ? (scEvent.live_stream ? (_jsx(Button, Object.assign({ size: "small", variant: "contained", color: "secondary", component: Link, disabled: Boolean(!scUserContext.user ||
|
|
49
|
+
(scEvent.live_stream.host.id !== scUserContext.user.id &&
|
|
50
|
+
!scEvent.live_stream.closed_at_by_host &&
|
|
51
|
+
scEvent.live_stream.last_started_at &&
|
|
52
|
+
!scEvent.live_stream.last_finished_at)), to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, scEvent.live_stream), className: classes.joinLive }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.eventInfoDetails.live.join", id: "ui.eventInfoDetails.live.join" }) }))) : (_jsx(Link, Object.assign({ to: scEvent.link, target: "_blank", className: classes.link }, { children: _jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: scEvent.link })) })))) : (_jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: scEvent.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: {
|
|
45
53
|
date: intl.formatDate(scEvent.created_at, {
|
|
46
54
|
weekday: 'long',
|
|
47
55
|
day: 'numeric',
|