Skip to content

Commit

Permalink
skip backers with no sponsor information
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Aug 30, 2022
1 parent 1b93319 commit dc446a2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/theme/BackerBanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ async function getBackers() {

const backersToDisplay = selectRandom(validBackers)

return backersToDisplay.map(function (backer) {
return backersToDisplay.reduce(function (results, backer) {
if (!backer.sponsor) {
return results;
}

const {
name,
openCollectiveHandle,
Expand All @@ -68,14 +72,16 @@ async function getBackers() {

let usersName = name || githubHandle || twitterHandle || openCollectiveHandle || '';

return {
results.push({
key: href,
src: avatarUrl,
alt: usersName,
title: monthlyAmount ? `Thank you ${usersName} for the $${monthlyAmount}/month!` : `Thank you ${usersName} for the support!`,
href: href,
};
});
});

return results;
}, []);
}

function Backer({ backer }) {
Expand Down

0 comments on commit dc446a2

Please sign in to comment.