forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeExampleCard.tsx
35 lines (34 loc) · 1.16 KB
/
CodeExampleCard.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { RepoIcon } from '@primer/octicons-react'
import { CodeExample } from 'components/context/ProductLandingContext'
type Props = {
example: CodeExample
}
export const CodeExampleCard = ({ example }: Props) => {
return (
<a
className="Box d-flex flex-column flex-justify-between height-full color-shadow-medium hover-shadow-large no-underline color-text-primary"
href={`https://github.com/${example.href}`}
>
<div className="p-4">
<h4>{example.title}</h4>
<p className="mt-2 mb-4 color-text-tertiary">{example.description}</p>
<div className="d-flex flex-wrap">
{example.tags.map((tag) => {
return (
<span
key={tag}
className="IssueLabel color-text-inverse color-bg-info-inverse mr-2 mb-1"
>
{tag}
</span>
)
})}
</div>
</div>
<footer className="border-top p-4 color-text-secondary d-flex flex-items-center">
<RepoIcon className="flex-shrink-0" />
<span className="ml-2 text-mono text-small color-text-link">{example.href}</span>
</footer>
</a>
)
}