Skip to content

Commit 209a438

Browse files
feat(supporters): sort supporters and add link to profile (#8221)
* feat(supporters): sort supporters and add link to profile * chore: fix sort logic * chore: cleanup
1 parent 0aa1281 commit 209a438

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

apps/site/components/Common/Supporters/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ type SupportersListProps = {
1111

1212
const SupportersList: FC<SupportersListProps> = ({ supporters }) => (
1313
<div className="flex max-w-full flex-wrap items-center justify-center gap-1">
14-
{supporters.map(({ name, image }, i) => (
15-
<Avatar nickname={name} image={image} key={`${name}-${i}`} />
14+
{supporters.map(({ name, image, profile }, i) => (
15+
<Avatar
16+
nickname={name}
17+
image={image}
18+
key={`${name}-${i}`}
19+
url={profile}
20+
/>
1621
))}
1722
</div>
1823
);

apps/site/next-data/generators/supportersData.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ async function fetchOpenCollectiveData() {
1313

1414
const members = payload
1515
.filter(({ role, isActive }) => role === 'BACKER' && isActive)
16-
.map(({ name, website, image }) => ({
16+
.sort((a, b) => b.totalAmountDonated - a.totalAmountDonated)
17+
.map(({ name, website, image, profile }) => ({
1718
name,
1819
image,
1920
url: website,
21+
profile,
2022
source: 'opencollective',
2123
}));
2224

apps/site/types/partners.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type Supporters = {
3434
name: string;
3535
image: string;
3636
url: string;
37+
profile: string;
3738
source: 'opencollective' | 'github';
3839
};
3940

0 commit comments

Comments
 (0)