Skip to content

Commit eb8b120

Browse files
committed
feat: add upvotes display to ProductFeedItem and update votes property to votes_count
1 parent 2b71e03 commit eb8b120

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/features/feed/components/feedItems/ProductFeedItem.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { SiProducthunt } from 'react-icons/si'
2+
import { VscTriangleUp } from 'react-icons/vsc'
23
import { CardItemWithActions } from 'src/components/Elements'
34
import { useUserPreferences } from 'src/stores/preferences'
45
import { BaseItemPropsType, ProductHuntFeedItemData } from 'src/types'
@@ -23,14 +24,17 @@ export const ProductFeedItem = (props: BaseItemPropsType<ProductHuntFeedItemData
2324
{listingMode === 'compact' && (
2425
<div className="rowDetails">
2526
<span className="rowItem verticalAligned">
26-
<SiProducthunt color="#D65736" /> Product Hunt
27+
<SiProducthunt color="#D65736" /> Product Hunt
2728
</span>
2829
</div>
2930
)}
3031
{listingMode === 'normal' && (
3132
<div className="rowDetails">
3233
<span className="rowItem verticalAligned">
33-
<SiProducthunt color="#D65736" /> Product Hunt
34+
<SiProducthunt color="#D65736" /> Product Hunt
35+
</span>
36+
<span className="rowItem verticalAligned">
37+
<VscTriangleUp className="rowItemIcon" /> {item.votes_count || 0} upvotes
3438
</span>
3539
</div>
3640
)}

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export type ArticleFeedItemData = FeedItem & {
6767
export type ProductHuntFeedItemData = FeedItem & {
6868
type: 'producthunt'
6969
tagline: string
70-
votes: number
70+
votes_count: number
7171
comments: number
7272
}
7373

0 commit comments

Comments
 (0)