Skip to content

Commit

Permalink
Consolidate individuals into one tab, clean up tab titles
Browse files Browse the repository at this point in the history
  • Loading branch information
damianstasik committed Aug 31, 2023
1 parent cb5bfe9 commit a5ef15c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/components/Supporters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,27 @@ function ToggleButton({
function groupSupportersByType(supporters) {
const groupedSupporters = {};
for (const supporter of supporters) {
if (!groupedSupporters[supporter.type]) {
groupedSupporters[supporter.type] = [];
let { type } = supporter;

switch (true) {
case type.includes("Individual"):
type = "Individuals";
break;
case type === "Company":
type = "Companies";
break;
case type === "Project":
type = "Projects";
break;
case type === "Foundation":
type = "Foundations";
break;
}

if (!groupedSupporters[type]) {
groupedSupporters[type] = [];
}
groupedSupporters[supporter.type].push(supporter);
groupedSupporters[type].push(supporter);
}
return groupedSupporters;
}
Expand Down

0 comments on commit a5ef15c

Please sign in to comment.