-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: added color-input to sanity config * feat: sponsors section * fix: sponsors section description
- Loading branch information
Showing
9 changed files
with
87 additions
and
2 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
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
3 changes: 3 additions & 0 deletions
3
apps/site/src/app/(home)/sections/Sponsors/Sponsors.module.scss
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,3 @@ | ||
.title { | ||
text-shadow: 0px 0px 20px rgba(255, 255, 255, 0.75); | ||
} |
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,54 @@ | ||
/* eslint-disable @next/next/no-img-element */ | ||
import Image from "next/image"; | ||
|
||
import { getSponsors } from "./getSponsors"; | ||
import { client } from "@/lib/sanity/client"; | ||
import imageUrlBuilder from "@sanity/image-url"; | ||
import fishingBoat from "@/assets/images/fishing-boat.png"; | ||
|
||
import styles from "./Sponsors.module.scss"; | ||
|
||
const builder = imageUrlBuilder(client); | ||
|
||
export default async function Sponsors() { | ||
const sponsors = await getSponsors(); | ||
|
||
return ( | ||
<section className="container py-24 md:my-16 relative items-center flex flex-col md:p-8 w-3/4 mx-auto text-center"> | ||
<h2 | ||
className={`${styles.title} my-12 font-display sm:text-[3rem] text-[#fffce2] text-4xl text-center`} | ||
> | ||
Sponsors | ||
</h2> | ||
<p className="max-w-md mb-12"> | ||
Interested in sponsoring IrvineHacks 2024? Check out our | ||
information above to learn more about our event! For more | ||
information, please email us at{" "} | ||
<a | ||
href="mailto:[email protected]" | ||
className="hover:underline font-bold" | ||
> | ||
[email protected] | ||
</a> | ||
. | ||
</p> | ||
<div className="grid grid-cols-1 md:grid-cols-2 gap-14 items-center mb-12"> | ||
{sponsors.sponsors.map(({ _key, name, url, logo }) => ( | ||
<a | ||
key={_key} | ||
href={url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<img | ||
className="w-full" | ||
src={builder.image(logo).format("webp").url()} | ||
alt={name + " logo"} | ||
/> | ||
</a> | ||
))} | ||
</div> | ||
<Image src={fishingBoat} alt="boat" width="400" height="400" /> | ||
</section> | ||
); | ||
} |
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,21 @@ | ||
import { z } from "zod"; | ||
import { cache } from "react"; | ||
import { client } from "@/lib/sanity/client"; | ||
import { SanityDocument, SanityImageReference } from "@/lib/sanity/types"; | ||
|
||
const Sponsors = SanityDocument.extend({ | ||
sponsors: z.array( | ||
z.object({ | ||
_type: z.literal("sponsor"), | ||
_key: z.string(), | ||
name: z.string(), | ||
url: z.string().url().optional(), | ||
tier: z.union([z.literal("bronze"), z.literal("silver")]), | ||
logo: SanityImageReference, | ||
}), | ||
), | ||
}); | ||
|
||
export const getSponsors = cache(async () => { | ||
return Sponsors.parse(await client.fetch("*[_type == 'sponsors'][0]")); | ||
}); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.