Compare commits

...

1 Commits

Author SHA1 Message Date
Diego Mello e18f1ee837 stash 2020-07-20 16:20:29 -03:00
2 changed files with 31 additions and 26 deletions

View File

@ -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 (
<Text
style={[mentionStyle, ...style]}
onPress={handlePress}
>
{useRealName && user.name ? user.name : user.username}
</Text>
<View style={{ borderRadius: 2, backgroundColor: 'red', paddingHorizontal: 2, overflow: 'hidden' }}>
<Text
// style={[mentionStyle, ...style]}
style={styles.mention}
onPress={handlePress}
>
{useRealName && user.name ? user.name : user.username}
</Text>
</View>
);
}

View File

@ -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'