Skip to content

Commit

Permalink
Docs: update sponsors
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Dec 13, 2024
1 parent ec5fb2e commit 51f7cde
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 28 deletions.
20 changes: 19 additions & 1 deletion apps/docs/app/(home)/sponsors/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
*/
export const organizationUsers = ['marclave', 'rishi-raj-jain', 'handotdev'];

export const sponsorTiers = [
{
type: 'golden',
label: 'Golden Sponsor',
},
{
type: 'sliver',
label: 'Sliver Sponsor',
},
];

export const sponsorData: Record<
string,
(typeof sponsorTiers)[number]['type']
> = {
hirosystems: 'sliver',
};

export const organizationSponsors = [
{
url: 'https://orama.com',
Expand Down Expand Up @@ -377,7 +395,7 @@ export const organizationSponsors = [
</svg>
),
github: 'vercel',
tier: 'golden-one-time',
tier: 'golden',
label: 'Vercel',
},
{
Expand Down
61 changes: 35 additions & 26 deletions apps/docs/app/(home)/sponsors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Image from 'next/image';
import {
organizationUsers,
organizationSponsors,
sponsorData,
sponsorTiers,
} from '@/app/(home)/sponsors/data';
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/utils/cn';
Expand Down Expand Up @@ -206,35 +208,42 @@ export default async function Page() {
</>
),
url: getSponsorHref(sponsor.login, sponsor.websiteUrl),
tier: '',
tier: sponsorData[sponsor.login] ?? '',
})),
].map((sponsor) => (
<a
key={sponsor.label}
href={sponsor.url}
rel="noreferrer noopener"
target="_blank"
className="group flex flex-col items-center justify-center rounded-xl p-3 transition-colors hover:bg-fd-primary/10"
>
<div className="inline-flex h-12 items-center gap-2 text-lg grayscale transition-all group-hover:grayscale-0">
{sponsor.logo}
</div>
{
{
golden: (
<p className="text-xs text-fd-muted-foreground">
Golden Sponsor
</p>
),
'golden-one-time': (
]
.sort((a, b) => {
const idx1 = sponsorTiers.findIndex((tier) => tier.type === a.tier);
const idx2 = sponsorTiers.findIndex((tier) => tier.type === b.tier);

return (
(idx1 === -1 ? sponsorTiers.length : idx1) -
(idx2 === -1 ? sponsorTiers.length : idx2)
);
})
.map((sponsor) => {
const tier = sponsorTiers.find(
(tier) => tier.type === sponsor.tier,
);

return (
<a
key={sponsor.label}
href={sponsor.url}
rel="noreferrer noopener"
target="_blank"
className="group flex flex-col items-center justify-center rounded-xl p-3 transition-colors hover:bg-fd-primary/10"
>
<div className="inline-flex h-12 items-center gap-2 text-lg grayscale transition-all group-hover:grayscale-0">
{sponsor.logo}
</div>
{tier ? (
<p className="text-xs text-fd-muted-foreground">
Golden Sponsor
{tier.label}
</p>
),
}[sponsor.tier ?? '']
}
</a>
))}
) : null}
</a>
);
})}
</div>

<h2 className="mt-12 font-mono text-xs">Individual Sponsors</h2>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

0 comments on commit 51f7cde

Please sign in to comment.