import React, { useContext } from 'react'; import { Text, View } from 'react-native'; import styles from './styles'; import { themes } from '../../lib/constants'; import MessageContext from './Context'; import ThreadDetails from '../ThreadDetails'; import I18n from '../../i18n'; import { IMessageThread } from './interfaces'; import { useTheme } from '../../theme'; const Thread = React.memo( ({ msg, tcount, tlm, isThreadRoom, id }: IMessageThread) => { const { theme } = useTheme(); const { threadBadgeColor, toggleFollowThread, user, replies } = useContext(MessageContext); if (!tlm || isThreadRoom || tcount === 0) { return null; } return ( {I18n.t('Reply')} ); }, (prevProps, nextProps) => { if (prevProps.tcount !== nextProps.tcount) { return false; } return true; } ); Thread.displayName = 'MessageThread'; export default Thread;