You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ParticipantsPane.js 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { ScrollView, View } from 'react-native';
  5. import { Button } from 'react-native-paper';
  6. import { useDispatch } from 'react-redux';
  7. import { hideDialog, openDialog } from '../../../base/dialog';
  8. import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
  9. import { JitsiModal } from '../../../base/modal';
  10. import MuteEveryoneDialog
  11. from '../../../video-menu/components/native/MuteEveryoneDialog';
  12. import { ContextMenuMore } from './ContextMenuMore';
  13. import { LobbyParticipantList } from './LobbyParticipantList';
  14. import { MeetingParticipantList } from './MeetingParticipantList';
  15. import styles from './styles';
  16. /**
  17. * Participant pane.
  18. *
  19. * @returns {React$Element<any>}
  20. */
  21. export function ParticipantsPane() {
  22. const dispatch = useDispatch();
  23. const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)));
  24. const closePane = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
  25. const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
  26. [ dispatch ]);
  27. const { t } = useTranslation();
  28. return (
  29. <JitsiModal
  30. hideHeaderWithNavigation = { true }
  31. style = { styles.participantsPane }>
  32. <View style = { styles.header }>
  33. <Button
  34. contentStyle = { styles.closeIcon }
  35. /* eslint-disable-next-line react/jsx-no-bind */
  36. icon = { () =>
  37. (<Icon
  38. size = { 24 }
  39. src = { IconClose } />)
  40. }
  41. mode = 'contained'
  42. onPress = { closePane }
  43. style = { styles.closeButton } />
  44. </View>
  45. <ScrollView>
  46. <LobbyParticipantList />
  47. <MeetingParticipantList />
  48. </ScrollView>
  49. <View style = { styles.footer }>
  50. <Button
  51. children = { t('participantsPane.actions.muteAll') }
  52. contentStyle = { styles.muteAllContent }
  53. labelStyle = { styles.muteAllLabel }
  54. mode = 'contained'
  55. onPress = { muteAll }
  56. style = { styles.muteAllButton } />
  57. <Button
  58. contentStyle = { styles.moreIcon }
  59. /* eslint-disable-next-line react/jsx-no-bind */
  60. icon = { () =>
  61. (<Icon
  62. size = { 24 }
  63. src = { IconHorizontalPoints } />)
  64. }
  65. mode = 'contained'
  66. onPress = { openMoreMenu }
  67. style = { styles.moreButton } />
  68. </View>
  69. </JitsiModal>
  70. );
  71. }
  72. export default ParticipantsPane;