@@ -7,14 +7,16 @@ import { CardLink } from 'src/components/Elements'
77import CardItemWithActions from '../../../components/CardItemWithActions'
88import ClickableItem from '../../../components/ClickableItem'
99import { Attributes } from 'src/lib/analytics'
10- import { ArticleItemPropsType } from 'src/types'
10+ import { BaseItemPropsType , Article } from 'src/types'
11+ import { useUserPreferences } from 'src/stores/preferences'
1112
12- const ArticleItem = ( props : ArticleItemPropsType ) => {
13- const { item, index, listingMode } = props
13+ const ArticleItem = ( props : BaseItemPropsType < Article > ) => {
14+ const { item, index, analyticsTag } = props
15+ const { listingMode } = useUserPreferences ( )
1416
1517 return (
1618 < CardItemWithActions
17- source = { 'hackernews' }
19+ source = { analyticsTag }
1820 index = { index }
1921 item = { item }
2022 key = { index }
@@ -28,7 +30,7 @@ const ArticleItem = (props: ArticleItemPropsType) => {
2830 [ Attributes . TRIGERED_FROM ] : 'card' ,
2931 [ Attributes . TITLE ] : item . title ,
3032 [ Attributes . LINK ] : item . url ,
31- [ Attributes . SOURCE ] : 'hackernews' ,
33+ [ Attributes . SOURCE ] : analyticsTag ,
3234 } } >
3335 { listingMode === 'compact' && (
3436 < span className = "counterWrapper" >
@@ -56,7 +58,7 @@ const ArticleItem = (props: ArticleItemPropsType) => {
5658 [ Attributes . TRIGERED_FROM ] : 'card' ,
5759 [ Attributes . TITLE ] : `${ item . title } comments` ,
5860 [ Attributes . LINK ] : `https://news.ycombinator.com/item?id=${ item . id } ` ,
59- [ Attributes . SOURCE ] : 'hackernews' ,
61+ [ Attributes . SOURCE ] : analyticsTag ,
6062 } } >
6163 < BiCommentDetail className = "rowItemIcon" /> { item . comments } comments
6264 </ ClickableItem >
0 commit comments