diff options
Diffstat (limited to 'src/utils/comments.tsx')
-rw-r--r-- | src/utils/comments.tsx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/utils/comments.tsx b/src/utils/comments.tsx index 0d551682..5c17cefe 100644 --- a/src/utils/comments.tsx +++ b/src/utils/comments.tsx @@ -6,9 +6,11 @@ import { Part, PartType, } from 'react-native-controlled-mentions'; +import {TouchableOpacity} from 'react-native-gesture-handler'; import TaggTypeahead from '../components/common/TaggTypeahead'; import {TAGG_LIGHT_BLUE} from '../constants'; import {UserType} from '../types'; +import {normalize} from './layouts'; /** * Part renderer @@ -28,9 +30,8 @@ const renderPart = ( // Mention type part if (isMentionPartType(part.partType)) { return ( - <Text + <TouchableOpacity key={`${index}-${part.data?.trigger}`} - style={part.partType.textStyle} onPress={() => { if (part.data) { handlePress({ @@ -39,8 +40,8 @@ const renderPart = ( }); } }}> - {part.text} - </Text> + <Text style={part.partType.textStyle}>{part.text}</Text> + </TouchableOpacity> ); } @@ -89,8 +90,15 @@ export const mentionPartTypes: (style: 'blue' | 'white') => PartType[] = ( isInsertSpaceAfterMention: true, textStyle: style === 'blue' - ? {color: TAGG_LIGHT_BLUE} - : {color: 'white', fontWeight: '800'}, + ? { + color: TAGG_LIGHT_BLUE, + top: normalize(3), + } + : { + color: 'white', + fontWeight: '800', + top: normalize(7.5), + }, }, ]; }; |