Skip to content

Commit

Permalink
Fix worm bug (null tags) (#81)
Browse files Browse the repository at this point in the history
* Fix worm bug (null tags)

* Run prettier

* Update lint.yml

* Run prettier on lint.yml
  • Loading branch information
adityapawar1 committed Apr 9, 2024
1 parent f9f6ed6 commit 40f3394
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ name: Lint
#############################
on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

###############
# Set the Job #
Expand Down
16 changes: 9 additions & 7 deletions src/components/PreviewCard/PreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,25 @@ function PreviewCard({
numberOfLines={3}
style={[globalStyles.subtext, styles.storyDescription]}
>
"{cheerio.load(excerpt.html).text()}"
"{cheerio.load(excerpt.html ?? '').text()}"
</Text>
</View>
</View>
<View style={styles.tagsContainer}>
<View style={styles.tagsRow}>
<View style={styles.tag}>
<Text key={tags[0]} style={globalStyles.button1}>
{tags[0]}
</Text>
</View>
{(tags?.length ?? 0) > 0 && (
<View style={styles.tag}>
<Text key={tags[0]} style={globalStyles.button1}>
{tags[0]}
</Text>
</View>
)}
</View>
<View style={styles.moreTags}>
<Pressable>
<Text style={[globalStyles.subtext, styles.moreTagsText]}>
{' '}
+ {tags.length - 1} more tags
+ {(tags?.length ?? 1) - 1} more tags
</Text>
</Pressable>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/components/PreviewCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const styles = StyleSheet.create({
paddingTop: 4,
},
moreTags: {
paddingVertical: 10,
paddingRight: 12,
alignItems: 'center',
justifyContent: 'center',
Expand Down

0 comments on commit 40f3394

Please sign in to comment.