diff options
| author | Shravya Ramesh <shravs1208@gmail.com> | 2021-06-18 10:53:22 -0700 |
|---|---|---|
| committer | Shravya Ramesh <shravs1208@gmail.com> | 2021-06-18 10:53:22 -0700 |
| commit | 45b46077191c0515c250b592b9da11ae42d46f51 (patch) | |
| tree | 00b0e9e864d3fe93d611397a5301f1026b9af900 /src/components/moments | |
| parent | 5449a11f4c404e505ba4369bbdbefd73eeda0be3 (diff) | |
| parent | 75b3f820d05efe419b864a1e830d97dd9741b45b (diff) | |
Merge branch 'image-cropper' of https://github.com/shravyaramesh/Frontend into image-cropper
Diffstat (limited to 'src/components/moments')
| -rw-r--r-- | src/components/moments/MomentCommentPreview.tsx | 8 | ||||
| -rw-r--r-- | src/components/moments/MomentPost.tsx | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/components/moments/MomentCommentPreview.tsx b/src/components/moments/MomentCommentPreview.tsx index e53ed258..232568f1 100644 --- a/src/components/moments/MomentCommentPreview.tsx +++ b/src/components/moments/MomentCommentPreview.tsx @@ -23,7 +23,9 @@ const MomentCommentPreview: React.FC<MomentCommentPreviewProps> = ({ const navigation = useNavigation(); const state = useStore().getState(); const commentCountText = - commentsCount === 0 ? 'No Comments' : commentsCount + ' comments'; + !commentsCount || commentsCount === 0 + ? 'No Comments' + : commentsCount + ' comments'; return ( <TouchableOpacity @@ -35,7 +37,7 @@ const MomentCommentPreview: React.FC<MomentCommentPreviewProps> = ({ }) }> <Text style={styles.whiteBold}>{commentCountText}</Text> - {commentPreview !== null && ( + {commentPreview && ( <View style={styles.previewContainer}> <Image source={{ @@ -50,7 +52,7 @@ const MomentCommentPreview: React.FC<MomentCommentPreviewProps> = ({ {renderTextWithMentions({ value: commentPreview.comment, styles: styles.normalFont, - partTypes: mentionPartTypes('white'), + partTypes: mentionPartTypes('white', 'comment'), onPress: (user: UserType) => navigateToProfile( state, diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index 0f105c0d..1a0dc981 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -264,6 +264,7 @@ const MomentPost: React.FC<MomentPostProps> = ({ }, ]} resizeMode={'cover'} + ref={imageRef} /> <View style={{ |
