diff options
author | Brian Kim <brian@tagg.id> | 2021-06-15 17:15:43 +0900 |
---|---|---|
committer | Brian Kim <brian@tagg.id> | 2021-06-15 17:15:43 +0900 |
commit | 4a422e43c6a6deaeff5d8fcc692138454653e4b9 (patch) | |
tree | 2e86ab879ea35e879581eb64be955d0e5481ff80 /src/utils/comments.tsx | |
parent | c57b4959c90cec90dd0936f75a9086a4430b66b1 (diff) | |
parent | db0678d647f774dcb1cd60513985d9b6fbd0e28b (diff) |
Merge with master
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), + }; + } +}; |