Skip to content

Commit f47708b

Browse files
adityapawar1jjstnlee
authored andcommitted
Fix worm bug (null tags) (#81)
* Fix worm bug (null tags) * Run prettier * Update lint.yml * Run prettier on lint.yml
1 parent 383c62c commit f47708b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ name: Lint
66
#############################
77
on:
88
push:
9-
branches-ignore: [main]
10-
pull_request:
11-
branches: [main]
129

1310
###############
1411
# Set the Job #

src/components/PreviewCard/PreviewCard.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,25 @@ function PreviewCard({
5959
numberOfLines={3}
6060
style={[globalStyles.subtext, styles.storyDescription]}
6161
>
62-
"{cheerio.load(excerpt.html).text()}"
62+
"{cheerio.load(excerpt.html ?? '').text()}"
6363
</Text>
6464
</View>
6565
</View>
6666
<View style={styles.tagsContainer}>
6767
<View style={styles.tagsRow}>
68-
<View style={styles.tag}>
69-
<Text key={tags[0]} style={globalStyles.button1}>
70-
{tags[0]}
71-
</Text>
72-
</View>
68+
{(tags?.length ?? 0) > 0 && (
69+
<View style={styles.tag}>
70+
<Text key={tags[0]} style={globalStyles.button1}>
71+
{tags[0]}
72+
</Text>
73+
</View>
74+
)}
7375
</View>
7476
<View style={styles.moreTags}>
7577
<Pressable>
7678
<Text style={[globalStyles.subtext, styles.moreTagsText]}>
7779
{' '}
78-
+ {tags.length - 1} more tags
80+
+ {(tags?.length ?? 1) - 1} more tags
7981
</Text>
8082
</Pressable>
8183
</View>

src/components/PreviewCard/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const styles = StyleSheet.create({
8181
paddingTop: 4,
8282
},
8383
moreTags: {
84+
paddingVertical: 10,
8485
paddingRight: 12,
8586
alignItems: 'center',
8687
justifyContent: 'center',

0 commit comments

Comments
 (0)