diff --git a/components/hacker/HackerDash.tsx b/components/hacker/HackerDash.tsx index f496f818..be22ddf6 100644 --- a/components/hacker/HackerDash.tsx +++ b/components/hacker/HackerDash.tsx @@ -19,7 +19,7 @@ import useSWR from 'swr'; import TeamManager from './TeamManager'; import TeamSetup from './TeamSetup'; import { TeamProfile } from '../../types/client'; -import { ApplicationStatus, UserData, JudgingSessionData } from '../../types/database'; +import { ApplicationStatus, UserData, JudgingSessionData, HackathonSettingsData } from '../../types/database'; import styles from '../../styles/Form.module.css'; import { signOut, useSession } from 'next-auth/react'; import TextArea from 'antd/lib/input/TextArea'; @@ -52,6 +52,15 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt { revalidateOnFocus: false, revalidateOnMount: true } ); + const { data: setting } = useSWR( + '/api/hackathon-settings', + async url => { + const res = await fetch(url, { method: 'GET' }); + return (await res.json()) as HackathonSettingsData; + }, + { revalidateOnFocus: false, revalidateOnMount: true } + ); + const onFinish = async (values: any) => { setLoading(true); await fetch('/api/apply', { @@ -690,6 +699,7 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt <>
{setting?.HACKATHON_START}
{/* TODO: conditionally render hacking start and end code based on time stored in db */} {/* Hacking start code */} {/*