diff --git a/css/_drawer.scss b/css/_drawer.scss index 9e3cd319d..796043946 100644 --- a/css/_drawer.scss +++ b/css/_drawer.scss @@ -4,16 +4,28 @@ right: 0; bottom: 0; z-index: $drawerZ; - background-color: #141414; border-radius: 16px 16px 0 0; } +.drawer-portal::after { + content: ''; + background-color: $participantsPaneBgColor; + margin-bottom: env(safe-area-inset-bottom, 0); +} + +.drawer-menu-container { + height: 100vh; + display: flex; + align-items: flex-end; +} + .drawer-menu { max-height: calc(80vh - 64px); background: #242528; border-radius: 16px 16px 0 0; overflow-y: hidden; margin-bottom: env(safe-area-inset-bottom, 0); + width: 100%; .drawer-toggle { display: flex; diff --git a/react/features/filmstrip/components/web/Thumbnail.js b/react/features/filmstrip/components/web/Thumbnail.js index a46ee3093..5b5313dfb 100644 --- a/react/features/filmstrip/components/web/Thumbnail.js +++ b/react/features/filmstrip/components/web/Thumbnail.js @@ -2,10 +2,10 @@ import React, { Component } from 'react'; -import { isMobileBrowser } from '../../../../../react/features/base/environment/utils'; import { createScreenSharingIssueEvent, sendAnalytics } from '../../../analytics'; import { AudioLevelIndicator } from '../../../audio-level-indicator'; import { Avatar } from '../../../base/avatar'; +import { isMobileBrowser } from '../../../base/environment/utils'; import JitsiMeetJS from '../../../base/lib-jitsi-meet/_'; import { MEDIA_TYPE, VideoTrack } from '../../../base/media'; import { @@ -139,6 +139,11 @@ export type Props = {| */ _isCurrentlyOnLargeVideo: boolean, + /** + * Whether we are currently running in a mobile browser. + */ + _isMobile: boolean, + /** * Indicates whether the participant is screen sharing. */ @@ -612,7 +617,7 @@ class Thumbnail extends Component { * @returns {ReactElement} */ _renderFakeParticipant() { - const { _participant: { avatarURL } } = this.props; + const { _isMobile, _participant: { avatarURL } } = this.props; const styles = this._getStyles(); const containerClassName = this._getContainerClassName(); @@ -621,8 +626,10 @@ class Thumbnail extends Component { className = { containerClassName } id = 'sharedVideoContainer' onClick = { this._onClick } - onMouseEnter = { this._onMouseEnter } - onMouseLeave = { this._onMouseLeave } + { ...(_isMobile ? {} : { + onMouseEnter: this._onMouseEnter, + onMouseLeave: this._onMouseLeave + }) } style = { styles.thumbnail }> {avatarURL ? ( { const { _defaultLocalDisplayName, _disableLocalVideoFlip, + _isMobile, _isScreenSharing, _localFlipX, _disableProfile, @@ -772,13 +780,17 @@ class Thumbnail extends Component { className = { containerClassName } id = 'localVideoContainer' onClick = { this._onClick } - onMouseEnter = { this._onMouseEnter } - onMouseLeave = { this._onMouseLeave } - { ...(isMobileBrowser() ? { - onTouchEnd: this._onTouchEnd, - onTouchMove: this._onTouchMove, - onTouchStart: this._onTouchStart - } : {}) } + { ...(_isMobile + ? { + onTouchEnd: this._onTouchEnd, + onTouchMove: this._onTouchMove, + onTouchStart: this._onTouchStart + } + : { + onMouseEnter: this._onMouseEnter, + onMouseLeave: this._onMouseLeave + } + ) } style = { styles.thumbnail }>
@@ -875,6 +887,7 @@ class Thumbnail extends Component { */ _renderRemoteParticipant() { const { + _isMobile, _isTestModeEnabled, _participant, _startSilent, @@ -909,13 +922,17 @@ class Thumbnail extends Component { className = { containerClassName } id = { `participant_${id}` } onClick = { this._onClick } - onMouseEnter = { this._onMouseEnter } - onMouseLeave = { this._onMouseLeave } - { ...(isMobileBrowser() ? { - onTouchEnd: this._onTouchEnd, - onTouchMove: this._onTouchMove, - onTouchStart: this._onTouchStart - } : {}) } + { ...(_isMobile + ? { + onTouchEnd: this._onTouchEnd, + onTouchMove: this._onTouchMove, + onTouchStart: this._onTouchStart + } + : { + onMouseEnter: this._onMouseEnter, + onMouseLeave: this._onMouseLeave + } + ) } style = { styles.thumbnail }> { _videoTrack && { + event.stopPropagation(); + }, []); - useEffect(() => { - window.addEventListener('mousedown', handleOutsideClickOrTouch); - window.addEventListener('touchstart', handleOutsideClickOrTouch); - - return () => { - window.removeEventListener('mousedown', handleOutsideClickOrTouch); - window.removeEventListener('touchstart', handleOutsideClickOrTouch); - }; - }, [ drawerRef ]); + /** + * Handles clicks outside of the menu, closing it, and also stopping further propagation. + * + * @param {Object} event - The click event. + * @returns {void} + */ + const handleOutsideClick = useCallback(event => { + event.stopPropagation(); + onClose(); + }, [ onClose ]); return ( isOpen ? (
- {children} + className = 'drawer-menu-container' + onClick = { handleOutsideClick }> +
+ {children} +
) : null );