diff options
author | Ivan Chen <ivan@tagg.id> | 2021-05-11 19:19:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 19:19:18 -0400 |
commit | 406d335103d084a8ff7a4fa141e6d7d0e2d54a93 (patch) | |
tree | 1095a472fa9dac7e8c91e7718f5b3ba7520cfab5 | |
parent | 68d10064cf1dcd2a774a4b2299f3a64f8fb75c60 (diff) | |
parent | f7bc9440a8aa8939cba37655792a73f13ca28b6c (diff) |
Merge pull request #414 from IvanIFChen/tma846-navigation-from-comments
[TMA-846] Added navigation from comments
-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), + }, }, ]; }; |