@ -18,7 +18,7 @@ import {
} from '../base/participants/functions' ;
import { toState } from '../base/redux' ;
import { normalizeAccents } from '../base/util/strings' ;
import { getBreakoutRoomsConfig , isInBreakoutRoom } from '../breakout-rooms/functions' ;
import { isInBreakoutRoom } from '../breakout-rooms/functions' ;
import { QUICK _ACTION _BUTTON , REDUCER _KEY , MEDIA _STATE } from './constants' ;
@ -141,6 +141,20 @@ export const getComputedOuterHeight = (element: HTMLElement) => {
* /
const getState = ( state : Object ) => state [ REDUCER _KEY ] ;
/ * *
* Returns the participants pane config .
*
* @ param { Function | Object } stateful - The redux store , the redux
* { @ code getState } function , or the redux state itself .
* @ returns { Object }
* /
export const getParticipantsPaneConfig = ( stateful : Function | Object ) => {
const state = toState ( stateful ) ;
const { participantsPane = { } } = state [ 'features/base/config' ] ;
return participantsPane ;
} ;
/ * *
* Is the participants pane open .
*
@ -262,22 +276,6 @@ export function participantMatchesSearch(participant: Object, searchString: stri
return false ;
}
/ * *
* Returns whether the participants pane footer menu is visible .
*
* @ param { Object } state - Global state .
* @ returns { boolean }
* /
export const isFooterMenuVisible = ( state : Object ) => {
const isLocalModerator = isLocalParticipantModerator ( state ) ;
const inBreakoutRoom = isInBreakoutRoom ( state ) ;
const { hideFooterMenu } = getBreakoutRoomsConfig ( state ) ;
return inBreakoutRoom
? ! hideFooterMenu && isLocalModerator
: isLocalModerator ;
} ;
/ * *
* Returns whether the more actions button is visible .
*
@ -285,12 +283,11 @@ export const isFooterMenuVisible = (state: Object) => {
* @ returns { boolean }
* /
export const isMoreActionsVisible = ( state : Object ) => {
const isLocalModerator = isLocalParticipantModerator ( state ) ;
const inBreakoutRoom = isInBreakoutRoom ( state ) ;
const { hideMoreActionsButton } = getBreakoutRooms Config ( state ) ;
const { hideMoreActionsButton } = getParticipantsPane Config ( state ) ;
return inBreakoutRoom
? ! hideMoreActionsButton
: true ;
return inBreakoutRoom ? false : ! hideMoreActionsButton && isLocalModerator ;
} ;
/ * *
@ -300,10 +297,9 @@ export const isMoreActionsVisible = (state: Object) => {
* @ returns { boolean }
* /
export const isMuteAllVisible = ( state : Object ) => {
const isLocalModerator = isLocalParticipantModerator ( state ) ;
const inBreakoutRoom = isInBreakoutRoom ( state ) ;
const { hideMuteAllButton } = getBreakoutRooms Config ( state ) ;
const { hideMuteAllButton } = getParticipantsPane Config ( state ) ;
return inBreakoutRoom
? ! hideMuteAllButton
: true ;
return inBreakoutRoom ? false : ! hideMuteAllButton && isLocalModerator ;
} ;