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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { View } from 'react-native';
  5. import { Button, withTheme } from 'react-native-paper';
  6. import { useDispatch } from 'react-redux';
  7. import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
  8. import { JitsiModal } from '../../../base/modal';
  9. import { close } from '../../actions.any';
  10. import { LobbyParticipantList } from './LobbyParticipantList';
  11. import styles from './styles';
  12. /**
  13. * {@code ParticipantsPane}'s React {@code Component} prop types.
  14. */
  15. type Props = {
  16. /**
  17. * Theme used for styles.
  18. */
  19. theme: Object
  20. }
  21. /**
  22. * Participant pane.
  23. *
  24. * @returns {React$Element<any>}
  25. */
  26. function ParticipantsPane({ theme }: Props) {
  27. const dispatch = useDispatch();
  28. const closePane = useCallback(
  29. () => dispatch(close()),
  30. [ dispatch ]);
  31. const { t } = useTranslation();
  32. const { palette } = theme;
  33. return (
  34. <JitsiModal
  35. showHeaderWithNavigation = { false }
  36. style = { styles.participantsPane }>
  37. <View style = { styles.header }>
  38. <Button
  39. contentStyle = { styles.closeIcon }
  40. /* eslint-disable-next-line react/jsx-no-bind */
  41. icon = { () =>
  42. (<Icon
  43. size = { 24 }
  44. src = { IconClose } />)
  45. }
  46. mode = 'contained'
  47. onPress = { closePane }
  48. style = { styles.closeButton }
  49. theme = {{
  50. colors: {
  51. primary: palette.action02
  52. }
  53. }} />
  54. </View>
  55. <LobbyParticipantList />
  56. <View style = { styles.footer }>
  57. <Button
  58. color = { palette.text01 }
  59. compact = { true }
  60. contentStyle = { styles.muteAllContent }
  61. onPress = { closePane }
  62. style = { styles.muteAllButton } >
  63. { t('participantsPane.actions.muteAll') }
  64. </Button>
  65. <Button
  66. contentStyle = { styles.moreIcon }
  67. /* eslint-disable-next-line react/jsx-no-bind */
  68. icon = { () =>
  69. (<Icon
  70. size = { 24 }
  71. src = { IconHorizontalPoints } />)
  72. }
  73. mode = 'contained'
  74. onPress = { closePane }
  75. style = { styles.moreButton }
  76. theme = {{
  77. colors: {
  78. primary: palette.action02
  79. }
  80. }} />
  81. </View>
  82. </JitsiModal>
  83. );
  84. }
  85. export default withTheme(ParticipantsPane);