jiti-meet/react/features/chat/components/web/ChatDialogHeader.js

41 lines
841 B
JavaScript
Raw Normal View History

// @flow
import React from 'react';
import { Icon, IconClose } from '../../../base/icons';
import { connect } from '../../../base/redux';
import { toggleChat } from '../../actions.web';
type Props = {
/**
* Function to be called when pressing the close button.
*/
onCancel: Function,
2021-01-14 16:12:08 +00:00
/**
* An optional class name.
*/
className: string,
};
/**
* Custom header of the {@code ChatDialog}.
*
* @returns {React$Element<any>}
*/
function Header({ onCancel, className }: Props) {
return (
<div
2021-01-14 16:12:08 +00:00
className = { className || 'chat-dialog-header' }>
<Icon
onClick = { onCancel }
src = { IconClose } />
</div>
);
}
const mapDispatchToProps = { onCancel: toggleChat };
export default connect(null, mapDispatchToProps)(Header);