diff options
author | Brian Kim <brian@tagg.id> | 2021-06-15 12:28:32 +0900 |
---|---|---|
committer | Brian Kim <brian@tagg.id> | 2021-06-15 12:28:32 +0900 |
commit | db0678d647f774dcb1cd60513985d9b6fbd0e28b (patch) | |
tree | 00e62c1821d4973d214fdd47f8293749972c1925 /src/utils/comments.tsx | |
parent | a249f2d027c9cd5d7f20602cf79ec2265f60a54c (diff) | |
parent | 78f32c1400eff46d4c768b78fbaf672826c74285 (diff) |
Merge branch 'master' of https://github.com/TaggiD-Inc/Frontend
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 5c17cefe..910b44e7 100644 --- a/src/utils/comments.tsx +++ b/src/utils/comments.tsx @@ -79,8 +79,8 @@ export const renderTextWithMentions: React.FC<RenderProps> = ({ ); }; -export const mentionPartTypes: (style: 'blue' | 'white') => PartType[] = ( - style, +export const mentionPartTypes: (theme: 'blue' | 'white') => PartType[] = ( + theme, ) => { return [ { @@ -88,17 +88,26 @@ export const mentionPartTypes: (style: 'blue' | 'white') => PartType[] = ( renderSuggestions: (props) => <TaggTypeahead {...props} />, 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), + }; + } +}; |