feat(dialog): add disableAutoHideOnSubmit prop
Needed for shared video dialog.
This commit is contained in:
parent
d45decc393
commit
04abfe1a3b
|
@ -190,6 +190,7 @@ interface IDialogProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
disableAutoHideOnSubmit?: boolean;
|
||||||
disableBackdropClose?: boolean;
|
disableBackdropClose?: boolean;
|
||||||
disableEnter?: boolean;
|
disableEnter?: boolean;
|
||||||
hideCloseButton?: boolean;
|
hideCloseButton?: boolean;
|
||||||
|
@ -211,6 +212,7 @@ const Dialog = ({
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
description,
|
description,
|
||||||
|
disableAutoHideOnSubmit = false,
|
||||||
disableBackdropClose,
|
disableBackdropClose,
|
||||||
hideCloseButton,
|
hideCloseButton,
|
||||||
disableEnter,
|
disableEnter,
|
||||||
|
@ -232,7 +234,7 @@ const Dialog = ({
|
||||||
}, [ onCancel ]);
|
}, [ onCancel ]);
|
||||||
|
|
||||||
const submit = useCallback(() => {
|
const submit = useCallback(() => {
|
||||||
dispatch(hideDialog());
|
!disableAutoHideOnSubmit && dispatch(hideDialog());
|
||||||
onSubmit?.();
|
onSubmit?.();
|
||||||
}, [ onSubmit ]);
|
}, [ onSubmit ]);
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { hideDialog } from '../../base/dialog/actions';
|
|
||||||
import { translate } from '../../base/i18n';
|
import { translate } from '../../base/i18n';
|
||||||
import { getParticipantById } from '../../base/participants';
|
import { getParticipantById } from '../../base/participants';
|
||||||
import { connect } from '../../base/redux';
|
import { connect } from '../../base/redux';
|
||||||
|
@ -138,7 +137,6 @@ class RemoteControlAuthorizationDialog extends Component<Props> {
|
||||||
_onSubmit() {
|
_onSubmit() {
|
||||||
const { dispatch, participantId } = this.props;
|
const { dispatch, participantId } = this.props;
|
||||||
|
|
||||||
dispatch(hideDialog());
|
|
||||||
dispatch(grant(participantId));
|
dispatch(grant(participantId));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { hideDialog } from '../../../base/dialog/actions';
|
||||||
import { translate } from '../../../base/i18n/functions';
|
import { translate } from '../../../base/i18n/functions';
|
||||||
import { connect } from '../../../base/redux/functions';
|
import { connect } from '../../../base/redux/functions';
|
||||||
import Dialog from '../../../base/ui/components/web/Dialog';
|
import Dialog from '../../../base/ui/components/web/Dialog';
|
||||||
|
@ -52,7 +53,9 @@ class SharedVideoDialog extends AbstractSharedVideoDialog<any> {
|
||||||
_onSubmitValue() {
|
_onSubmitValue() {
|
||||||
const result = super._onSetVideoLink(this.state.value);
|
const result = super._onSetVideoLink(this.state.value);
|
||||||
|
|
||||||
if (!result) {
|
if (result) {
|
||||||
|
this.props.dispatch(hideDialog());
|
||||||
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
error: true
|
error: true
|
||||||
});
|
});
|
||||||
|
@ -72,6 +75,7 @@ class SharedVideoDialog extends AbstractSharedVideoDialog<any> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
|
disableAutoHideOnSubmit = { true }
|
||||||
ok = {{
|
ok = {{
|
||||||
disabled: this.state.okDisabled,
|
disabled: this.state.okDisabled,
|
||||||
translationKey: 'dialog.Share'
|
translationKey: 'dialog.Share'
|
||||||
|
|
Loading…
Reference in New Issue