Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/(api)/_actions/events/getTeamMixer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use server';

import { GetEvents } from '@datalib/events/getEvent';

let cachedTeamMixer: any = null;

export async function getTeamMixerEvent() {
if (cachedTeamMixer) return cachedTeamMixer;

const res = await GetEvents({ name: 'Team Mixer' });
if (res.ok) {
cachedTeamMixer = res.body?.[0];
}
return cachedTeamMixer || null;
}
41 changes: 27 additions & 14 deletions app/(pages)/(hackers)/_components/StarterKit/TeamBuilding.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
'use client';

import { useEffect, useState } from 'react';
import Image from 'next/image';
import type Event from '@typeDefs/event';
import { getTeamMixerEvent } from '@actions/events/getTeamMixer';
import teamMixer from '@public/hackers/starter-kit/teamBuilding/teamMixer.svg';
import mascots from '@public/hackers/starter-kit/teamBuilding/mascotSquad.svg';
import { CalendarItem } from '@pages/(hackers)/_components/Schedule/CalendarItem';
import { MentorCalloutCard } from '@pages/(hackers)/_components/StarterKit/Ideate/IdeateMentorCallout';

const TEAM_MIXER_EVENT: Event = {
name: 'Team Mixer',
type: 'ACTIVITIES',
location: 'ARC Ballroom A',
start_time: new Date('2026-05-09T08:30:00'),
end_time: new Date('2026-05-09T09:30:00'),
};

export default function TeamBuilding() {
const [teamMixerEvent, setTeamMixerEvent] = useState(null);
const [loading, setLoading] = useState(true);

useEffect(() => {
getTeamMixerEvent().then((event) => {
setTeamMixerEvent(event);
setLoading(false);
});
}, []);

return (
<section className="flex flex-col py-[7%] px-[4%] bg-[#FAFAFF] gap-[112px] md:gap-[144px]">
{/* Header */}
Expand All @@ -36,11 +41,19 @@ export default function TeamBuilding() {

{/* Event Card */}
<div className="mt-[40px] md:mt-[60px]">
<CalendarItem
event={TEAM_MIXER_EVENT}
attendeeCount={15}
hideAddButton
/>
{loading ? (
<p className="text-center text-gray-600 py-4">Loading event...</p>
) : teamMixerEvent ? (
<CalendarItem
event={teamMixerEvent}
attendeeCount={15}
hideAddButton
/>
) : (
<p className="text-center text-gray-600 py-4">
Team Mixer event not found
</p>
)}
</div>
</div>

Expand Down
Loading