Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/components/Support/Support.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,11 @@ export default class Support extends Component {
: SmallIcon
}
alt={
supporter.name || supporter.slug
? `${supporter.name || supporter.slug}'s avatar`
: 'avatar'
supporter.alt
? supporter.alt
: supporter.name || supporter.slug
? `${supporter.name || supporter.slug}'s avatar`
: 'avatar'
}
onError={this._handleImgError}
/>
Expand Down
35 changes: 25 additions & 10 deletions src/utilities/fetch-supporters.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,30 @@ const transactionsGraphqlQuery = `query transactions($dateFrom: DateTime, $limit
}
}`;

const nodeToSupporter = (node) => ({
name: node.account.name,
slug: node.account.slug,
website: node.account.website,
avatar: node.account.imageUrl,
firstDonation: node.createdAt,
totalDonations: node.totalDonations.value * 100,
monthlyDonations: 0,
});
const additionalInformation = {
'gem-m': {
website: 'https://www.noneedtostudy.com/take-my-praxis-test-for-me',
avatar:
'https://webpack.js.org/assets/supporters-noneedtostudy-logo-medium.png',
alt: 'Take My Praxis Test For Me - NoNeedToStudy.com Praxis Tutors',
},
};

const nodeToSupporter = (node) => {
const { slug } = node.account;
const info = additionalInformation[slug];

return {
name: node.account.name,
website: node.account.website,
avatar: node.account.imageUrl,
...info,
slug: slug,
firstDonation: node.createdAt,
totalDonations: node.totalDonations.value * 100,
monthlyDonations: 0,
};
};

const getAllNodes = async (graphqlQuery, getNodes) => {
const body = {
Expand All @@ -113,7 +128,7 @@ const getAllNodes = async (graphqlQuery, getNodes) => {
remaining = 100;
}
// Handling pagination if necessary

while (true) {
if (remaining === 0) {
console.log(`Rate limit exceeded. Sleeping until ${new Date(reset)}.`);
Expand Down
4 changes: 4 additions & 0 deletions webpack.ssg.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export default (env) =>
from: './assets/icon-square-big.svg',
to: './assets/',
},
{
from: './assets/supporters-*.png',
to: './',
},
{
from: './assets/robots.txt',
to: './',
Expand Down
Loading