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.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 { LobbyParticipantList } from './LobbyParticipantList';
  13. import { MeetingParticipantList } from './MeetingParticipantList';
  14. import styles from './styles';
  15. /**
  16. * Participant pane.
  17. *
  18. * @returns {React$Element<any>}
  19. */
  20. export function ParticipantsPane() {
  21. const dispatch = useDispatch();
  22. const closePane = useCallback(
  23. () => dispatch(hideDialog()),
  24. [ 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. style = { styles.moreButton } />
  67. </View>
  68. </JitsiModal>
  69. );
  70. }
  71. export default ParticipantsPane;