Compare commits
1 Commits
develop
...
improvemen
Author | SHA1 | Date |
---|---|---|
Diego Mello | e18f1ee837 |
|
@ -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 (
|
||||||
|
<View style={{ borderRadius: 2, backgroundColor: 'red', paddingHorizontal: 2, overflow: 'hidden' }}>
|
||||||
<Text
|
<Text
|
||||||
style={[mentionStyle, ...style]}
|
// style={[mentionStyle, ...style]}
|
||||||
|
style={styles.mention}
|
||||||
onPress={handlePress}
|
onPress={handlePress}
|
||||||
>
|
>
|
||||||
{useRealName && user.name ? user.name : user.username}
|
{useRealName && user.name ? user.name : user.username}
|
||||||
</Text>
|
</Text>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue