verdnatura-chat/app/containers/MessageBox/Mentions/FixedMentionItem.js

34 lines
964 B
JavaScript
Raw Normal View History

import React from 'react';
import { TouchableOpacity, Text } from 'react-native';
import PropTypes from 'prop-types';
import styles from '../styles';
import I18n from '../../../i18n';
2019-12-04 16:39:53 +00:00
import { themes } from '../../../constants/colors';
2019-12-04 16:39:53 +00:00
const FixedMentionItem = ({ item, onPress, theme }) => (
<TouchableOpacity
2019-12-04 16:39:53 +00:00
style={[
styles.mentionItem,
{
backgroundColor: themes[theme].auxiliaryBackground,
borderTopColor: themes[theme].separatorColor
}
]}
onPress={() => onPress(item)}
>
2019-12-04 16:39:53 +00:00
<Text style={[styles.fixedMentionAvatar, { color: themes[theme].titleText }]}>{item.username}</Text>
<Text style={[styles.mentionText, { color: themes[theme].titleText }]}>
{item.username === 'here' ? I18n.t('Notify_active_in_this_room') : I18n.t('Notify_all_in_this_room')}
</Text>
</TouchableOpacity>
);
FixedMentionItem.propTypes = {
item: PropTypes.object,
2019-12-04 16:39:53 +00:00
onPress: PropTypes.func,
theme: PropTypes.string
};
export default FixedMentionItem;