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 React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Text } from 'react-native'; import { View, Text } from 'react-native';
import { themes } from '../../constants/colors'; import { themes } from '../../constants/colors';
@ -9,22 +9,22 @@ import styles from './styles';
const AtMention = React.memo(({ const AtMention = React.memo(({
mention, mentions, username, navToRoomInfo, style = [], useRealName, theme mention, mentions, username, navToRoomInfo, style = [], useRealName, theme
}) => { }) => {
let mentionStyle = { ...styles.mention, color: themes[theme].buttonText }; // let mentionStyle = { ...styles.mention, color: themes[theme].buttonText };
if (mention === 'all' || mention === 'here') { // if (mention === 'all' || mention === 'here') {
return <Text style={[mentionStyle, styles.mentionAll, ...style]}>{mention}</Text>; // return <Text style={[mentionStyle, styles.mentionAll, ...style]}>{mention}</Text>;
} // }
if (mention === username) { // if (mention === username) {
mentionStyle = { // mentionStyle = {
...mentionStyle, // ...mentionStyle,
backgroundColor: themes[theme].actionTintColor // // backgroundColor: themes[theme].actionTintColor
}; // };
} else { // } else {
mentionStyle = { // mentionStyle = {
...mentionStyle, // ...mentionStyle,
color: themes[theme].actionTintColor // // color: themes[theme].actionTintColor
}; // };
} // }
const user = mentions && mentions.length && mentions.find(m => m.username === mention); const user = mentions && mentions.length && mentions.find(m => m.username === mention);
@ -38,12 +38,15 @@ const AtMention = React.memo(({
if (user) { if (user) {
return ( return (
<Text <View style={{ borderRadius: 2, backgroundColor: 'red', paddingHorizontal: 2, overflow: 'hidden' }}>
style={[mentionStyle, ...style]} <Text
onPress={handlePress} // style={[mentionStyle, ...style]}
> style={styles.mention}
{useRealName && user.name ? user.name : user.username} onPress={handlePress}
</Text> >
{useRealName && user.name ? user.name : user.username}
</Text>
</View>
); );
} }

View File

@ -32,7 +32,8 @@ export default StyleSheet.create({
}, },
text: { text: {
fontSize: 16, fontSize: 16,
...sharedStyles.textRegular ...sharedStyles.textRegular,
// lineHeight: 30
}, },
textInfo: { textInfo: {
fontStyle: 'italic', fontStyle: 'italic',
@ -54,10 +55,11 @@ export default StyleSheet.create({
temp: { opacity: 0.3 }, temp: { opacity: 0.3 },
mention: { mention: {
fontSize: 16, fontSize: 16,
color: '#0072FE', // lineHeight: 20,
padding: 5, // color: '#0072FE',
// padding: 5,
...sharedStyles.textMedium, ...sharedStyles.textMedium,
backgroundColor: '#E8F2FF' // backgroundColor: '#E8F2FF'
}, },
mentionAll: { mentionAll: {
backgroundColor: '#FF5B5A' backgroundColor: '#FF5B5A'