Skip to content

Commit f68bdde

Browse files
authored
Remove Open Collective links from Homepage (#14839)
1 parent e334898 commit f68bdde

File tree

3 files changed

+64
-44
lines changed

3 files changed

+64
-44
lines changed

website/fetchSupporters.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ const path = require('path');
1212
const {promisify} = require('util');
1313
const {gql, request} = require('graphql-request');
1414

15+
// These sponsors will be featured on the homepage.
16+
// These backers donate >100 USD per month, and are
17+
// reviewed by the Jest team to confirm they are not
18+
// donating just to juice their SEO.
19+
const FEATURED_SPONSORS = new Set([
20+
'datadog',
21+
'nx',
22+
'transloadit',
23+
'katalon_studio',
24+
'principal',
25+
'airbnb',
26+
]);
1527
const graphqlQuery = gql`
1628
{
1729
account(slug: "jest") {
@@ -41,9 +53,16 @@ request('https://api.opencollective.com/graphql/v2', graphqlQuery)
4153
.then(data => {
4254
const backers = data.account.orders.nodes;
4355

56+
const backersWithFeatured = backers.map(backer => {
57+
if (FEATURED_SPONSORS.has(backer.fromAccount.slug)) {
58+
backer.featured = true;
59+
}
60+
return backer;
61+
});
62+
4463
return writeFile(
4564
path.resolve(__dirname, 'backers.json'),
46-
JSON.stringify(backers)
65+
JSON.stringify(backersWithFeatured)
4766
);
4867
})
4968
.then(() => {

website/src/pages/index.js

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -117,36 +117,34 @@ class Contributors extends React.Component {
117117
return (
118118
<div className="opencollective">
119119
<h3>
120-
<Translate>Sponsors</Translate>
120+
<Translate>Featured Sponsors</Translate>
121121
</h3>
122-
<p>
123-
<Translate>
124-
Sponsors are those who contribute $100 or more per month to Jest
125-
</Translate>
126-
</p>
127122
<div className="opencollective-avatars">
128123
{backers
129-
.filter(b => b.tier && b.tier.slug === 'sponsor')
124+
.filter(b => b.featured)
125+
.sort((a, b) => b.totalDonations.value - a.totalDonations.value)
130126
.map(Sponsor)}
131127
</div>
132-
<h3>
133-
<Translate>Backers</Translate>
134-
</h3>
135128
<p>
136-
<Translate>
137-
Backers are those who contribute $2 or more per month to Jest
138-
</Translate>
129+
<a
130+
href="https://opencollective.com/jest#section-contributors"
131+
target="_blank"
132+
rel="nofollow noopener"
133+
>
134+
Join{' '}
135+
{backers.filter(b => b.tier && b.tier.slug === 'backer').length}+
136+
donors
137+
</a>{' '}
138+
who sponsor Jest for $3 or more per month on{' '}
139+
<a
140+
href="https://opencollective.com/jest#section-contributors"
141+
target="_blank"
142+
rel="nofollow noopener"
143+
>
144+
opencollective.com
145+
</a>
146+
.
139147
</p>
140-
<div className="opencollective-avatars">
141-
{backers
142-
.filter(
143-
b =>
144-
b.tier &&
145-
b.tier.slug === 'backer' &&
146-
!b.fromAccount.slug.includes('adult')
147-
)
148-
.map(Backer)}
149-
</div>
150148
</div>
151149
);
152150
}
@@ -285,7 +283,7 @@ class Index extends React.Component {
285283
render() {
286284
const {config: siteConfig} = this.props;
287285
const showcase = UsersJSON.users.map((user, i) => (
288-
<a href={user.infoLink} key={i}>
286+
<a className="logo-item" href={user.infoLink} key={i}>
289287
<img src={user.image} title={user.caption} alt={user.caption} />
290288
</a>
291289
));
@@ -537,16 +535,15 @@ class Index extends React.Component {
537535
background="light"
538536
className="section-container community imageAlignSide twoByGridBlock"
539537
>
540-
<div className="gridBlockV1 yellow">
538+
<div className="yellow">
541539
<div className="blockContent">
542540
<h2>
543541
<Translate>Open Collective</Translate>
544542
</h2>
545543
<MarkdownBlock>
546544
<Translate>
547-
With so many users, the core team of Jest uses an [Open
548-
Collective](https://opencollective.com/jest) for
549-
non-Facebook contributors.
545+
Jest uses Open Collective to support developers contributing
546+
to Jest.
550547
</Translate>
551548
</MarkdownBlock>
552549
<Contributors />
@@ -557,18 +554,19 @@ class Index extends React.Component {
557554
</h2>
558555
<MarkdownBlock>
559556
<Translate>
560-
A lot of people! With
561-
[93m](https://www.npmjs.com/package/jest) downloads in the
562-
last month, and used on over
563-
[8,756,000](https://github.com/jestjs/jest/network/dependents)
564-
public repos on GitHub. Jest is used extensively at these
565-
companies:
557+
A lot of people! With [300+
558+
million](https://www.npmjs.com/package/jest) downloads in
559+
the last month, and used on over
560+
[11,000,000](https://github.com/jestjs/jest/network/dependents)
561+
public repos on GitHub.
566562
</Translate>
567563
</MarkdownBlock>
568-
<div className="gridBlockV1 logos">
569-
{showcase}
570-
<p className="others">And many others</p>
571-
</div>
564+
<MarkdownBlock>
565+
<Translate>
566+
Jest is used extensively at these companies:
567+
</Translate>
568+
</MarkdownBlock>
569+
<div className="gridBlockV1 logos">{showcase}</div>
572570
</div>
573571
</div>
574572
</Container>

website/static/css/jest.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
.sponsor-avatar {
2121
display: inline-block;
22-
width: 100px;
23-
height: 100px;
22+
width: 75px;
23+
height: 75px;
2424
border-radius: 50%;
2525
border: 1px solid white;
2626
overflow: hidden;
@@ -175,10 +175,13 @@
175175
margin-left: 0;
176176
}
177177

178+
.logos .logo-item {
179+
margin: 10px;
180+
}
181+
178182
.logos img {
179-
max-height: 56px;
180-
padding: 10px;
181-
width: 56px;
183+
max-height: 75px;
184+
width: 75px;
182185
}
183186

184187
.gridBlockV1 > *:first-child {

0 commit comments

Comments
 (0)