mirror of https://github.com/jitsi/jitsi-meet
ref(ui-components) Update some dialogs to use the new component (#12288)
Improve Dialog component to auto close on cancel or on submit Change logic to determine whether a dialog is using the new component Convert some files to TSpull/12298/head jitsi-meet_7878
parent
21bcbdc12f
commit
f4f8808d95
@ -0,0 +1,31 @@ |
||||
import ChatPrivacyDialog from '../../chat/components/web/ChatPrivacyDialog'; |
||||
import DisplayNamePrompt from '../../display-name/components/web/DisplayNamePrompt'; |
||||
import EmbedMeetingDialog from '../../embed-meeting/components/EmbedMeetingDialog'; |
||||
import KeyboardShortcutsDialog from '../../keyboard-shortcuts/components/web/KeyboardShortcutsDialog'; |
||||
import MiddlewareRegistry from '../redux/MiddlewareRegistry'; |
||||
|
||||
import { OPEN_DIALOG } from './actionTypes'; |
||||
|
||||
// ! IMPORTANT - This whole middleware is only needed for the transition from from @atlaskit dialog to our component.
|
||||
// ! It should be removed when the transition is over.
|
||||
|
||||
const NEW_DIALOG_LIST = [ KeyboardShortcutsDialog, ChatPrivacyDialog, DisplayNamePrompt, EmbedMeetingDialog ]; |
||||
|
||||
// This function is necessary while the transition from @atlaskit dialog to our component is ongoing.
|
||||
const isNewDialog = (component: any) => NEW_DIALOG_LIST.some(comp => comp === component); |
||||
|
||||
/** |
||||
* Implements the entry point of the middleware of the feature base/media. |
||||
* |
||||
* @param {IStore} store - The redux store. |
||||
* @returns {Function} |
||||
*/ |
||||
MiddlewareRegistry.register(() => (next: Function) => (action: any) => { |
||||
switch (action.type) { |
||||
case OPEN_DIALOG: { |
||||
action.isNewDialog = isNewDialog(action.component); |
||||
} |
||||
} |
||||
|
||||
return next(action); |
||||
}); |
Loading…
Reference in new issue