From 807acf3c3a74c4091aeef2ab90a7b8b7f1c8d20e Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Thu, 6 May 2021 18:36:21 -0400 Subject: updated moment mention style --- src/utils/comments.tsx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src/utils') diff --git a/src/utils/comments.tsx b/src/utils/comments.tsx index a71e3857..0d551682 100644 --- a/src/utils/comments.tsx +++ b/src/utils/comments.tsx @@ -55,6 +55,7 @@ const renderPart = ( interface RenderProps { value: string; styles: StyleProp; + partTypes: PartType[]; onPress: (user: UserType) => void; } @@ -66,9 +67,10 @@ interface RenderProps { export const renderTextWithMentions: React.FC = ({ value, styles, + partTypes, onPress, }) => { - const {parts} = parseValue(value, mentionPartTypes); + const {parts} = parseValue(value, partTypes); return ( {parts.map((part, index) => renderPart(part, index, onPress))} @@ -76,12 +78,19 @@ export const renderTextWithMentions: React.FC = ({ ); }; -export const mentionPartTypes: PartType[] = [ - { - trigger: '@', - renderSuggestions: (props) => , - allowedSpacesCount: 0, - isInsertSpaceAfterMention: true, - textStyle: {color: TAGG_LIGHT_BLUE}, - }, -]; +export const mentionPartTypes: (style: 'blue' | 'white') => PartType[] = ( + style, +) => { + return [ + { + trigger: '@', + renderSuggestions: (props) => , + allowedSpacesCount: 0, + isInsertSpaceAfterMention: true, + textStyle: + style === 'blue' + ? {color: TAGG_LIGHT_BLUE} + : {color: 'white', fontWeight: '800'}, + }, + ]; +}; -- cgit v1.2.3-70-g09d2