diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-11 17:44:24 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-11 17:44:24 -0400 |
commit | 22a58b2ad08297b6d5dd3dd241ae23a756ae7552 (patch) | |
tree | 94b459cb819600a014076f73f1d118616b27bd5e /src | |
parent | bcfbaf00f60b65ab5f8c38ff8766644a2496bed1 (diff) |
Adjust mention text padding
Diffstat (limited to 'src')
-rw-r--r-- | src/components/moments/MomentCommentPreview.tsx | 2 | ||||
-rw-r--r-- | src/components/moments/MomentPostContent.tsx | 2 | ||||
-rw-r--r-- | src/utils/comments.tsx | 22 |
3 files changed, 10 insertions, 16 deletions
diff --git a/src/components/moments/MomentCommentPreview.tsx b/src/components/moments/MomentCommentPreview.tsx index 092f8936..e53ed258 100644 --- a/src/components/moments/MomentCommentPreview.tsx +++ b/src/components/moments/MomentCommentPreview.tsx @@ -50,7 +50,7 @@ const MomentCommentPreview: React.FC<MomentCommentPreviewProps> = ({ {renderTextWithMentions({ value: commentPreview.comment, styles: styles.normalFont, - partTypes: mentionPartTypes('commentPreview'), + partTypes: mentionPartTypes('white'), onPress: (user: UserType) => navigateToProfile( state, diff --git a/src/components/moments/MomentPostContent.tsx b/src/components/moments/MomentPostContent.tsx index e43cba4f..aca2999c 100644 --- a/src/components/moments/MomentPostContent.tsx +++ b/src/components/moments/MomentPostContent.tsx @@ -112,7 +112,7 @@ const MomentPostContent: React.FC<MomentPostContentProps> = ({ renderTextWithMentions({ value: moment.caption, styles: styles.captionText, - partTypes: mentionPartTypes('momentCaption'), + partTypes: mentionPartTypes('white'), onPress: (user: UserType) => navigateToProfile( state, diff --git a/src/utils/comments.tsx b/src/utils/comments.tsx index 161ede0b..910b44e7 100644 --- a/src/utils/comments.tsx +++ b/src/utils/comments.tsx @@ -79,9 +79,9 @@ export const renderTextWithMentions: React.FC<RenderProps> = ({ ); }; -export const mentionPartTypes: ( - theme: 'blue' | 'momentCaption' | 'commentPreview', -) => PartType[] = (theme) => { +export const mentionPartTypes: (theme: 'blue' | 'white') => PartType[] = ( + theme, +) => { return [ { trigger: '@', @@ -93,27 +93,21 @@ export const mentionPartTypes: ( ]; }; -const _textStyle: ( - theme: 'blue' | 'momentCaption' | 'commentPreview', -) => StyleProp<TextStyle> = (theme) => { +const _textStyle: (theme: 'blue' | 'white') => StyleProp<TextStyle> = ( + theme, +) => { switch (theme) { case 'blue': return { color: TAGG_LIGHT_BLUE, top: normalize(3), }; - case 'commentPreview': - return { - color: 'white', - fontWeight: '800', - top: normalize(3), - }; - case 'momentCaption': + case 'white': default: return { color: 'white', fontWeight: '800', - top: normalize(4.5), + top: normalize(3), }; } }; |