2019-06-10 18:36:31 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2019-12-11 23:01:12 +00:00
|
|
|
import { themes } from '../../constants/colors';
|
2019-06-10 18:36:31 +00:00
|
|
|
import { CustomIcon } from '../../lib/Icons';
|
|
|
|
import styles from './styles';
|
|
|
|
|
2019-12-11 23:01:12 +00:00
|
|
|
const ReadReceipt = React.memo(({ isReadReceiptEnabled, unread, theme }) => {
|
2019-06-10 18:36:31 +00:00
|
|
|
if (isReadReceiptEnabled && !unread && unread !== null) {
|
2019-12-11 23:01:12 +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';
|
|
|
|
|
|
|
|
ReadReceipt.propTypes = {
|
|
|
|
isReadReceiptEnabled: PropTypes.bool,
|
2019-12-11 23:01:12 +00:00
|
|
|
unread: PropTypes.bool,
|
|
|
|
theme: PropTypes.bool
|
2019-06-10 18:36:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ReadReceipt;
|