Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 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
b7fc94f
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 15, 2025
0594ac8
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 15, 2025
7e08bc1
fix: fix organization page
Benjtalkshow Nov 15, 2025
22c12c1
fix: fix organization page
Benjtalkshow Nov 16, 2025
08e5be5
fix: fix organization page
Benjtalkshow Nov 16, 2025
8e6bded
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 16, 2025
5e6c9e6
fix: use transform
Benjtalkshow Nov 17, 2025
9135f2e
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 17, 2025
c2409f4
fix: add tagline
Benjtalkshow Nov 18, 2025
b08579a
fix: add tagline
Benjtalkshow Nov 18, 2025
4b8ef58
fix: fix conflict
Benjtalkshow Nov 18, 2025
0ee756e
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 19, 2025
ab0384d
fix: minor fixes
Benjtalkshow Nov 20, 2025
91b5c18
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 20, 2025
67c9fee
fix: minor fixes
Benjtalkshow Nov 21, 2025
9b2029b
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 21, 2025
1fca425
fix: fix timeline and prizes
Benjtalkshow Nov 23, 2025
3c057a0
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 23, 2025
a75f5ee
fix: correct timeline events
Benjtalkshow Nov 26, 2025
da0d27f
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Nov 26, 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
56 changes: 42 additions & 14 deletions app/(landing)/hackathons/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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 { HackathonResources } from '@/components/hackathons/resources/resources';
import SubmissionTab from '@/components/hackathons/submissions/submissionTab';
import { HackathonDiscussions } from '@/components/hackathons/discussion/comment';
// import { HackathonDiscussions } from '@/components/hackathons/discussion/comment';
import { TeamFormationTab } from '@/components/hackathons/team-formation/TeamFormationTab';
import LoadingScreen from '@/components/landing-page/project/CreateProjectModal/LoadingScreen';
import { useTimelineEvents } from '@/hooks/hackathon/use-timeline-events';
Expand All @@ -33,18 +33,29 @@ export default function HackathonPage() {
includeEndDate: false,
dateFormat: { month: 'short', day: 'numeric', year: 'numeric' },
});

const hackathonTabs = useMemo(() => {
const hasParticipants = participants.length > 0;
// const hasSubmissions = submissions.filter(p => p.status === 'Approved').length > 0;

const tabs = [
{ id: 'overview', label: 'Overview' },
{ id: 'participants', label: 'Participants', badge: participants.length },
{ id: 'resources', label: 'Resources' },
...(hasParticipants
? [
{
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' },
// { id: 'discussions', label: 'Discussions' },
];

const participantType = currentHackathon?.participation?.participantType;
Expand Down Expand Up @@ -77,7 +88,14 @@ export default function HackathonPage() {
autoCheck: !!hackathonId,
});

const isEnded = currentHackathon?.status === 'ended';
const isEnded = useMemo(() => {
if (!currentHackathon?.deadline) return false;

const deadline = new Date(currentHackathon.deadline);
const now = new Date();

return now > deadline;
}, [currentHackathon?.deadline]);

// Check if team formation is available
const isTeamHackathon =
Expand Down Expand Up @@ -180,6 +198,12 @@ export default function HackathonPage() {
hackathonSlugOrId={hackathonId}
organizationId={undefined}
onSuccess={handleRegisterSuccess}
participantType={
(currentHackathon?.participantType as
| 'team'
| 'individual'
| 'team_or_individual') ?? 'individual'
}
/>
)}

Expand All @@ -202,19 +226,23 @@ export default function HackathonPage() {
/>
)}

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

{activeTab === 'resources' && (
<HackathonResources hackathonSlugOrId={hackathonId} />
{activeTab === 'participants' && participants.length > 0 && (
<HackathonParticipants />
)}
{/* {activeTab === 'resources' && (
<HackathonResources hackathonSlugOrId={hackathonId} />
)} */}

{activeTab === 'submission' && (
<SubmissionTab hackathonSlugOrId={hackathonId} />
<SubmissionTab
hackathonSlugOrId={hackathonId}
isRegistered={isRegistered}
/>
)}

{activeTab === 'discussions' && (
{/* {activeTab === 'discussions' && (
<HackathonDiscussions hackathonId={hackathonId} />
)}
)} */}

{activeTab === 'team-formation' && (
<TeamFormationTab hackathonSlugOrId={hackathonId} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ export default function HackathonPage() {
<h1 className='text-3xl font-light tracking-tight text-white sm:text-4xl'>
{currentHackathon?.title || 'Hackathon Dashboard'}
</h1>
{currentHackathon?.information?.description && (
{/* {currentHackathon?.information?.description && (
<p className='mt-3 max-w-2xl text-sm text-gray-400'>
{currentHackathon.information.description}
</p>
)}
)} */}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion components/hackathons/HackathonsPageHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function HackathonsPageHero() {
};

const handleCreateHackathon = () => {
router.push('/hackathons/create');
router.push('/organizations');
};

return (
Expand Down
91 changes: 66 additions & 25 deletions components/hackathons/hackathonBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Button } from '@/components/ui/button';
import { formatDate } from '@/lib/utils';
import { useEffect, useState, useRef } from 'react';
import { FileText, Users, ArrowRight } from 'lucide-react';
import { useAuthStatus } from '@/hooks/use-auth';
import { useRouter } from 'next/navigation';
// import { sanitizeHtml } from '@/lib/utils/renderHtml';

interface HackathonBannerProps {
Expand Down Expand Up @@ -139,6 +141,9 @@ export function HackathonBanner({
total: 0,
});

const { isAuthenticated } = useAuthStatus();
const router = useRouter();

const getStatusColor = () => {
switch (status) {
case 'Ongoing':
Expand All @@ -157,6 +162,10 @@ export function HackathonBanner({
}
};

const handleRedirectToAuthScreen = () => {
router.push('/auth?mode=signin');
};

const getDeadlineInfo = () => {
const days = timeRemaining.days;

Expand Down Expand Up @@ -333,30 +342,59 @@ export function HackathonBanner({
)}

{/* Action Buttons */}
{!isEnded && (
<div className='mt-2 flex flex-wrap items-center gap-3'>
{!isRegistered && onJoinClick && (
<Button
onClick={onJoinClick}
className='bg-[#a7f950] font-semibold text-black hover:bg-[#8fd93f]'
>
Join Hackathon
<ArrowRight className='ml-2 h-4 w-4' />
</Button>
)}
{/* Action Buttons */}
<div className='mt-2 flex flex-wrap items-center gap-3'>
{/* Hackathon Ended → Disabled button */}
{isEnded && (
<Button
disabled
className='cursor-not-allowed bg-gray-600/50 text-gray-300 opacity-60'
>
Ended
</Button>
)}

{isRegistered && !hasSubmitted && onSubmitClick && (
<Button
onClick={onSubmitClick}
className='bg-[#a7f950] font-semibold text-black hover:bg-[#8fd93f]'
>
<FileText className='mr-2 h-4 w-4' />
Submit Project
<ArrowRight className='ml-2 h-4 w-4' />
</Button>
)}
{/* Hackathon Ongoing → Not registered → Join */}
{!isEnded && !isRegistered && onJoinClick && (
<Button
onClick={
!isAuthenticated ? handleRedirectToAuthScreen : onJoinClick
}
className='bg-[#a7f950] font-semibold text-black hover:bg-[#8fd93f]'
>
Join Hackathon
<ArrowRight className='ml-2 h-4 w-4' />
</Button>
)}

{/* Hackathon Ongoing → Registered → Leave */}
{!isEnded && isRegistered && (
<Button
onClick={onJoinClick}
variant='outline'
className='border-red-500/50 text-red-400 hover:bg-red-500/20'
>
Leave Hackathon
</Button>
)}

{/* Submit Project */}
{!isEnded && isRegistered && !hasSubmitted && onSubmitClick && (
<Button
onClick={onSubmitClick}
className='bg-[#a7f950] font-semibold text-black hover:bg-[#8fd93f]'
>
<FileText className='mr-2 h-4 w-4' />
Submit Project
<ArrowRight className='ml-2 h-4 w-4' />
</Button>
)}

{isRegistered && hasSubmitted && onViewSubmissionClick && (
{/* View Submission */}
{!isEnded &&
isRegistered &&
hasSubmitted &&
onViewSubmissionClick && (
<Button
onClick={onViewSubmissionClick}
className='bg-[#a7f950] font-semibold text-black hover:bg-[#8fd93f]'
Expand All @@ -366,7 +404,11 @@ export function HackathonBanner({
</Button>
)}

{isRegistered && isTeamFormationEnabled && onFindTeamClick && (
{/* Find Team */}
{!isEnded &&
isRegistered &&
isTeamFormationEnabled &&
onFindTeamClick && (
<Button
onClick={onFindTeamClick}
variant='outline'
Expand All @@ -376,8 +418,7 @@ export function HackathonBanner({
Find Team
</Button>
)}
</div>
)}
</div>
</div>
</div>
</div>
Expand Down
Loading
Loading