Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
ref(components) Replace some InlineDialogs with Popover (#12453)
Robert Pintilii687837310a74
diff --git a/css/_video-preview.scss b/css/_video-preview.scssindex 3de4ef725d..0a4d6d31bb 100644--- a/css/_video-preview.scss+++ b/css/_video-preview.scss@@ -8,6 +8,7 @@border-radius: 3px;overflow: auto;padding: 8px;+ margin-bottom: 8px;}&-entry {diff --git a/react/features/base/popover/components/Popover.web.tsx b/react/features/base/popover/components/Popover.web.tsxindex ffa6bbed4a..7c89f81cdc 100644--- a/react/features/base/popover/components/Popover.web.tsx+++ b/react/features/base/popover/components/Popover.web.tsx@@ -48,7 +48,7 @@ type Props = {/*** Callback to invoke when the popover has opened.*/- onPopoverOpen: Function;+ onPopoverOpen?: Function;/*** Whether to display the Popover as a drawer.@@ -56,8 +56,7 @@ type Props = {overflowDrawer?: boolean;/**- * From which side of the dialog trigger the dialog should display. The- * value will be passed to {@code InlineDialog}.+ * Where should the popover content be placed.*/position: string;@@ -89,7 +88,7 @@ type State = {};/**- * Implements a React {@code Component} for showing an {@code InlineDialog} on+ * Implements a React {@code Component} for showing an {@code Popover} on* mouseenter of the trigger and contents, and hiding the dialog on mouseleave.** @augments Component@@ -273,7 +272,7 @@ class Popover extends Component<Props, State> {}/**- * Stops displaying the {@code InlineDialog}.+ * Stops displaying the {@code Popover}.** @private* @returns {void}@@ -289,7 +288,7 @@ class Popover extends Component<Props, State> {}/**- * Displays the {@code InlineDialog} and calls any registered onPopoverOpen+ * Displays the {@code Popover} and calls any registered onPopoverOpen* callbacks.** @param {Object} event - The mouse event or the keypress event to intercept.@@ -300,7 +299,7 @@ class Popover extends Component<Props, State> {event?.stopPropagation();if (!this.props.disablePopover) {- this.props.onPopoverOpen();+ this.props.onPopoverOpen?.();}}@@ -377,7 +376,7 @@ class Popover extends Component<Props, State> {}/**- * Renders the React Element to be displayed in the {@code InlineDialog}.+ * Renders the React Element to be displayed in the {@code Popover}.* Also adds padding to support moving the mouse from the trigger to the* dialog to prevent mouseleave events.*diff --git a/react/features/settings/components/web/video/VideoSettingsPopup.js b/react/features/settings/components/web/video/VideoSettingsPopup.jsindex 4510992209..a90748c821 100644--- a/react/features/settings/components/web/video/VideoSettingsPopup.js+++ b/react/features/settings/components/web/video/VideoSettingsPopup.js@@ -1,12 +1,12 @@// @flow-import InlineDialog from '@atlaskit/inline-dialog';import React from 'react';import {getVideoDeviceIds,setVideoInputDeviceAndUpdateSettings} from '../../../../base/devices';+import Popover from '../../../../base/popover/components/Popover.web';import { connect } from '../../../../base/redux';import { SMALL_MOBILE_WIDTH } from '../../../../base/responsive-ui/constants';import { getCurrentCameraDeviceId } from '../../../../base/settings';@@ -18,17 +18,17 @@ import VideoSettingsContent, { type Props as VideoSettingsProps } from './VideoStype Props = VideoSettingsProps & {- /**+ /*** Component children (the Video button).*/children: React$Node,- /**+ /*** Flag controlling the visibility of the popup.*/isOpen: boolean,- /**+ /*** Callback executed when the popup closes.*/onClose: Function,@@ -36,7 +36,7 @@ type Props = VideoSettingsProps & {/*** The popup placement enum value.*/- popupPlacement: string+ popupPlacement: string}/**@@ -55,17 +55,18 @@ function VideoSettingsPopup({}: Props) {return (<div className = 'video-preview'>- <InlineDialog+ <Popovercontent = { <VideoSettingsContentcurrentCameraDeviceId = { currentCameraDeviceId }setVideoInputDevice = { setVideoInputDevice }toggleVideoSettings = { onClose }videoDeviceIds = { videoDeviceIds } /> }- isOpen = { isOpen }- onClose = { onClose }- placement = { popupPlacement }>+ onPopoverClose = { onClose }+ position = { popupPlacement }+ trigger = 'click'+ visible = { isOpen }>{ children }- </InlineDialog>+ </Popover></div>);}@@ -83,7 +84,7 @@ function mapStateToProps(state) {return {currentCameraDeviceId: getCurrentCameraDeviceId(state),isOpen: getVideoSettingsVisibility(state),- popupPlacement: clientWidth <= SMALL_MOBILE_WIDTH ? 'auto' : 'top-start',+ popupPlacement: clientWidth <= SMALL_MOBILE_WIDTH ? 'auto' : 'top-end',videoDeviceIds: getVideoDeviceIds(state)};}diff --git a/react/features/toolbox/components/web/HangupMenuButton.tsx b/react/features/toolbox/components/web/HangupMenuButton.tsxindex 982ecd0cf8..fdc02e19a9 100644--- a/react/features/toolbox/components/web/HangupMenuButton.tsx+++ b/react/features/toolbox/components/web/HangupMenuButton.tsx@@ -1,10 +1,10 @@-import InlineDialog from '@atlaskit/inline-dialog';import React, { Component } from 'react';import { WithTranslation } from 'react-i18next';import { createToolbarEvent } from '../../../analytics/AnalyticsEvents';import { sendAnalytics } from '../../../analytics/functions';import { translate } from '../../../base/i18n/functions';+import Popover from '../../../base/popover/components/Popover.web';import HangupToggleButton from './HangupToggleButton';@@ -81,17 +81,18 @@ class HangupMenuButton extends Component<IProps> {return (<div className = 'toolbox-button-wth-dialog context-menu'>- <InlineDialog+ <Popovercontent = { children }- isOpen = { isOpen }- onClose = { this._onCloseDialog }- placement = 'top-end'>+ onPopoverClose = { this._onCloseDialog }+ position = 'top'+ trigger = 'click'+ visible = { isOpen }><HangupToggleButtoncustomClass = 'hangup-menu-button'handleClick = { this._toggleDialogVisibility }isOpen = { isOpen }onKeyDown = { this._onEscClick } />- </InlineDialog>+ </Popover></div>);}diff --git a/react/features/toolbox/components/web/OverflowMenuButton.tsx b/react/features/toolbox/components/web/OverflowMenuButton.tsxindex 8a81655ebd..ad55fb9154 100644--- a/react/features/toolbox/components/web/OverflowMenuButton.tsx+++ b/react/features/toolbox/components/web/OverflowMenuButton.tsx@@ -31,7 +31,7 @@ interface IProps {ariaControls: string;/**- * A child React Element to display within {@code InlineDialog}.+ * A child React Element to display within {@code Popover}.*/children: ReactNode;diff --git a/react/features/toolbox/components/web/Toolbox.tsx b/react/features/toolbox/components/web/Toolbox.tsxindex 7f95f2e701..f2df9c7b80 100644--- a/react/features/toolbox/components/web/Toolbox.tsx+++ b/react/features/toolbox/components/web/Toolbox.tsx@@ -367,7 +367,8 @@ const styles = () => {flexDirection: 'column' as const,rowGap: '8px',margin: 0,- padding: '16px'+ padding: '16px',+ marginBottom: '8px'}};};diff --git a/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx b/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsxindex d0d7a668c6..6dc095cfc9 100644--- a/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx+++ b/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx@@ -46,8 +46,7 @@ interface IProps extends WithTranslation {/*** The position relative to the trigger the local video menu should display- * from. Valid values are those supported by AtlasKit- * {@code InlineDialog}.+ * from.*/_menuPosition: string;diff --git a/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx b/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsxindex 2a08922b0b..44f1289e9f 100644--- a/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx+++ b/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx@@ -43,8 +43,7 @@ interface IProps extends WithTranslation {/*** The position relative to the trigger the remote menu should display- * from. Valid values are those supported by AtlasKit- * {@code InlineDialog}.+ * from.*/_menuPosition: string;