Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f4dcdc0
fix: modify api.ts
Benjtalkshow Oct 14, 2025
b90d4ed
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Oct 16, 2025
9ea81a5
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Oct 16, 2025
5be269f
fix: remove google auth buttom
Benjtalkshow Oct 16, 2025
490dcb2
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Oct 20, 2025
842fd48
fix: fixes responsive fixes on organization
Benjtalkshow Oct 20, 2025
596a7f8
fix: minor fixes
Benjtalkshow Nov 6, 2025
96fee24
fix: minor fixes
Benjtalkshow Nov 6, 2025
9dfb149
fix: modify create organization
Benjtalkshow Nov 7, 2025
a194d90
fix: modify create organization
Benjtalkshow Nov 7, 2025
b2ceee0
fix: fix organization permission
Benjtalkshow Nov 8, 2025
9ea97d1
fix: merge into main
Benjtalkshow Nov 8, 2025
adb4629
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 8, 2025
0c11420
fix: merge into main
Benjtalkshow Nov 8, 2025
1f5ec24
feat: hackathon overview page
Benjtalkshow Nov 11, 2025
bca1ef6
feat: hackathon overview page
Benjtalkshow Nov 11, 2025
9202b4f
feat: implement participant overview
Benjtalkshow Nov 12, 2025
096f265
feat: implement participant overview
Benjtalkshow Nov 12, 2025
b3478d0
feat: implement resources tab
Benjtalkshow Nov 12, 2025
e83a0be
feat: implement the submission tab
Benjtalkshow Nov 12, 2025
398be9b
feat: implement comment tab
Benjtalkshow Nov 12, 2025
de546b1
fix: implement provider for hackathon
Benjtalkshow Nov 14, 2025
0fd2690
fix: implement provider for hackathon
Benjtalkshow Nov 14, 2025
0d7417f
fix: minor fixes
Benjtalkshow Nov 15, 2025
4d3efee
fix: merge branch 'main' of https://github.com/Benjtalkshow/boundless…
Benjtalkshow Nov 15, 2025
83893e4
fix: hackathon banner
Benjtalkshow Nov 15, 2025
8013d62
fix: hackathon banner
Benjtalkshow Nov 15, 2025
3fb1323
fix: fix hackthon conflict
Benjtalkshow Nov 15, 2025
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
133 changes: 133 additions & 0 deletions app/(landing)/hackathons/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
'use client';

import { useState, useEffect, useMemo } from 'react';
import { useRouter, useSearchParams, useParams } from 'next/navigation';
import { useHackathonData } from '@/lib/providers/hackathonProvider';

import { HackathonBanner } from '@/components/hackathons/hackathonBanner';
import { HackathonNavTabs } from '@/components/hackathons/hackathonNavTabs';
import { HackathonOverview } from '@/components/hackathons/overview/hackathonOverview';
import { HackathonParticipants } from '@/components/hackathons/participants/hackathonParticipant';
import { HackathonResources } from '@/components/hackathons/resources/resources';
import SubmissionTab from '@/components/hackathons/submissions/submissionTab';
import { HackathonDiscussions } from '@/components/hackathons/discussion/comment';
import LoadingScreen from '@/components/landing-page/project/CreateProjectModal/LoadingScreen';

export default function HackathonPage() {
const router = useRouter();
const searchParams = useSearchParams();
const params = useParams();

const {
currentHackathon,
content,
timelineEvents,
participants,
submissions,
prizes,
loading,
setCurrentHackathon,
} = useHackathonData();

const hackathonTabs = useMemo(
() => [
{ id: 'overview', label: 'Overview' },
{ id: 'participants', label: 'Participants', badge: participants.length },
{ id: 'resources', label: 'Resources' },
{
id: 'submission',
label: 'Submissions',
badge: submissions.filter(p => p.status === 'Approved').length,
},
{ id: 'discussions', label: 'Discussions' },
],
[participants.length, submissions]
);

const hackathonId = params.slug as string;
const [activeTab, setActiveTab] = useState('overview');

useEffect(() => {
if (hackathonId) {
setCurrentHackathon(hackathonId);
}
}, [hackathonId, setCurrentHackathon]);

useEffect(() => {
const tabFromUrl = searchParams.get('tab');
if (tabFromUrl && hackathonTabs.some(tab => tab.id === tabFromUrl)) {
setActiveTab(tabFromUrl);
}
}, [searchParams, hackathonTabs]);

const handleTabChange = (tabId: string) => {
setActiveTab(tabId);
const params = new URLSearchParams(searchParams.toString());
params.set('tab', tabId);
router.push(`?${params.toString()}`, { scroll: false });
};

if (loading) {
return <LoadingScreen />;
}

if (!currentHackathon) {
return (
<div className='flex min-h-screen items-center justify-center'>
<div className='text-center'>
<h1 className='mb-4 text-2xl font-bold text-white'>
Hackathon not found
</h1>
<p className='text-gray-400'>
The hackathon you're looking for doesn't exist.
</p>
</div>
</div>
);
}

return (
<div className='mx-auto mt-10 max-w-[1440px] px-5 py-5 text-center text-4xl font-bold text-white md:px-[50px] lg:px-[100px]'>
{/* Banner */}
<HackathonBanner
title={currentHackathon.title}
subtitle={currentHackathon.subtitle}
deadline={currentHackathon.deadline}
categories={currentHackathon.categories}
status={currentHackathon.status}
participants={currentHackathon.participants}
totalPrizePool={currentHackathon.totalPrizePool}
imageUrl={currentHackathon.imageUrl}
startDate={currentHackathon.startDate} // if upcoming
/>

{/* Tabs */}
<HackathonNavTabs
tabs={hackathonTabs}
activeTab={activeTab}
onTabChange={handleTabChange}
/>

{/* Content */}
<div className='mx-auto max-w-7xl px-6 py-12 text-white'>
{activeTab === 'overview' && (
<HackathonOverview
content={content}
timelineEvents={timelineEvents}
prizes={prizes}
/>
)}

{activeTab === 'participants' && <HackathonParticipants />}

{activeTab === 'resources' && <HackathonResources />}

{activeTab === 'submission' && <SubmissionTab />}

{activeTab === 'discussions' && (
<HackathonDiscussions hackathonId={hackathonId} />
)}
</div>
</div>
);
}
22 changes: 22 additions & 0 deletions app/(landing)/hackathons/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { HackathonDataProvider } from '@/lib/providers/hackathonProvider';
import { use } from 'react';

interface HackathonLayoutProps {
children: React.ReactNode;
params: Promise<{
slug?: string;
}>;
}

export default function HackathonLayout({
children,
params,
}: HackathonLayoutProps) {
const resolvedParams = use(params);

return (
<HackathonDataProvider hackathonSlug={resolvedParams.slug}>
{children}
</HackathonDataProvider>
);
}
Loading
Loading