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.

ChatDialogHeader.js 841B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import React from 'react';
  3. import { Icon, IconClose } from '../../../base/icons';
  4. import { connect } from '../../../base/redux';
  5. import { toggleChat } from '../../actions.web';
  6. type Props = {
  7. /**
  8. * Function to be called when pressing the close button.
  9. */
  10. onCancel: Function,
  11. /**
  12. * An optional class name.
  13. */
  14. className: string,
  15. };
  16. /**
  17. * Custom header of the {@code ChatDialog}.
  18. *
  19. * @returns {React$Element<any>}
  20. */
  21. function Header({ onCancel, className }: Props) {
  22. return (
  23. <div
  24. className = { className || 'chat-dialog-header' }>
  25. <Icon
  26. onClick = { onCancel }
  27. src = { IconClose } />
  28. </div>
  29. );
  30. }
  31. const mapDispatchToProps = { onCancel: toggleChat };
  32. export default connect(null, mapDispatchToProps)(Header);