2019-10-30 14:14:41 +00:00
|
|
|
import React from 'react';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { Text, TouchableOpacity } from 'react-native';
|
2019-10-30 14:14:41 +00:00
|
|
|
|
|
|
|
import styles from '../styles';
|
|
|
|
import I18n from '../../../i18n';
|
2019-12-04 16:39:53 +00:00
|
|
|
import { themes } from '../../../constants/colors';
|
2022-03-31 22:39:24 +00:00
|
|
|
import { useTheme } from '../../../theme';
|
2019-10-30 14:14:41 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
interface IMessageBoxFixedMentionItem {
|
|
|
|
item: {
|
|
|
|
username: string;
|
|
|
|
};
|
|
|
|
onPress: Function;
|
|
|
|
}
|
|
|
|
|
2022-03-31 22:39:24 +00:00
|
|
|
const FixedMentionItem = ({ item, onPress }: IMessageBoxFixedMentionItem) => {
|
|
|
|
const { theme } = useTheme();
|
|
|
|
return (
|
|
|
|
<TouchableOpacity
|
|
|
|
style={[
|
|
|
|
styles.mentionItem,
|
|
|
|
{
|
|
|
|
backgroundColor: themes[theme].auxiliaryBackground,
|
|
|
|
borderTopColor: themes[theme].separatorColor
|
|
|
|
}
|
|
|
|
]}
|
|
|
|
onPress={() => onPress(item)}>
|
|
|
|
<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>
|
|
|
|
);
|
|
|
|
};
|
2019-10-30 14:14:41 +00:00
|
|
|
|
|
|
|
export default FixedMentionItem;
|