Compare commits
1 Commits
develop
...
improvemen
Author | SHA1 | Date |
---|---|---|
Diego Mello | e18f1ee837 |
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Text } from 'react-native';
|
||||
import { View, Text } from 'react-native';
|
||||
|
||||
import { themes } from '../../constants/colors';
|
||||
|
||||
|
@ -9,22 +9,22 @@ import styles from './styles';
|
|||
const AtMention = React.memo(({
|
||||
mention, mentions, username, navToRoomInfo, style = [], useRealName, theme
|
||||
}) => {
|
||||
let mentionStyle = { ...styles.mention, color: themes[theme].buttonText };
|
||||
if (mention === 'all' || mention === 'here') {
|
||||
return <Text style={[mentionStyle, styles.mentionAll, ...style]}>{mention}</Text>;
|
||||
}
|
||||
// let mentionStyle = { ...styles.mention, color: themes[theme].buttonText };
|
||||
// if (mention === 'all' || mention === 'here') {
|
||||
// return <Text style={[mentionStyle, styles.mentionAll, ...style]}>{mention}</Text>;
|
||||
// }
|
||||
|
||||
if (mention === username) {
|
||||
mentionStyle = {
|
||||
...mentionStyle,
|
||||
backgroundColor: themes[theme].actionTintColor
|
||||
};
|
||||
} else {
|
||||
mentionStyle = {
|
||||
...mentionStyle,
|
||||
color: themes[theme].actionTintColor
|
||||
};
|
||||
}
|
||||
// if (mention === username) {
|
||||
// mentionStyle = {
|
||||
// ...mentionStyle,
|
||||
// // backgroundColor: themes[theme].actionTintColor
|
||||
// };
|
||||
// } else {
|
||||
// mentionStyle = {
|
||||
// ...mentionStyle,
|
||||
// // color: themes[theme].actionTintColor
|
||||
// };
|
||||
// }
|
||||
|
||||
const user = mentions && mentions.length && mentions.find(m => m.username === mention);
|
||||
|
||||
|
@ -38,12 +38,15 @@ const AtMention = React.memo(({
|
|||
|
||||
if (user) {
|
||||
return (
|
||||
<View style={{ borderRadius: 2, backgroundColor: 'red', paddingHorizontal: 2, overflow: 'hidden' }}>
|
||||
<Text
|
||||
style={[mentionStyle, ...style]}
|
||||
// style={[mentionStyle, ...style]}
|
||||
style={styles.mention}
|
||||
onPress={handlePress}
|
||||
>
|
||||
{useRealName && user.name ? user.name : user.username}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ export default StyleSheet.create({
|
|||
},
|
||||
text: {
|
||||
fontSize: 16,
|
||||
...sharedStyles.textRegular
|
||||
...sharedStyles.textRegular,
|
||||
// lineHeight: 30
|
||||
},
|
||||
textInfo: {
|
||||
fontStyle: 'italic',
|
||||
|
@ -54,10 +55,11 @@ export default StyleSheet.create({
|
|||
temp: { opacity: 0.3 },
|
||||
mention: {
|
||||
fontSize: 16,
|
||||
color: '#0072FE',
|
||||
padding: 5,
|
||||
// lineHeight: 20,
|
||||
// color: '#0072FE',
|
||||
// padding: 5,
|
||||
...sharedStyles.textMedium,
|
||||
backgroundColor: '#E8F2FF'
|
||||
// backgroundColor: '#E8F2FF'
|
||||
},
|
||||
mentionAll: {
|
||||
backgroundColor: '#FF5B5A'
|
||||
|
|
Loading…
Reference in New Issue