diff options
Diffstat (limited to 'src/utils/comments.tsx')
-rw-r--r-- | src/utils/comments.tsx | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/utils/comments.tsx b/src/utils/comments.tsx index 80786b74..28879622 100644 --- a/src/utils/comments.tsx +++ b/src/utils/comments.tsx @@ -80,9 +80,9 @@ export const renderTextWithMentions: React.FC<RenderProps> = ({ }; export const mentionPartTypes: ( - style: 'blue' | 'white', + theme: 'blue' | 'white', component: 'caption' | 'comment', -) => PartType[] = (style, component) => { +) => PartType[] = (theme, component) => { return [ { trigger: '@', @@ -91,17 +91,26 @@ export const mentionPartTypes: ( ), allowedSpacesCount: 0, isInsertSpaceAfterMention: true, - textStyle: - style === 'blue' - ? { - color: TAGG_LIGHT_BLUE, - top: normalize(3), - } - : { - color: 'white', - fontWeight: '800', - top: normalize(7.5), - }, + textStyle: _textStyle(theme), }, ]; }; + +const _textStyle: (theme: 'blue' | 'white') => StyleProp<TextStyle> = ( + theme, +) => { + switch (theme) { + case 'blue': + return { + color: TAGG_LIGHT_BLUE, + top: normalize(3), + }; + case 'white': + default: + return { + color: 'white', + fontWeight: '800', + top: normalize(3), + }; + } +}; |