Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(website): filter out spam and add non-recurring donors (#4758)
* docs(website): filter out spam and add non-recurring donors * chore: updated to remove links at lower tiers, with pending data migration * chore: updated to have URLs in supporters * chore: adjusted slug for todo * chore: rename to 'Gold' Supporter * fix: mobile responsiveness for sponsors
- Loading branch information
1 parent
18a81cb
commit 8e17f56
Showing
9 changed files
with
637 additions
and
262 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
packages/website/src/components/FinancialContributors/Sponsor.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
|
||
import { SponsorData, SponsorIncludeOptions } from './types'; | ||
|
||
interface SponsorProps { | ||
className?: string; | ||
include?: SponsorIncludeOptions; | ||
sponsor: SponsorData; | ||
} | ||
|
||
export function Sponsor({ | ||
className, | ||
include = {}, | ||
sponsor, | ||
}: SponsorProps): JSX.Element { | ||
let children = <img alt={`${sponsor.name} logo`} src={sponsor.image} />; | ||
|
||
if (include.name) { | ||
children = ( | ||
<> | ||
{children} | ||
{sponsor.name.split(' - ')[0]} | ||
</> | ||
); | ||
} | ||
|
||
if (include.link) { | ||
children = ( | ||
<a | ||
className={className} | ||
href={sponsor.website ?? undefined} | ||
title={sponsor.name} | ||
target="_blank" | ||
rel="noopener sponsored" | ||
> | ||
{children} | ||
</a> | ||
); | ||
} | ||
|
||
return children; | ||
} |
40 changes: 40 additions & 0 deletions
40
packages/website/src/components/FinancialContributors/Sponsors/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import sponsors from '@site/data/sponsors.json'; | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
|
||
import styles from './styles.module.css'; | ||
import { Sponsor } from '../Sponsor'; | ||
import { SponsorIncludeOptions } from '../types'; | ||
|
||
interface SponsorsProps { | ||
className: string; | ||
description: string; | ||
include?: SponsorIncludeOptions; | ||
expanded?: boolean; | ||
tier?: string; | ||
title: string; | ||
} | ||
|
||
export function Sponsors({ | ||
className, | ||
description, | ||
include, | ||
tier, | ||
title, | ||
}: SponsorsProps): JSX.Element { | ||
return ( | ||
<div className={clsx(styles.tierArea, className)}> | ||
<h3>{title}</h3> | ||
<p>{description}</p> | ||
<ul className={clsx(styles.sponsorsTier, styles[`tier-${tier}`])}> | ||
{sponsors | ||
.filter(sponsor => sponsor.tier === tier) | ||
.map(sponsor => ( | ||
<li key={sponsor.id}> | ||
<Sponsor include={include} sponsor={sponsor} /> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/website/src/components/FinancialContributors/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Link from '@docusaurus/Link'; | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
|
||
import styles from './styles.module.css'; | ||
import { Sponsors } from './Sponsors'; | ||
|
||
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 | ||
className={styles.tierSponsorArea} | ||
description="Donors of $750 and/or a monthly amount of $100 or more." | ||
include={{ link: true, name: true }} | ||
tier="sponsor" | ||
title="Sponsors" | ||
/> | ||
<Sponsors | ||
className={styles.tierSupporterArea} | ||
description="Donors of $150 and/or a monthly amount of $10 or more." | ||
include={{ link: true }} | ||
tier="supporter" | ||
title="Gold Supporters" | ||
/> | ||
<Sponsors | ||
className={styles.tierOtherArea} | ||
description="Donors of $50 and/or a monthly amount of $3 or more." | ||
tier="contributor" | ||
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> | ||
</> | ||
); | ||
} |
37 changes: 37 additions & 0 deletions
37
packages/website/src/components/FinancialContributors/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.sponsorLink { | ||
display: inline-flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
} | ||
|
||
.become { | ||
margin: 8px 0 24px; | ||
font-size: 1rem; | ||
} | ||
|
||
@media screen and (min-width: 1150px) { | ||
.sponsorsContainer { | ||
display: grid; | ||
grid-template-columns: 55% 45%; | ||
margin: auto; | ||
max-width: 100%; | ||
} | ||
|
||
.tierArea { | ||
margin: 16px 0; | ||
width: auto; | ||
padding: 0 60px; | ||
} | ||
|
||
.tierSponsorArea { | ||
grid-area: 1 / 1 / 3 / 2; | ||
} | ||
|
||
.tierSupporterArea { | ||
grid-area: 1 / 2 / 2 / 3; | ||
} | ||
|
||
.tierOtherArea { | ||
grid-area: 2 / 2 / 3 / 3; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/website/src/components/FinancialContributors/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export interface SponsorData { | ||
description?: string; | ||
id: string; | ||
image: string; | ||
name: string; | ||
tier?: string; | ||
totalDonations: number; | ||
website?: string; | ||
} | ||
|
||
export interface SponsorIncludeOptions { | ||
link?: boolean; | ||
name?: boolean; | ||
} |
Oops, something went wrong.