Sponsors. Minor tweaks to FAQ Accordion

This commit is contained in:
Antoine Phan
2025-07-25 17:28:04 -04:00
parent 7e2b9d32aa
commit 775d13fee2
4 changed files with 42 additions and 13 deletions

View File

@@ -39,7 +39,7 @@
{#each entries as entry, index} {#each entries as entry, index}
<Accordion.Item <Accordion.Item
value={index.toString()} value={index.toString()}
classes="border-ecsess-200 mb-4 rounded-xl border-2 hover:bg-ecsess-black-hover" classes="border-ecsess-200 mb-4 rounded-xl border-2 hover:bg-ecsess-600/48 transition-all"
leadClasses="text-lg font-bold" leadClasses="text-lg font-bold"
controlClasses=" controlClasses="
flex cursor-pointer justify-between flex cursor-pointer justify-between

View File

@@ -14,7 +14,7 @@ export type EventPost = {
export type FAQ = { export type FAQ = {
question: string; question: string;
answer: string; answer: string;
} };
import type { InputValue } from '@portabletext/svelte'; import type { InputValue } from '@portabletext/svelte';
@@ -50,6 +50,12 @@ export type Resource = {
title: string; title: string;
url: string; url: string;
description: string; description: string;
} };
export type Sponsors = {
name: string;
url: string;
logo: string;
};
export type Redirect = { shortname: string; url: string }; export type Redirect = { shortname: string; url: string };

View File

@@ -1,5 +1,5 @@
import { getFromCMS } from '$lib/utils.js'; import { getFromCMS } from '$lib/utils.js';
import type { HomepageCMSResponse, OfficeHour } from '$lib/schemas'; import type { HomepageCMSResponse, OfficeHour, Sponsors } from '$lib/schemas';
const homepageQuery = `*[_type == "homepage"]{ const homepageQuery = `*[_type == "homepage"]{
"description": description[], "description": description[],
@@ -17,6 +17,12 @@ const ohQuery = `*[_type=="officeHours"]{
} }
}`; }`;
const sponsorQuery = `*[_type=="sponsors"]{
name,
url,
"logo": logo.asset->url+"?h=100&fm=webp"
}`;
export const load = async () => { export const load = async () => {
/** /**
* @description Response data type based on the `homepageQuery` above. * @description Response data type based on the `homepageQuery` above.
@@ -24,11 +30,13 @@ export const load = async () => {
*/ */
let homepageResp: HomepageCMSResponse = await getFromCMS(homepageQuery); let homepageResp: HomepageCMSResponse = await getFromCMS(homepageQuery);
let officeHourResp: OfficeHour[] = await getFromCMS(ohQuery); let officeHourResp: OfficeHour[] = await getFromCMS(ohQuery);
let sponsorsResp: Sponsors[] = await getFromCMS(sponsorQuery);
return { return {
description: homepageResp.description, description: homepageResp.description,
councilPhoto: homepageResp.councilPhoto, councilPhoto: homepageResp.councilPhoto,
faqs: homepageResp.faqs, faqs: homepageResp.faqs,
allOHs: officeHourResp allOHs: officeHourResp,
sponsors: sponsorsResp
}; };
}; };

View File

@@ -3,6 +3,7 @@
import Section from 'components/Section.svelte'; import Section from 'components/Section.svelte';
import RichText from 'components/RichText.svelte'; import RichText from 'components/RichText.svelte';
import OhSchedule from 'components/OHSchedule.svelte'; import OhSchedule from 'components/OHSchedule.svelte';
import Link from 'components/Link.svelte';
/** loading things from the server side */ /** loading things from the server side */
let { data } = $props(); let { data } = $props();
@@ -56,12 +57,26 @@
</Section> </Section>
<Section> <Section>
<div class="grid grid-cols-2 w-full max-w-[80vw] gap-24">
<div class="col-span-1"> <div class="col-span-1">
<h1>FAQ</h1> <h1>FAQs</h1>
<hr class="hr py-4 border-dashed w-full">
<FaqAccordion entries={data.faqs} /> <FaqAccordion entries={data.faqs} />
</div> </div>
<div id="sponsors"> <div id="sponsors" class="col-span-1">
<h1>Sponsors</h1> <h1>Sponsors</h1>
{'<Insert companies & brands/>'} <hr class="hr py-4 border-dashed w-full">
<div class="flex gap-12">
{#each data.sponsors as sponsor}
<div class="max-h-20">
<Link href={sponsor.url}>
<img src={sponsor.logo} alt="{sponsor.name} Logo" class="max-h-24"/>
</Link>
</div> </div>
</Section> {/each}
</div>
</div>
</div>
</Section>