@selfcommunity/react-ui 0.11.0-alpha.48 → 0.11.0-alpha.49

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.
@@ -1,5 +1,4 @@
1
1
  import { ButtonProps } from '@mui/material/Button/Button';
2
- import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
3
2
  import { CreateLiveStreamDialogProps } from '../CreateLiveStreamDialog';
4
3
  export interface CreateLiveStreamButtonProps extends ButtonProps {
5
4
  /**
@@ -12,11 +11,6 @@ export interface CreateLiveStreamButtonProps extends ButtonProps {
12
11
  * @default empty object
13
12
  */
14
13
  CreateLiveStreamDialogComponentProps?: CreateLiveStreamDialogProps;
15
- /**
16
- * On success callback function
17
- * @default null
18
- */
19
- onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
20
14
  /**
21
15
  * Any other properties
22
16
  */
@@ -45,7 +45,7 @@ function CreateLiveStreamButton(inProps) {
45
45
  props: inProps,
46
46
  name: PREFIX
47
47
  });
48
- const { className, CreateLiveStreamDialogComponentProps = {}, onSuccess, children } = props, rest = tslib_1.__rest(props, ["className", "CreateLiveStreamDialogComponentProps", "onSuccess", "children"]);
48
+ const { className, CreateLiveStreamDialogComponentProps = {}, children } = props, rest = tslib_1.__rest(props, ["className", "CreateLiveStreamDialogComponentProps", "children"]);
49
49
  // CONTEXT
50
50
  const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
51
51
  const { preferences, features } = (0, react_core_1.useSCPreferences)();
@@ -71,13 +71,6 @@ function CreateLiveStreamButton(inProps) {
71
71
  const handleClose = () => {
72
72
  setOpen((o) => !o);
73
73
  };
74
- /**
75
- * Handle close
76
- */
77
- const handleSuccess = (data) => {
78
- onSuccess && onSuccess(data);
79
- setOpen((o) => !o);
80
- };
81
74
  /**
82
75
  * If there's no authUserId, component is hidden.
83
76
  */
@@ -87,6 +80,6 @@ function CreateLiveStreamButton(inProps) {
87
80
  /**
88
81
  * Renders root object
89
82
  */
90
- return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "movie" }) }, rest, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && (0, jsx_runtime_1.jsx)(CreateLiveStreamDialog_1.default, Object.assign({ open: true, onClose: handleClose, onSuccess: handleSuccess }, CreateLiveStreamDialogComponentProps))] }));
83
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "movie" }) }, rest, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && (0, jsx_runtime_1.jsx)(CreateLiveStreamDialog_1.default, Object.assign({ open: true, onClose: handleClose }, CreateLiveStreamDialogComponentProps))] }));
91
84
  }
92
85
  exports.default = CreateLiveStreamButton;
@@ -1,4 +1,3 @@
1
- import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
2
1
  import { BaseDialogProps } from '../../shared/BaseDialog';
3
2
  import { EventFormProps } from '../EventForm';
4
3
  import { LiveStreamFormProps } from '../LiveStreamForm';
@@ -18,11 +17,6 @@ export interface CreateLiveStreamDialogProps extends BaseDialogProps {
18
17
  * @default null
19
18
  */
20
19
  onClose?: () => void;
21
- /**
22
- * On success callback function
23
- * @default null
24
- */
25
- onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
26
20
  /**
27
21
  * Props to spread to EventForm component
28
22
  * @default {}
@@ -1,5 +1,4 @@
1
1
  import { ButtonProps } from '@mui/material/Button/Button';
2
- import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
3
2
  import { CreateLiveStreamDialogProps } from '../CreateLiveStreamDialog';
4
3
  export interface CreateLiveStreamButtonProps extends ButtonProps {
5
4
  /**
@@ -12,11 +11,6 @@ export interface CreateLiveStreamButtonProps extends ButtonProps {
12
11
  * @default empty object
13
12
  */
14
13
  CreateLiveStreamDialogComponentProps?: CreateLiveStreamDialogProps;
15
- /**
16
- * On success callback function
17
- * @default null
18
- */
19
- onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
20
14
  /**
21
15
  * Any other properties
22
16
  */
@@ -43,7 +43,7 @@ export default function CreateLiveStreamButton(inProps) {
43
43
  props: inProps,
44
44
  name: PREFIX
45
45
  });
46
- const { className, CreateLiveStreamDialogComponentProps = {}, onSuccess, children } = props, rest = __rest(props, ["className", "CreateLiveStreamDialogComponentProps", "onSuccess", "children"]);
46
+ const { className, CreateLiveStreamDialogComponentProps = {}, children } = props, rest = __rest(props, ["className", "CreateLiveStreamDialogComponentProps", "children"]);
47
47
  // CONTEXT
48
48
  const scUserContext = useContext(SCUserContext);
49
49
  const { preferences, features } = useSCPreferences();
@@ -69,13 +69,6 @@ export default function CreateLiveStreamButton(inProps) {
69
69
  const handleClose = () => {
70
70
  setOpen((o) => !o);
71
71
  };
72
- /**
73
- * Handle close
74
- */
75
- const handleSuccess = (data) => {
76
- onSuccess && onSuccess(data);
77
- setOpen((o) => !o);
78
- };
79
72
  /**
80
73
  * If there's no authUserId, component is hidden.
81
74
  */
@@ -85,5 +78,5 @@ export default function CreateLiveStreamButton(inProps) {
85
78
  /**
86
79
  * Renders root object
87
80
  */
88
- return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: _jsx(Icon, { children: "movie" }) }, rest, { children: children !== null && children !== void 0 ? children : _jsx(FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && _jsx(CreateLivestreamDialog, Object.assign({ open: true, onClose: handleClose, onSuccess: handleSuccess }, CreateLiveStreamDialogComponentProps))] }));
81
+ return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: _jsx(Icon, { children: "movie" }) }, rest, { children: children !== null && children !== void 0 ? children : _jsx(FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && _jsx(CreateLivestreamDialog, Object.assign({ open: true, onClose: handleClose }, CreateLiveStreamDialogComponentProps))] }));
89
82
  }
@@ -1,4 +1,3 @@
1
- import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
2
1
  import { BaseDialogProps } from '../../shared/BaseDialog';
3
2
  import { EventFormProps } from '../EventForm';
4
3
  import { LiveStreamFormProps } from '../LiveStreamForm';
@@ -18,11 +17,6 @@ export interface CreateLiveStreamDialogProps extends BaseDialogProps {
18
17
  * @default null
19
18
  */
20
19
  onClose?: () => void;
21
- /**
22
- * On success callback function
23
- * @default null
24
- */
25
- onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
26
20
  /**
27
21
  * Props to spread to EventForm component
28
22
  * @default {}