-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sponsor): only show logo on homepage
- Loading branch information
Showing
5 changed files
with
135 additions
and
137 deletions.
There are no files selected for viewing
This file contains 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 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,97 @@ | ||
import { SPONSOR_TYPES, getSponsors, type Sponsor, type SponsorType } from '@/data/sponsors'; | ||
import Image from 'next/image'; | ||
import { Fragment } from 'react'; | ||
import FancyRectangle from '../../components/FancyRectangle'; | ||
|
||
const SPONSOR_TYPE_COLORS = { | ||
gold: '#FCC018', | ||
silver: '#C3C3C3', | ||
bronze: '#E8903F', | ||
} as const satisfies Record<SponsorType, string>; | ||
function SponsorTypeTitle({ type }: { type: SponsorType }) { | ||
const color = SPONSOR_TYPE_COLORS[type]; | ||
return ( | ||
<div className="flex items-center gap-5"> | ||
<div className="text-3xl font-bold md:text-4xl"> | ||
Our{' '} | ||
<span className="capitalize" style={{ color }}> | ||
{type} | ||
</span>{' '} | ||
Sponsors | ||
</div> | ||
<div | ||
className="relative hidden h-[3px] grow md:block" | ||
style={{ backgroundColor: color }} | ||
> | ||
<div | ||
className="absolute -top-[4.5px] h-[12px] w-[12px] rotate-45" | ||
style={{ backgroundColor: color }} | ||
/> | ||
<div | ||
className="absolute -top-[4.5px] right-0 h-[12px] w-[12px] rotate-45" | ||
style={{ backgroundColor: color }} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
type SponsorCardProps = Sponsor & { reverse?: boolean }; | ||
function SponsorCard({ image, name, description, website, type, reverse }: SponsorCardProps) { | ||
return ( | ||
<div | ||
className={`flex flex-col items-stretch gap-5 ${reverse ? 'md:flex-row-reverse' : 'md:flex-row'}`} | ||
> | ||
<Image | ||
src={`/images/sponsors/${image}`} | ||
alt={`${name} Logo`} | ||
width={250} | ||
height={250} | ||
className="w-full shrink-0 bg-white object-contain p-4 md:w-[250px]" | ||
/> | ||
<FancyRectangle colour="white" offset="8" rounded> | ||
<div className="space-y-2 rounded-xl bg-white p-4 text-black md:p-6"> | ||
<div className="flex items-center gap-4"> | ||
<a | ||
className="grow rounded-lg border-[3px] border-black p-2 text-xl hover:underline md:text-2xl" | ||
href={website} | ||
> | ||
{name} | ||
</a> | ||
<Image | ||
src={`/images/sponsors/level-star/${type}.svg`} | ||
alt="Level Star" | ||
width={53} | ||
height={53} | ||
className="h-12 w-12 md:h-14 md:w-14" | ||
/> | ||
</div> | ||
<div className="text-lg md:text-xl">{description}</div> | ||
</div> | ||
</FancyRectangle> | ||
</div> | ||
); | ||
} | ||
|
||
export default function Sponsors() { | ||
let count = 0; | ||
return ( | ||
<div className="space-y-9"> | ||
{SPONSOR_TYPES.map((type) => { | ||
const sponsors = getSponsors(type); | ||
if (sponsors.length === 0) return; | ||
return ( | ||
<Fragment key={type}> | ||
<SponsorTypeTitle type={type} /> | ||
{sponsors.map((sponsor, i) => { | ||
count++; | ||
return ( | ||
<SponsorCard {...sponsor} key={i} reverse={Boolean(count % 2)} /> | ||
); | ||
})} | ||
</Fragment> | ||
); | ||
})} | ||
</div> | ||
); | ||
} |
This file contains 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 |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import Sponsors from '@/app/sponsors/Sponsors'; | ||
import Paragraph from '@/components/Paragraph'; | ||
import Sponsors from '@/components/Sponsors'; | ||
import Title from '@/components/Title'; | ||
import { YEAR, type SponsorType } from '@/data/sponsors'; | ||
import { YEAR } from '@/data/sponsors'; | ||
import Image from 'next/image'; | ||
|
||
const SPONSOR_TYPE_COLORS = { | ||
gold: '#FCC018', | ||
silver: '#C3C3C3', | ||
bronze: '#E8903F', | ||
} as const satisfies Record<SponsorType, string>; | ||
|
||
export default function SponsorsPage() { | ||
return ( | ||
<main className="flex flex-col items-center gap-10"> | ||
|
@@ -36,35 +30,7 @@ export default function SponsorsPage() { | |
possible, fostering an environment for aspiring tech enthusiastic to excel within | ||
our community. | ||
</div> | ||
<Sponsors | ||
typeTitle={(type) => { | ||
const color = SPONSOR_TYPE_COLORS[type]; | ||
return ( | ||
<div className="flex items-center gap-5"> | ||
<div className="text-3xl font-bold md:text-4xl"> | ||
Our{' '} | ||
<span className="capitalize" style={{ color }}> | ||
{type} | ||
</span>{' '} | ||
Sponsors | ||
</div> | ||
<div | ||
className="relative hidden h-[3px] grow md:block" | ||
style={{ backgroundColor: color }} | ||
> | ||
<div | ||
className="absolute -top-[4.5px] h-[12px] w-[12px] rotate-45" | ||
style={{ backgroundColor: color }} | ||
/> | ||
<div | ||
className="absolute -top-[4.5px] right-0 h-[12px] w-[12px] rotate-45" | ||
style={{ backgroundColor: color }} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}} | ||
/> | ||
<Sponsors /> | ||
<Paragraph> | ||
If you'd like to partner with us, please enquire at:{' '} | ||
<a href="mailto:[email protected]" className="underline"> | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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