11import { MdAccessTime } from 'react-icons/md'
22import { CardItemWithActions , CardLink , ColoredLanguagesBadge } from 'src/components/Elements'
33import { Attributes } from 'src/lib/analytics'
4+ import { useUserPreferences } from 'src/stores/preferences'
45import { Article , BaseItemPropsType } from 'src/types'
56import { format } from 'timeago.js'
67
78const ArticleItem = ( props : BaseItemPropsType < Article > ) => {
89 const { item, selectedTag, analyticsTag } = props
10+ const { listingMode } = useUserPreferences ( )
911 return (
1012 < CardItemWithActions
1113 source = { analyticsTag }
@@ -23,17 +25,19 @@ const ArticleItem = (props: BaseItemPropsType<Article>) => {
2325 } } >
2426 < div className = "subTitle" > { item . title } </ div >
2527 </ CardLink >
26- < >
27- < p className = "rowDescription" >
28- < span className = "rowItem" >
29- < MdAccessTime className = { 'rowTitleIcon' } />
30- { format ( new Date ( item . published_at ) ) }
31- </ span >
32- </ p >
33- < p className = "rowDetails" >
34- < ColoredLanguagesBadge languages = { item . tags . slice ( 0 , 4 ) } />
35- </ p >
36- </ >
28+ { listingMode === 'normal' && (
29+ < >
30+ < p className = "rowDescription" >
31+ < span className = "rowItem" >
32+ < MdAccessTime className = { 'rowTitleIcon' } />
33+ { format ( new Date ( item . published_at ) ) }
34+ </ span >
35+ </ p >
36+ < p className = "rowDetails" >
37+ < ColoredLanguagesBadge languages = { item . tags . slice ( 0 , 4 ) } />
38+ </ p >
39+ </ >
40+ ) }
3741 </ >
3842 }
3943 />
0 commit comments