aboutsummaryrefslogtreecommitdiff
path: root/src/components/moments/MomentCommentPreview.tsx
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-06-18 10:53:22 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-06-18 10:53:22 -0700
commit45b46077191c0515c250b592b9da11ae42d46f51 (patch)
tree00b0e9e864d3fe93d611397a5301f1026b9af900 /src/components/moments/MomentCommentPreview.tsx
parent5449a11f4c404e505ba4369bbdbefd73eeda0be3 (diff)
parent75b3f820d05efe419b864a1e830d97dd9741b45b (diff)
Merge branch 'image-cropper' of https://github.com/shravyaramesh/Frontend into image-cropper
Diffstat (limited to 'src/components/moments/MomentCommentPreview.tsx')
-rw-r--r--src/components/moments/MomentCommentPreview.tsx8
1 files changed, 5 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,