2019-06-10 18:36:31 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
import { themes } from '../../constants/colors';
|
2019-06-10 18:36:31 +00:00
|
|
|
import { CustomIcon } from '../../lib/Icons';
|
|
|
|
import styles from './styles';
|
|
|
|
|
2021-07-22 20:09:06 +00:00
|
|
|
interface IMessageReadReceipt {
|
|
|
|
isReadReceiptEnabled: boolean;
|
|
|
|
unread: boolean;
|
|
|
|
theme: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ReadReceipt = React.memo(({ isReadReceiptEnabled, unread, theme }: IMessageReadReceipt) => {
|
2019-06-10 18:36:31 +00:00
|
|
|
if (isReadReceiptEnabled && !unread && unread !== null) {
|
2019-12-04 16:39:53 +00:00
|
|
|
return <CustomIcon name='check' color={themes[theme].tintColor} size={15} style={styles.readReceipt} />;
|
2019-06-10 18:36:31 +00:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
});
|
|
|
|
ReadReceipt.displayName = 'MessageReadReceipt';
|
|
|
|
|
|
|
|
export default ReadReceipt;
|