Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

AlwaysOnLabels.tsx 2.2KB

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