1
0
mirror of synced 2025-12-21 02:46:50 -05:00
Files
docs/components/sublanding/ArticleCard.tsx
Kevin Heis 567652b0e3 Primer 18 b (#22462)
* Create migrate-colors-primer-18.js

* Update colors round 1

* upgrade primer packages

* Update index.scss

* Replace auto colors

* remove btn-primary-matte

* Turns out the class names and variables names DONT LINE UP... ugh....

* Check for allowed var colors
2021-10-28 19:17:23 +00:00

36 lines
1.1 KiB
TypeScript

import { ArticleGuide } from 'components/context/ProductSubLandingContext'
type Props = {
card: ArticleGuide
typeLabel: string
}
export const ArticleCard = ({ card, typeLabel }: Props) => {
return (
<div data-testid="article-card" className="d-flex col-12 col-md-4 pr-0 pr-md-6 pr-lg-8">
<a className="no-underline d-flex flex-column py-3 border-bottom" href={card.href}>
<h4 className="h4 color-fg-default mb-1" dangerouslySetInnerHTML={{ __html: card.title }} />
<div className="h6 text-uppercase" data-testid="article-card-type">
{typeLabel}
</div>
<p className="color-fg-muted my-3" dangerouslySetInnerHTML={{ __html: card.intro }} />
{card.topics.length > 0 && (
<div>
{card.topics.map((topic) => {
return (
<span
data-testid="article-card-topic"
key={topic}
className="IssueLabel color-bg-accent-emphasis color-fg-on-emphasis mr-1"
>
{topic}
</span>
)
})}
</div>
)}
</a>
</div>
)
}