Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ReactionMenu.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { Image, View } from 'react-native';
  4. import { useSelector } from 'react-redux';
  5. import { ColorSchemeRegistry } from '../../../base/color-scheme';
  6. import { isGifEnabled } from '../../../gifs/functions';
  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. type Props = {
  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. }: Props) {
  34. const _styles = useSelector(state => 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. {Object.keys(REACTIONS).map(key => (
  44. <ReactionButton
  45. key = { key }
  46. reaction = { key }
  47. styles = { _styles.reactionButton } />
  48. ))}
  49. {gifEnabled && (
  50. <ReactionButton
  51. onClick = { openGifMenu }
  52. styles = { _styles.reactionButton }>
  53. <Image
  54. height = { 22 }
  55. source = { require('../../../../../images/GIPHY_icon.png') } />
  56. </ReactionButton>
  57. )}
  58. </View>
  59. <RaiseHandButton onCancel = { onCancel } />
  60. </View>
  61. );
  62. }
  63. export default ReactionMenu;