aboutsummaryrefslogtreecommitdiff
path: root/src/components/moments/MomentCommentPreview.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-25 20:58:56 -0400
committerGitHub <noreply@github.com>2021-06-25 20:58:56 -0400
commit5480267b285812c094246bb941c6deaf83f53ff5 (patch)
tree17f2e23576c000bcc90d840d14b8abc3bb9bec24 /src/components/moments/MomentCommentPreview.tsx
parent981051448fee6197544383e535fea7a72827d41d (diff)
parentdcf45600b6e2be7820ed2d8c0f44603624f1e719 (diff)
Merge pull request #475 from IvanIFChen/tma948-video-playback
[TMA-948] Viewing Videos
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,