@@ -4,36 +4,21 @@ import dayjs from 'dayjs'
44import { Link } from 'components/Link'
55import { ArrowRightIcon } from '@primer/octicons-react'
66import { FeaturedLink } from 'components/context/ProductLandingContext'
7- import { TruncateLines } from 'components/TruncateLines'
7+ import { TruncateLines } from 'components/ui/ TruncateLines'
88import { BumpLink } from 'components/ui/BumpLink'
99
10- type Props = {
10+ export type ArticleListPropsT = {
1111 title ?: string
1212 viewAllHref ?: string
1313 articles : Array < FeaturedLink >
14- variant ?: 'compact' | 'spaced'
15- titleVariant ?: 'large' | 'default'
1614}
17- export const ArticleList = ( {
18- title,
19- viewAllHref,
20- articles,
21- variant = 'compact' ,
22- titleVariant = 'default' ,
23- } : Props ) => {
15+
16+ export const ArticleList = ( { title, viewAllHref, articles } : ArticleListPropsT ) => {
2417 return (
2518 < >
2619 { title && (
2720 < div className = "mb-4 d-flex flex-items-baseline" >
28- < h3
29- className = { cx (
30- titleVariant === 'large'
31- ? 'f4 font-weight-semibold'
32- : 'f5 text-normal underline-dashed color-text-secondary'
33- ) }
34- >
35- { title }
36- </ h3 >
21+ < h3 className = { cx ( 'f4 text-semibold' ) } > { title } </ h3 >
3722 { viewAllHref && (
3823 < Link href = { viewAllHref } className = "ml-4" >
3924 View all < ArrowRightIcon size = { 14 } className = "v-align-middle" />
@@ -45,7 +30,7 @@ export const ArticleList = ({
4530 < ul className = "list-style-none" data-testid = "article-list" >
4631 { articles . map ( ( link ) => {
4732 return (
48- < li key = { link . href } className = { cx ( variant === 'compact' && 'border-top' ) } >
33+ < li key = { link . href } className = { cx ( 'border-top' ) } >
4934 < BumpLink
5035 as = { Link }
5136 href = { link . href }
@@ -61,11 +46,7 @@ export const ArticleList = ({
6146 }
6247 >
6348 { ! link . hideIntro && link . intro && (
64- < TruncateLines
65- as = "p"
66- maxLines = { variant === 'spaced' ? 6 : 2 }
67- className = "color-text-secondary mb-0 mt-1"
68- >
49+ < TruncateLines as = "p" maxLines = { 2 } className = "color-text-secondary mb-0 mt-1" >
6950 < span
7051 data-testid = "link-with-intro-intro"
7152 dangerouslySetInnerHTML = { { __html : link . intro } }
0 commit comments