-
-
Notifications
You must be signed in to change notification settings - Fork 43
feat(web): add sponsors to landing page #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| export interface Sponsor { | ||
| name: string; | ||
| href: string; | ||
| image: string; | ||
| imageAlt: string; | ||
| amount: string; | ||
| kind: "company" | "individual"; | ||
| hideInSingleColumn?: boolean; | ||
| } | ||
|
|
||
| export const sponsors: Sponsor[] = [ | ||
| { | ||
| name: "Vercel", | ||
| href: "https://vercel.com/home", | ||
| image: "/companies/vercel-mark.svg", | ||
| imageAlt: "Vercel logo", | ||
| amount: "$10,000 credits", | ||
| kind: "company", | ||
| }, | ||
| { | ||
| name: "Efferd", | ||
| href: "https://efferd.com", | ||
| image: "/companies/efferd.svg", | ||
| imageAlt: "Efferd logo", | ||
| amount: "$250 credits", | ||
| kind: "company", | ||
| }, | ||
| { | ||
| name: "MrPancakes39", | ||
| href: "https://x.com/mrpancakes39", | ||
| image: "https://pbs.twimg.com/profile_images/1991510200386207744/2Bfvjltn_200x200.jpg", | ||
| imageAlt: "MrPancakes39's X avatar", | ||
| amount: "$100", | ||
| kind: "individual", | ||
| }, | ||
| { | ||
| name: "smorimoto", | ||
| href: "https://github.com/smorimoto", | ||
| image: "https://github.com/smorimoto.png?size=160", | ||
| imageAlt: "smorimoto's GitHub avatar", | ||
| amount: "$100", | ||
| kind: "individual", | ||
| }, | ||
| { | ||
| name: "Ted Brine", | ||
| href: "https://github.com/tedbrine", | ||
| image: "https://github.com/tedbrine.png?size=160", | ||
| imageAlt: "Ted Brine's GitHub avatar", | ||
| amount: "$20", | ||
| kind: "individual", | ||
| }, | ||
| { | ||
| name: "Leo", | ||
| href: "https://github.com/leoisadev1", | ||
| image: "https://github.com/leoisadev1.png?size=160", | ||
| imageAlt: "Leo's GitHub avatar", | ||
| amount: "$20", | ||
| kind: "individual", | ||
| }, | ||
| { | ||
| name: "Lasse", | ||
| href: "https://github.com/lassejlv", | ||
| image: "https://github.com/lassejlv.png?size=160", | ||
| imageAlt: "Lasse's GitHub avatar", | ||
| amount: "$10", | ||
| kind: "individual", | ||
| }, | ||
| { | ||
| name: "Coobyk", | ||
| href: "https://github.com/Coobyk", | ||
| image: "https://github.com/Coobyk.png?size=160", | ||
| imageAlt: "Coobyk's GitHub avatar", | ||
| amount: "$5", | ||
| kind: "individual", | ||
| hideInSingleColumn: true, | ||
| }, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import { Section, SectionContent } from "@/components/layout/section"; | ||
| import { sponsors } from "@/components/sections/sponsors-content"; | ||
| import type { Sponsor } from "@/components/sections/sponsors-content"; | ||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| const sponsorLinkClassName = | ||
| "group relative min-w-0 bg-background before:pointer-events-none before:absolute before:inset-0 before:bg-foreground/[0.03] before:opacity-0 before:transition-opacity hover:before:opacity-100 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:before:opacity-100 focus-visible:outline-none"; | ||
|
|
||
| function CompanySponsorLink({ sponsor }: { sponsor: Sponsor }) { | ||
| return ( | ||
| <a | ||
| className={cn( | ||
| sponsorLinkClassName, | ||
| "flex min-h-32 flex-col items-center justify-center gap-2 px-3 py-4 text-center sm:min-h-40 sm:gap-3 sm:px-5 sm:py-6", | ||
| )} | ||
| href={sponsor.href} | ||
| rel="noopener noreferrer" | ||
| target="_blank" | ||
| > | ||
| <span className="flex size-12 shrink-0 items-center justify-center"> | ||
| <img | ||
| alt={sponsor.imageAlt} | ||
| className="size-9 dark:invert" | ||
| decoding="async" | ||
| height={36} | ||
| loading="lazy" | ||
| src={sponsor.image} | ||
| width={36} | ||
| /> | ||
| </span> | ||
| <span className="min-w-0"> | ||
| <span className="block truncate text-base font-medium">{sponsor.name}</span> | ||
| <span className="text-muted-foreground mt-0.5 block font-mono text-xs tabular-nums"> | ||
| {sponsor.amount} | ||
| </span> | ||
| </span> | ||
| </a> | ||
| ); | ||
| } | ||
|
|
||
| function IndividualSponsorLink({ sponsor }: { sponsor: Sponsor }) { | ||
| return ( | ||
| <a | ||
| className={cn( | ||
| sponsorLinkClassName, | ||
| "flex items-center gap-2.5 px-3 py-3 sm:gap-3 sm:px-5 sm:py-4", | ||
| sponsor.hideInSingleColumn && "hidden min-[360px]:flex", | ||
| )} | ||
| href={sponsor.href} | ||
| rel="noopener noreferrer" | ||
| target="_blank" | ||
| > | ||
| <img | ||
| alt={sponsor.imageAlt} | ||
| className="size-9 shrink-0 rounded-full grayscale transition-[filter] group-hover:grayscale-0 group-focus-visible:grayscale-0" | ||
| decoding="async" | ||
| height={36} | ||
| loading="lazy" | ||
| src={sponsor.image} | ||
| width={36} | ||
| /> | ||
| <span className="min-w-0"> | ||
| <span className="block truncate text-sm font-medium">{sponsor.name}</span> | ||
| <span className="text-muted-foreground mt-0.5 block font-mono text-xs tabular-nums"> | ||
| {sponsor.amount} | ||
| </span> | ||
| </span> | ||
| </a> | ||
| ); | ||
| } | ||
|
|
||
| export function SponsorsSection() { | ||
| const companySponsors = sponsors.filter((sponsor) => sponsor.kind === "company"); | ||
| const individualSponsors = sponsors.filter((sponsor) => sponsor.kind === "individual"); | ||
|
|
||
| return ( | ||
| <Section className="scroll-mt-12" id="sponsors"> | ||
| <SectionContent className="relative border-b px-5 py-5 sm:px-8 sm:py-6 lg:px-8 lg:py-6"> | ||
| <div className="max-w-lg space-y-2"> | ||
| <h2 className="text-foreground/90 text-xl font-medium tracking-tight sm:text-2xl"> | ||
| Sponsors | ||
| </h2> | ||
| </div> | ||
| </SectionContent> | ||
|
|
||
| <div className="border-b border-l border-border"> | ||
| <div className="grid grid-cols-2 gap-px bg-border"> | ||
| {companySponsors.map((sponsor) => ( | ||
| <CompanySponsorLink key={sponsor.name} sponsor={sponsor} /> | ||
| ))} | ||
| </div> | ||
| <div className="grid grid-cols-1 gap-px border-t border-border bg-border min-[360px]:grid-cols-2 lg:grid-cols-3"> | ||
| {individualSponsors.map((sponsor) => ( | ||
| <IndividualSponsorLink key={sponsor.name} sponsor={sponsor} /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </Section> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.