Added last updated time for OH
This commit is contained in:
@@ -19,7 +19,8 @@ const homepageQuery = `{
|
|||||||
name,
|
name,
|
||||||
url,
|
url,
|
||||||
"logo": logo.asset->url+"?h=100&fm=webp"
|
"logo": logo.asset->url+"?h=100&fm=webp"
|
||||||
}
|
},
|
||||||
|
"_lastUpdated": *[_type=="officeHours"] | order(_updatedAt desc)[0]._updatedAt
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
export const load = async ({ url }) => {
|
export const load = async ({ url }) => {
|
||||||
@@ -36,6 +37,7 @@ export const load = async ({ url }) => {
|
|||||||
councilPhoto: councilPhotoUrl,
|
councilPhoto: councilPhotoUrl,
|
||||||
allOHs: officeHourResp,
|
allOHs: officeHourResp,
|
||||||
sponsors: sponsorsResp,
|
sponsors: sponsorsResp,
|
||||||
canonical: url.href
|
canonical: url.href,
|
||||||
|
ohLastUpdated: homePageResp._lastUpdated ?? null
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -69,10 +69,15 @@
|
|||||||
<Section from="from-ecsess-900" to="to-ecsess-700" via="via-ecsess-650">
|
<Section from="from-ecsess-900" to="to-ecsess-700" via="via-ecsess-650">
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<h2 class="text-2xl font-bold" id="office-hours">Lounge Office Hours</h2>
|
<h2 class="text-2xl font-bold" id="office-hours">Lounge Office Hours</h2>
|
||||||
<p class="text-ecsess-200 mb-8">
|
<p class="text-ecsess-200 mb-4">
|
||||||
Come visit us in our student lounge at ENGTR 1060 to grab a coffee (free), play Mario Kart, or
|
Come visit us in our student lounge at ENGTR 1060 to grab a coffee (free), play Mario Kart, or
|
||||||
just chat about anything!
|
just chat about anything!
|
||||||
</p>
|
</p>
|
||||||
|
{#if data.ohLastUpdated}
|
||||||
|
<p class="text-ecsess-200/70 mb-0.5 text-sm italic">
|
||||||
|
Last updated: {new Date(data.ohLastUpdated).toLocaleString()}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
<OhSchedule allOhs={data.allOHs} />
|
<OhSchedule allOhs={data.allOHs} />
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
|
|||||||
Reference in New Issue
Block a user