/
FinancialContributors.tsx
68 lines (65 loc) · 1.91 KB
/
FinancialContributors.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import Link from '@docusaurus/Link';
import sponsors from '@site/data/sponsors.json';
import clsx from 'clsx';
import React from 'react';
import styles from './FinancialContributors.module.css';
function Sponsors(props: {
description: string;
showName?: boolean;
tier: string;
title: string;
}): JSX.Element {
const tierSponsors = sponsors.filter(sponsor => sponsor.tier === props.tier);
return (
<div className={styles.tierArea}>
<h3>{props.title}</h3>
<p>{props.description}</p>
<ul className={clsx(styles[`tier-${props.tier}`], styles.sponsorsTier)}>
{tierSponsors.map(sponsor => (
<li key={sponsor.id}>
<a
className={styles.sponsorLink}
href={sponsor.website ?? undefined}
title={sponsor.name}
target="_blank"
rel="noopener sponsored"
>
<img src={sponsor.image} alt={`${sponsor.name} logo`} />
{props.showName && sponsor.name}
</a>
</li>
))}
</ul>
</div>
);
}
export function FinancialContributors(): JSX.Element {
return (
<>
<p>
The TypeScript ESLint project would not be possible without the generous
support of our financial contributors.
</p>
<div className={styles.sponsorsContainer}>
<Sponsors
description="Contributors of a monthly amount of $100 or more."
showName
tier="sponsor"
title="Sponsors"
/>
<Sponsors
description="Contributors of a monthly amount of $3 or more."
tier="supporter"
title="Supporters"
/>
</div>
<Link
className={clsx('button button--info button--outline', styles.become)}
to="https://opencollective.com/typescript-eslint/contribute"
target="_blank"
>
Become a financial contributor
</Link>
</>
);
}