2022-05-27 17:27:43 +00:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
|
|
|
|
import Touchable from '../../Touchable';
|
|
|
|
import { CustomIcon } from '../../../CustomIcon';
|
|
|
|
import { BUTTON_HIT_SLOP } from '../../utils';
|
|
|
|
import MessageContext from '../../Context';
|
|
|
|
import styles from '../../styles';
|
2024-04-18 10:19:54 +00:00
|
|
|
import { E2E_MESSAGE_TYPE } from '../../../../lib/constants';
|
2022-05-27 17:27:43 +00:00
|
|
|
|
|
|
|
const Encrypted = React.memo(({ type }: { type: string }) => {
|
|
|
|
const { onEncryptedPress } = useContext(MessageContext);
|
|
|
|
|
|
|
|
if (type !== E2E_MESSAGE_TYPE) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Touchable onPress={onEncryptedPress} style={styles.rightIcons} hitSlop={BUTTON_HIT_SLOP}>
|
2024-04-18 10:19:54 +00:00
|
|
|
<CustomIcon name='encrypted' size={16} />
|
2022-05-27 17:27:43 +00:00
|
|
|
</Touchable>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
export default Encrypted;
|