2021-05-12 16:13:03 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { useCallback } from 'react';
|
2021-05-19 10:08:30 +00:00
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { View } from 'react-native';
|
2021-05-19 15:56:08 +00:00
|
|
|
import { Button, withTheme } from 'react-native-paper';
|
2021-05-19 10:08:30 +00:00
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
2021-05-12 16:13:03 +00:00
|
|
|
|
2021-05-19 15:56:08 +00:00
|
|
|
import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
|
2021-05-12 16:13:03 +00:00
|
|
|
import { JitsiModal } from '../../../base/modal';
|
2021-05-19 10:08:30 +00:00
|
|
|
import { isLocalParticipantModerator } from '../../../base/participants';
|
2021-05-19 11:05:28 +00:00
|
|
|
import { close } from '../../actions.any';
|
2021-05-12 16:13:03 +00:00
|
|
|
|
2021-05-14 16:03:23 +00:00
|
|
|
import styles from './styles';
|
|
|
|
|
2021-05-19 10:08:30 +00:00
|
|
|
|
2021-05-12 16:13:03 +00:00
|
|
|
/**
|
|
|
|
* {@code ParticipantsPane}'s React {@code Component} prop types.
|
|
|
|
*/
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Theme used for styles.
|
|
|
|
*/
|
|
|
|
theme: Object
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Participant pane.
|
|
|
|
*
|
|
|
|
* @returns {React$Element<any>}
|
|
|
|
*/
|
|
|
|
function ParticipantsPane({ theme }: Props) {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const closePane = useCallback(
|
|
|
|
() => dispatch(close()),
|
|
|
|
[ dispatch ]);
|
2021-05-19 10:08:30 +00:00
|
|
|
const isLocalModerator = useSelector(isLocalParticipantModerator);
|
|
|
|
const { t } = useTranslation();
|
2021-05-14 16:03:23 +00:00
|
|
|
const { palette } = theme;
|
|
|
|
|
2021-05-12 16:13:03 +00:00
|
|
|
return (
|
|
|
|
<JitsiModal
|
2021-05-14 16:03:23 +00:00
|
|
|
showHeaderWithNavigation = { false }
|
|
|
|
style = { styles.participantsPane }>
|
2021-05-19 10:08:30 +00:00
|
|
|
<View style = { styles.header }>
|
|
|
|
<Button
|
2021-05-19 15:56:08 +00:00
|
|
|
contentStyle = { styles.closeIcon }
|
|
|
|
/* eslint-disable-next-line react/jsx-no-bind */
|
|
|
|
icon = { () =>
|
|
|
|
(<Icon
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconClose } />)
|
|
|
|
}
|
2021-05-19 10:08:30 +00:00
|
|
|
mode = 'contained'
|
|
|
|
onPress = { closePane }
|
|
|
|
style = { styles.closeButton }
|
|
|
|
theme = {{
|
|
|
|
colors: {
|
|
|
|
primary: palette.action02
|
|
|
|
}
|
|
|
|
}} />
|
|
|
|
</View>
|
2021-05-19 15:56:08 +00:00
|
|
|
<View style = { styles.footer }>
|
|
|
|
<Button
|
|
|
|
contentStyle = { styles.muteAllContent }
|
|
|
|
onPress = { closePane }
|
|
|
|
style = { styles.muteAllButton } >
|
|
|
|
{ t('participantsPane.actions.muteAll') }
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
contentStyle = { styles.moreIcon }
|
|
|
|
/* eslint-disable-next-line react/jsx-no-bind */
|
|
|
|
icon = { () =>
|
|
|
|
(<Icon
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconHorizontalPoints } />)
|
|
|
|
}
|
|
|
|
mode = 'contained'
|
|
|
|
onPress = { closePane }
|
|
|
|
style = { styles.moreButton }
|
|
|
|
theme = {{
|
|
|
|
colors: {
|
|
|
|
primary: palette.action02
|
|
|
|
}
|
|
|
|
}} />
|
|
|
|
</View>
|
2021-05-12 16:13:03 +00:00
|
|
|
</JitsiModal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-05-19 10:08:30 +00:00
|
|
|
export default withTheme(ParticipantsPane);
|