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

ReactionMenu.tsx 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import React, { useCallback } from 'react';
  2. import { Image, View } from 'react-native';
  3. import { useSelector } from 'react-redux';
  4. import { IReduxState } from '../../../app/types';
  5. import ColorSchemeRegistry from '../../../base/color-scheme/ColorSchemeRegistry';
  6. import { isGifEnabled } from '../../../gifs/functions.native';
  7. import { navigate } from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
  8. import { screen } from '../../../mobile/navigation/routes';
  9. import { REACTIONS } from '../../constants';
  10. import RaiseHandButton from './RaiseHandButton';
  11. import ReactionButton from './ReactionButton';
  12. /**
  13. * The type of the React {@code Component} props of {@link ReactionMenu}.
  14. */
  15. interface IProps {
  16. /**
  17. * Used to close the overflow menu after raise hand is clicked.
  18. */
  19. onCancel: Function;
  20. /**
  21. * Whether or not it's displayed in the overflow menu.
  22. */
  23. overflowMenu: boolean;
  24. }
  25. /**
  26. * Animated reaction emoji.
  27. *
  28. * @returns {ReactElement}
  29. */
  30. function ReactionMenu({
  31. onCancel,
  32. overflowMenu
  33. }: IProps) {
  34. const _styles: any = useSelector((state: IReduxState) => ColorSchemeRegistry.get(state, 'Toolbox'));
  35. const gifEnabled = useSelector(isGifEnabled);
  36. const openGifMenu = useCallback(() => {
  37. navigate(screen.conference.gifsMenu);
  38. onCancel();
  39. }, []);
  40. return (
  41. <View style = { overflowMenu ? _styles.overflowReactionMenu : _styles.reactionMenu }>
  42. <View style = { _styles.reactionRow }>
  43. {
  44. Object.keys(REACTIONS).map(key => (
  45. <ReactionButton
  46. key = { key }
  47. reaction = { key }
  48. styles = { _styles.reactionButton } />
  49. ))
  50. }
  51. {
  52. gifEnabled && (
  53. <ReactionButton
  54. onClick = { openGifMenu }
  55. styles = { _styles.reactionButton }>
  56. <Image // @ts-ignore
  57. height = { 22 }
  58. source = { require('../../../../../images/GIPHY_icon.png') } />
  59. </ReactionButton>
  60. )
  61. }
  62. </View>
  63. <RaiseHandButton onCancel = { onCancel } />
  64. </View>
  65. );
  66. }
  67. export default ReactionMenu;