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 910B

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