@selfcommunity/react-ui 0.8.0-live.44 → 0.8.0-live.46
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/LiveStreamForm/LiveStreamForm.js +10 -9
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +1 -1
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +10 -9
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +1 -1
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -6,7 +6,6 @@ const lab_1 = require("@mui/lab");
|
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const styles_1 = require("@mui/material/styles");
|
|
8
8
|
const system_1 = require("@mui/system");
|
|
9
|
-
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
9
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
11
10
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
11
|
const react_1 = require("react");
|
|
@@ -123,19 +122,21 @@ function LiveStreamForm(inProps) {
|
|
|
123
122
|
if (visibilityEnabled) {
|
|
124
123
|
formData.append('visible', 'true');
|
|
125
124
|
}
|
|
125
|
+
formData.append('title', field.title);
|
|
126
126
|
formData.append('description', field.description);
|
|
127
|
-
let eventService;
|
|
128
|
-
if (liveStream) {
|
|
129
|
-
eventService = api_services_1.EventService.updateEvent(liveStream.id, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
eventService = api_services_1.EventService.createEvent(formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
133
|
-
}
|
|
134
127
|
setTimeout(() => {
|
|
135
128
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({});
|
|
136
129
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
137
130
|
}, 1000);
|
|
138
|
-
/*
|
|
131
|
+
/*
|
|
132
|
+
let eventService: Promise<SCEventType>;
|
|
133
|
+
if (liveStream) {
|
|
134
|
+
eventService = EventService.updateEvent(liveStream.id, formData as unknown as SCEventType, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
135
|
+
} else {
|
|
136
|
+
eventService = EventService.createEvent(formData, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
eventService
|
|
139
140
|
.then((data) => {
|
|
140
141
|
setField((prev) => ({...prev, ['isSubmitting']: false}));
|
|
141
142
|
// onSuccess?.(data);
|
|
@@ -125,6 +125,6 @@ function LiveStreamRoom(inProps) {
|
|
|
125
125
|
/**
|
|
126
126
|
* Renders root object
|
|
127
127
|
*/
|
|
128
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [startPrejoinContent && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.title) && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.title }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.title })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.description) && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.description }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.description })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.preJoin }, { children: (0, jsx_runtime_1.jsx)(components_react_1.PreJoin, { persistUserChoices: true, defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError }) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.endPrejoinContent }, { children:
|
|
128
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [startPrejoinContent && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.title) && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.title }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.title })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.description) && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.description }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.description })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.preJoin }, { children: (0, jsx_runtime_1.jsx)(components_react_1.PreJoin, { persistUserChoices: true, defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError }) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.endPrejoinContent }, { children: endPrejoinContent }))] })) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.conference }, { children: (0, jsx_runtime_1.jsx)(LiveStreamVideoConference_1.default, { connectionDetails: connectionDetails, userChoices: preJoinChoices, options: { codec: props.codec, hq: props.hq } }) }))) })) })));
|
|
129
129
|
}
|
|
130
130
|
exports.default = LiveStreamRoom;
|
|
@@ -4,7 +4,6 @@ import { LoadingButton } from '@mui/lab';
|
|
|
4
4
|
import { Box, FormGroup, Paper, TextField, Typography } from '@mui/material';
|
|
5
5
|
import { styled } from '@mui/material/styles';
|
|
6
6
|
import { useThemeProps } from '@mui/system';
|
|
7
|
-
import { EventService } from '@selfcommunity/api-services';
|
|
8
7
|
import { SCPreferences, useSCContext, useSCPreferences } from '@selfcommunity/react-core';
|
|
9
8
|
import classNames from 'classnames';
|
|
10
9
|
import { useCallback, useMemo, useState } from 'react';
|
|
@@ -121,19 +120,21 @@ export default function LiveStreamForm(inProps) {
|
|
|
121
120
|
if (visibilityEnabled) {
|
|
122
121
|
formData.append('visible', 'true');
|
|
123
122
|
}
|
|
123
|
+
formData.append('title', field.title);
|
|
124
124
|
formData.append('description', field.description);
|
|
125
|
-
let eventService;
|
|
126
|
-
if (liveStream) {
|
|
127
|
-
eventService = EventService.updateEvent(liveStream.id, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
eventService = EventService.createEvent(formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
131
|
-
}
|
|
132
125
|
setTimeout(() => {
|
|
133
126
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({});
|
|
134
127
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
135
128
|
}, 1000);
|
|
136
|
-
/*
|
|
129
|
+
/*
|
|
130
|
+
let eventService: Promise<SCEventType>;
|
|
131
|
+
if (liveStream) {
|
|
132
|
+
eventService = EventService.updateEvent(liveStream.id, formData as unknown as SCEventType, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
133
|
+
} else {
|
|
134
|
+
eventService = EventService.createEvent(formData, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
eventService
|
|
137
138
|
.then((data) => {
|
|
138
139
|
setField((prev) => ({...prev, ['isSubmitting']: false}));
|
|
139
140
|
// onSuccess?.(data);
|
|
@@ -123,5 +123,5 @@ export default function LiveStreamRoom(inProps) {
|
|
|
123
123
|
/**
|
|
124
124
|
* Renders root object
|
|
125
125
|
*/
|
|
126
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? (_jsxs(_Fragment, { children: [startPrejoinContent && _jsx(Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.title) && _jsx(Box, Object.assign({ className: classes.title }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.title })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.description) && _jsx(Box, Object.assign({ className: classes.description }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.description })), _jsx(Box, Object.assign({ className: classes.preJoin }, { children: _jsx(PreJoin, { persistUserChoices: true, defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError }) })), _jsx(Box, Object.assign({ className: classes.endPrejoinContent }, { children:
|
|
126
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? (_jsxs(_Fragment, { children: [startPrejoinContent && _jsx(Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.title) && _jsx(Box, Object.assign({ className: classes.title }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.title })), (liveStream === null || liveStream === void 0 ? void 0 : liveStream.description) && _jsx(Box, Object.assign({ className: classes.description }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.description })), _jsx(Box, Object.assign({ className: classes.preJoin }, { children: _jsx(PreJoin, { persistUserChoices: true, defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError }) })), _jsx(Box, Object.assign({ className: classes.endPrejoinContent }, { children: endPrejoinContent }))] })) : (_jsx(Box, Object.assign({ className: classes.conference }, { children: _jsx(LiveStreamVideoConference, { connectionDetails: connectionDetails, userChoices: preJoinChoices, options: { codec: props.codec, hq: props.hq } }) }))) })) })));
|
|
127
127
|
}
|