Skip to content

Commit f4497bb

Browse files
fix(web): improve special sponsor banner logic
1 parent 68161ee commit f4497bb

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

apps/web/src/components/special-sponsor-banner.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import {
88
import {
99
formatSponsorUrl,
1010
getSponsorUrl,
11-
sortSpecialSponsors,
11+
shouldShowLifetimeTotal,
1212
} from "@/lib/sponsor-utils";
1313
import { fetchSponsors } from "@/lib/sponsors";
1414

1515
export async function SpecialSponsorBanner() {
1616
const data = await fetchSponsors();
17-
const specialSponsors = sortSpecialSponsors(data.specialSponsors);
17+
const specialSponsors = data.specialSponsors;
1818

1919
if (!specialSponsors.length) {
2020
return null;
@@ -30,7 +30,7 @@ export async function SpecialSponsorBanner() {
3030
<HoverCard key={entry.githubId}>
3131
<HoverCardTrigger asChild>
3232
<a
33-
href={entry.websiteUrl || sponsorUrl}
33+
href={sponsorUrl}
3434
target="_blank"
3535
rel="noopener noreferrer"
3636
aria-label={entry.name}
@@ -74,11 +74,22 @@ export async function SpecialSponsorBanner() {
7474
<h3 className="truncate font-semibold text-sm">
7575
{entry.name}
7676
</h3>
77-
{entry.tierName ? (
77+
{shouldShowLifetimeTotal(entry) ? (
78+
<>
79+
{entry.tierName && (
80+
<p className="text-primary text-xs">
81+
{entry.tierName}
82+
</p>
83+
)}
84+
<p className="text-muted-foreground text-xs">
85+
Total: {entry.formattedAmount}
86+
</p>
87+
</>
88+
) : (
7889
<p className="text-primary text-xs">
7990
{entry.tierName}
8091
</p>
81-
) : null}
92+
)}
8293
</div>
8394
<div className="flex flex-col gap-1">
8495
<a

0 commit comments

Comments
 (0)