import React from 'react'; import PropTypes from 'prop-types'; import { TouchableOpacity } from 'react-native'; import Avatar from '../Avatar'; import styles from './styles'; const MessageAvatar = React.memo(({ isHeader, avatar, author, baseUrl, user, small, navToRoomInfo }) => { if (isHeader) { const navParam = { t: 'd', rid: author._id }; return ( navToRoomInfo(navParam)} disabled={author._id === user.id} > ); } return null; }, (prevProps, nextProps) => prevProps.isHeader === nextProps.isHeader); MessageAvatar.propTypes = { isHeader: PropTypes.bool, avatar: PropTypes.string, author: PropTypes.obj, baseUrl: PropTypes.string, user: PropTypes.obj, small: PropTypes.bool, navToRoomInfo: PropTypes.func }; MessageAvatar.displayName = 'MessageAvatar'; export default MessageAvatar;