Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

AlwaysOnLabels.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 RaisedHandsCountLabel from './RaisedHandsCountLabel';
  10. import {
  11. LABEL_ID_RAISED_HANDS_COUNT,
  12. LABEL_ID_RECORDING,
  13. LABEL_ID_STREAMING,
  14. LabelHitSlop
  15. } from './constants';
  16. type Props = {
  17. /**
  18. * Creates a function to be invoked when the onPress of the touchables are
  19. * triggered.
  20. */
  21. createOnPress: Function
  22. }
  23. const AlwaysOnLabels = ({ createOnPress }: Props) => {
  24. const dispatch = useDispatch();
  25. const openHighlightDialogCallback = useCallback(() => dispatch(openHighlightDialog()), [ dispatch ]);
  26. return (<>
  27. <TouchableOpacity
  28. hitSlop = { LabelHitSlop }
  29. onPress = { createOnPress(LABEL_ID_RECORDING) } >
  30. <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
  31. </TouchableOpacity>
  32. <TouchableOpacity
  33. hitSlop = { LabelHitSlop }
  34. onPress = { createOnPress(LABEL_ID_STREAMING) } >
  35. <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
  36. </TouchableOpacity>
  37. <TouchableOpacity
  38. hitSlop = { LabelHitSlop }
  39. onPress = { openHighlightDialogCallback }>
  40. <HighlightButton />
  41. </TouchableOpacity>
  42. <TouchableOpacity
  43. hitSlop = { LabelHitSlop }
  44. onPress = { createOnPress(LABEL_ID_RAISED_HANDS_COUNT) } >
  45. <RaisedHandsCountLabel />
  46. </TouchableOpacity>
  47. </>);
  48. };
  49. export default AlwaysOnLabels;