You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ReactionMenu.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // @flow
  2. import React from 'react';
  3. import { View } from 'react-native';
  4. import { useSelector } from 'react-redux';
  5. import { ColorSchemeRegistry } from '../../../base/color-scheme';
  6. import { REACTIONS } from '../../constants';
  7. import RaiseHandButton from './RaiseHandButton';
  8. import ReactionButton from './ReactionButton';
  9. /**
  10. * The type of the React {@code Component} props of {@link ReactionMenu}.
  11. */
  12. type Props = {
  13. /**
  14. * Used to close the overflow menu after raise hand is clicked.
  15. */
  16. onCancel: Function,
  17. /**
  18. * Whether or not it's displayed in the overflow menu.
  19. */
  20. overflowMenu: boolean
  21. };
  22. /**
  23. * Animated reaction emoji.
  24. *
  25. * @returns {ReactElement}
  26. */
  27. function ReactionMenu({
  28. onCancel,
  29. overflowMenu
  30. }: Props) {
  31. const _styles = useSelector(state => ColorSchemeRegistry.get(state, 'Toolbox'));
  32. return (
  33. <View style = { overflowMenu ? _styles.overflowReactionMenu : _styles.reactionMenu }>
  34. <View style = { _styles.reactionRow }>
  35. {Object.keys(REACTIONS).map(key => (
  36. <ReactionButton
  37. key = { key }
  38. reaction = { key }
  39. styles = { _styles.reactionButton } />
  40. ))}
  41. </View>
  42. <RaiseHandButton onCancel = { onCancel } />
  43. </View>
  44. );
  45. }
  46. export default ReactionMenu;