您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AlwaysOnLabels.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { TouchableOpacity } from 'react-native';
  4. import { useDispatch } from 'react-redux';
  5. import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
  6. import { RecordingLabel } from '../../../recording';
  7. import { openHighlightDialog } from '../../../recording/actions.native';
  8. import HighlightButton from '../../../recording/components/Recording/native/HighlightButton';
  9. import VisitorsCountLabel from '../../../visitors/components/native/VisitorsCountLabel';
  10. import RaisedHandsCountLabel from './RaisedHandsCountLabel';
  11. import {
  12. LABEL_ID_RAISED_HANDS_COUNT,
  13. LABEL_ID_RECORDING,
  14. LABEL_ID_STREAMING,
  15. LABEL_ID_VISITORS_COUNT,
  16. LabelHitSlop
  17. } from './constants';
  18. type Props = {
  19. /**
  20. * Creates a function to be invoked when the onPress of the touchables are
  21. * triggered.
  22. */
  23. createOnPress: Function
  24. }
  25. const AlwaysOnLabels = ({ createOnPress }: Props) => {
  26. const dispatch = useDispatch();
  27. const openHighlightDialogCallback = useCallback(() => dispatch(openHighlightDialog()), [ dispatch ]);
  28. return (<>
  29. <TouchableOpacity
  30. hitSlop = { LabelHitSlop }
  31. onPress = { createOnPress(LABEL_ID_RECORDING) } >
  32. <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
  33. </TouchableOpacity>
  34. <TouchableOpacity
  35. hitSlop = { LabelHitSlop }
  36. onPress = { createOnPress(LABEL_ID_STREAMING) } >
  37. <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
  38. </TouchableOpacity>
  39. <TouchableOpacity
  40. hitSlop = { LabelHitSlop }
  41. onPress = { openHighlightDialogCallback }>
  42. <HighlightButton />
  43. </TouchableOpacity>
  44. <TouchableOpacity
  45. hitSlop = { LabelHitSlop }
  46. onPress = { createOnPress(LABEL_ID_RAISED_HANDS_COUNT) } >
  47. <RaisedHandsCountLabel />
  48. </TouchableOpacity>
  49. <TouchableOpacity
  50. hitSlop = { LabelHitSlop }
  51. onPress = { createOnPress(LABEL_ID_VISITORS_COUNT) } >
  52. <VisitorsCountLabel />
  53. </TouchableOpacity>
  54. </>);
  55. };
  56. export default AlwaysOnLabels;