2022-11-01 12:36:32 +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-10-11 10:47:54 +00:00
|
|
|
import { openDialog, openSheet } from '../../../base/dialog/actions';
|
2022-11-08 10:24:32 +00:00
|
|
|
import { IconDotsHorizontal } from '../../../base/icons/svg';
|
2022-07-27 08:40:34 +00:00
|
|
|
import Button from '../../../base/ui/components/native/Button';
|
2022-10-31 14:34:26 +00:00
|
|
|
import IconButton from '../../../base/ui/components/native/IconButton';
|
2022-11-09 12:45:55 +00:00
|
|
|
import { BUTTON_TYPES } from '../../../base/ui/constants.native';
|
2022-11-01 12:36:32 +00:00
|
|
|
// @ts-ignore
|
2022-10-31 14:34:26 +00:00
|
|
|
import MuteEveryoneDialog from '../../../video-menu/components/native/MuteEveryoneDialog';
|
2022-07-08 08:27:27 +00:00
|
|
|
import { isMoreActionsVisible, isMuteAllVisible } from '../../functions';
|
|
|
|
|
2022-11-01 12:36:32 +00:00
|
|
|
// @ts-ignore
|
2022-07-08 08:27:27 +00:00
|
|
|
import { ContextMenuMore } from './ContextMenuMore';
|
2022-11-01 12:36:32 +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'
|
2022-08-22 09:40:59 +00:00
|
|
|
labelKey = 'participantsPane.actions.muteAll'
|
|
|
|
onClick = { muteAll }
|
2022-07-08 08:27:27 +00:00
|
|
|
type = { BUTTON_TYPES.SECONDARY } />
|
|
|
|
)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
showMoreActions && (
|
|
|
|
<IconButton
|
|
|
|
onPress = { openMoreMenu }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconDotsHorizontal }
|
2022-07-08 08:27:27 +00:00
|
|
|
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;
|