File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import { useState } from "react";
55import { FaGithub } from "react-icons/fa6" ;
66
77import {
8- formatSponsorUrl ,
98 getSponsorUrl ,
9+ getSponsorUrlLabel ,
1010 isLifetimeSpecialSponsor ,
1111 shouldShowLifetimeTotal ,
1212} from "@/lib/sponsor-utils" ;
@@ -130,7 +130,7 @@ export default function SponsorsSection({ sponsorsData }: { sponsorsData: Sponso
130130 className = "group flex items-center gap-2 text-muted-foreground text-xs transition-colors hover:text-primary"
131131 >
132132 < Globe className = "size-3" />
133- < span className = "truncate" > { formatSponsorUrl ( sponsorUrl ) } </ span >
133+ < span className = "truncate" > { getSponsorUrlLabel ( entry ) } </ span >
134134 </ a >
135135 ) }
136136 </ div >
@@ -211,7 +211,7 @@ export default function SponsorsSection({ sponsorsData }: { sponsorsData: Sponso
211211 className = "group flex items-center gap-2 text-muted-foreground text-xs transition-colors hover:text-primary"
212212 >
213213 < Globe className = "size-3" />
214- < span className = "truncate" > { formatSponsorUrl ( sponsorUrl ) } </ span >
214+ < span className = "truncate" > { getSponsorUrlLabel ( entry ) } </ span >
215215 </ a >
216216 ) }
217217 </ div >
@@ -325,7 +325,7 @@ export default function SponsorsSection({ sponsorsData }: { sponsorsData: Sponso
325325 className = "group flex items-center gap-2 text-muted-foreground/70 text-xs transition-colors hover:text-muted-foreground"
326326 >
327327 < Globe className = "size-3" />
328- < span className = "truncate" > { formatSponsorUrl ( sponsorUrl ) } </ span >
328+ < span className = "truncate" > { getSponsorUrlLabel ( entry ) } </ span >
329329 </ a >
330330 ) }
331331 </ div >
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import Image from "next/image";
55import { FaGithub } from "react-icons/fa6" ;
66
77import { HoverCard , HoverCardContent , HoverCardTrigger } from "@/components/ui/hover-card" ;
8- import { formatSponsorUrl , getSponsorUrl , shouldShowLifetimeTotal } from "@/lib/sponsor-utils" ;
8+ import { getSponsorUrl , getSponsorUrlLabel , shouldShowLifetimeTotal } from "@/lib/sponsor-utils" ;
99import type { Sponsor } from "@/lib/types" ;
1010import { cn } from "@/lib/utils" ;
1111
@@ -109,7 +109,7 @@ export function SpecialSponsorsPanel({ sponsors, compact = false }: SpecialSpons
109109 className = "group flex items-center gap-2 text-muted-foreground text-xs transition-colors hover:text-primary"
110110 >
111111 < Globe className = "h-3.5 w-3.5" />
112- < span className = "truncate" > { formatSponsorUrl ( sponsorUrl ) } </ span >
112+ < span className = "truncate" > { getSponsorUrlLabel ( entry ) } </ span >
113113 </ a >
114114 ) : null }
115115 </ div >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Image from "next/image";
33import { FaGithub } from "react-icons/fa6" ;
44
55import { HoverCard , HoverCardContent , HoverCardTrigger } from "@/components/ui/hover-card" ;
6- import { formatSponsorUrl , getSponsorUrl , shouldShowLifetimeTotal } from "@/lib/sponsor-utils" ;
6+ import { getSponsorUrl , getSponsorUrlLabel , shouldShowLifetimeTotal } from "@/lib/sponsor-utils" ;
77import { fetchSponsors } from "@/lib/sponsors" ;
88
99export async function SpecialSponsorBanner ( ) {
@@ -95,7 +95,7 @@ export async function SpecialSponsorBanner() {
9595 className = "group flex items-center gap-2 text-muted-foreground text-xs transition-colors hover:text-primary"
9696 >
9797 < Globe className = "h-4 w-4" />
98- < span className = "truncate" > { formatSponsorUrl ( sponsorUrl ) } </ span >
98+ < span className = "truncate" > { getSponsorUrlLabel ( entry ) } </ span >
9999 </ a >
100100 ) : null }
101101 </ div >
Original file line number Diff line number Diff line change @@ -31,3 +31,11 @@ export const getSponsorUrl = (sponsor: Sponsor): string => {
3131export const formatSponsorUrl = ( url : string ) : string => {
3232 return url ?. replace ( / ^ h t t p s ? : \/ \/ / , "" ) ?. replace ( / \/ $ / , "" ) ;
3333} ;
34+
35+ // Text shown for a sponsor's website link. Uses websiteLabel when provided
36+ // (so the display can differ from the actual link, e.g. a redirect URL),
37+ // otherwise falls back to the formatted website/GitHub URL.
38+ export const getSponsorUrlLabel = ( sponsor : Sponsor ) : string => {
39+ const label = sponsor . websiteLabel ?. trim ( ) ;
40+ return label || formatSponsorUrl ( getSponsorUrl ( sponsor ) ) ;
41+ } ;
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ export type Sponsor = {
3131 githubId : string ;
3232 avatarUrl : string ;
3333 websiteUrl ?: string | null ;
34+ // Optional display text for the website link. When set, show this label
35+ // instead of the URL while still linking to websiteUrl (e.g. show
36+ // "CodeRabbit.ai" but link to a redirect URL).
37+ websiteLabel ?: string | null ;
3438 githubUrl : string ;
3539 tierName : string ;
3640 totalProcessedAmount : number ;
You can’t perform that action at this time.
0 commit comments