2022-07-18 13:16:08 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-07-08 08:27:27 +00:00
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
import { View } from 'react-native';
|
2022-07-11 12:30:37 +00:00
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
2022-07-08 08:27:27 +00:00
|
|
|
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-08 08:27:27 +00:00
|
|
|
import { openDialog, openSheet } from '../../../base/dialog';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-08 08:27:27 +00:00
|
|
|
import { IconHorizontalPoints } from '../../../base/icons';
|
|
|
|
import IconButton from '../../../base/react/components/native/IconButton';
|
2022-07-27 08:40:34 +00:00
|
|
|
import Button from '../../../base/ui/components/native/Button';
|
|
|
|
import { BUTTON_TYPES } from '../../../base/ui/constants';
|
2022-07-08 08:27:27 +00:00
|
|
|
import MuteEveryoneDialog
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-08 08:27:27 +00:00
|
|
|
from '../../../video-menu/components/native/MuteEveryoneDialog';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-08 08:27:27 +00:00
|
|
|
import { isMoreActionsVisible, isMuteAllVisible } from '../../functions';
|
|
|
|
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-08 08:27:27 +00:00
|
|
|
import { ContextMenuMore } from './ContextMenuMore';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2022-07-08 08:27:27 +00:00
|
|
|
import styles from './styles';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the participants pane footer component.
|
|
|
|
*
|
|
|
|
* @returns { JSX.Element} - The participants pane footer component.
|
|
|
|
*/
|
|
|
|
const ParticipantsPaneFooter = (): JSX.Element => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const openMoreMenu = useCallback(() => dispatch(openSheet(ContextMenuMore)), [ dispatch ]);
|
|
|
|
const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
|
|
|
|
[ dispatch ]);
|
|
|
|
const showMoreActions = useSelector(isMoreActionsVisible);
|
|
|
|
const showMuteAll = useSelector(isMuteAllVisible);
|
|
|
|
|
2022-07-11 12:30:37 +00:00
|
|
|
return (
|
2022-07-08 08:27:27 +00:00
|
|
|
<View style = { styles.participantsPaneFooter }>
|
|
|
|
{
|
|
|
|
showMuteAll && (
|
|
|
|
<Button
|
|
|
|
accessibilityLabel = 'participantsPane.actions.muteAll'
|
|
|
|
label = 'participantsPane.actions.muteAll'
|
|
|
|
onPress = { muteAll }
|
|
|
|
type = { BUTTON_TYPES.SECONDARY } />
|
|
|
|
)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
showMoreActions && (
|
|
|
|
<IconButton
|
|
|
|
onPress = { openMoreMenu }
|
|
|
|
src = { IconHorizontalPoints }
|
|
|
|
style = { styles.moreButton }
|
|
|
|
type = { BUTTON_TYPES.SECONDARY } />
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</View>
|
2022-07-11 12:30:37 +00:00
|
|
|
);
|
2022-07-08 08:27:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ParticipantsPaneFooter;
|