Skip to content

Commit 2da5ab5

Browse files
authored
Hackathon details (#350)
* fix: modify api.ts * fix: remove google auth buttom * fix: fixes responsive fixes on organization * fix: minor fixes * fix: modify create organization * fix: modify create organization * fix: fix organization permission * fix: merge into main * feat: hackathon overview page * feat: hackathon overview page * feat: implement participant overview * feat: implement participant overview * feat: implement resources tab * feat: implement the submission tab * feat: implement comment tab * fix: implement provider for hackathon * fix: implement provider for hackathon * fix: minor fixes * fix: hackathon banner * fix: hackathon banner * fix: fix organization page * fix: fix organization page * fix: use transform * fix: add tagline * fix: add tagline
1 parent 1f87b56 commit 2da5ab5

26 files changed

Lines changed: 382 additions & 89 deletions

app/(landing)/hackathons/[slug]/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function HackathonPage() {
2020

2121
const {
2222
currentHackathon,
23-
content,
23+
// content,
2424
timelineEvents,
2525
participants,
2626
submissions,
@@ -70,7 +70,6 @@ export default function HackathonPage() {
7070
if (loading) {
7171
return <LoadingScreen />;
7272
}
73-
7473
if (!currentHackathon) {
7574
return (
7675
<div className='flex min-h-screen items-center justify-center'>
@@ -91,7 +90,7 @@ export default function HackathonPage() {
9190
{/* Banner */}
9291
<HackathonBanner
9392
title={currentHackathon.title}
94-
subtitle={currentHackathon.subtitle}
93+
tagline={currentHackathon.tagline}
9594
deadline={currentHackathon.deadline}
9695
categories={currentHackathon.categories}
9796
status={currentHackathon.status}
@@ -112,7 +111,7 @@ export default function HackathonPage() {
112111
<div className='mx-auto max-w-7xl px-6 py-12 text-white'>
113112
{activeTab === 'overview' && (
114113
<HackathonOverview
115-
content={content}
114+
content={currentHackathon.description}
116115
timelineEvents={timelineEvents}
117116
prizes={prizes}
118117
/>

app/(landing)/hackathons/preview/[orgId]/[draftId]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default function DraftPreviewPage({ params }: PreviewPageProps) {
106106
const hackathon: Hackathon = {
107107
id: transformed._id,
108108
title: transformed.information.title,
109-
subtitle: transformed.participation?.about || '',
109+
tagline: transformed.participation?.about || '',
110110
description: transformed.information.description,
111111
slug: transformed.information.slug || '',
112112
imageUrl: transformed.information.banner,
@@ -378,7 +378,7 @@ export default function DraftPreviewPage({ params }: PreviewPageProps) {
378378
{/* Banner */}
379379
<HackathonBanner
380380
title={previewHackathon.title}
381-
subtitle={previewHackathon.subtitle}
381+
tagline={previewHackathon.tagline}
382382
deadline={previewHackathon.deadline}
383383
categories={previewHackathon.categories}
384384
status={previewHackathon.status}

components/FeatureFuture.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ export function FutureFeature({
2020
badgeClassName,
2121
}: FutureFeatureProps) {
2222
return (
23-
<div className={cn('relative inline-flex items-center', className)}>
24-
<div className={disabledClass}>{children}</div>
25-
23+
<div className={cn('relative w-full', className)}>
24+
{' '}
25+
{/* Changed from inline-flex to w-full */}
26+
<div className={cn('w-full', disabledClass)}>{children}</div>{' '}
27+
{/* Added w-full */}
2628
<Badge
2729
variant='secondary'
2830
className={cn(

components/auth/LoginWrapper.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ const LoginWrapper = ({ setLoadingState }: LoginWrapperProps) => {
171171
setLoadingState(true);
172172
},
173173
onSuccess: async () => {
174-
setIsLoading(false);
175-
setLoadingState(false);
176-
177-
// Wait a bit for cookies to be set by Better Auth
178-
await new Promise(resolve => setTimeout(resolve, 100));
174+
await new Promise(resolve => setTimeout(resolve, 200));
179175

180176
const session = await authClient.getSession();
181177

@@ -204,8 +200,8 @@ const LoginWrapper = ({ setLoadingState }: LoginWrapperProps) => {
204200
}
205201
}
206202

207-
// Use full page reload to ensure cookies are available in middleware
208-
// Use callbackUrl if provided, otherwise redirect to home
203+
// Keep loading state active during redirect
204+
// The page will unmount when redirecting, so no need to set false
209205
window.location.href = callbackUrl;
210206
},
211207
onError: ctx => {

components/hackathons/hackathonBanner.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { Card } from '@/components/ui/card';
44
import { Badge } from '@/components/ui/badge';
55
import { formatDate } from '@/lib/utils';
66
import { useEffect, useState } from 'react';
7-
import { sanitizeHtml } from '@/lib/utils/renderHtml';
7+
// import { sanitizeHtml } from '@/lib/utils/renderHtml';
88

99
interface HackathonBannerProps {
1010
title: string;
11-
subtitle?: string | React.ReactNode;
1211
imageUrl?: string;
12+
tagline?: string;
1313
deadline?: string;
1414
startDate?: string;
1515
endDate?: string;
@@ -61,7 +61,7 @@ function formatCountdown(time: TimeRemaining): string {
6161

6262
export function HackathonBanner({
6363
title,
64-
subtitle,
64+
tagline,
6565
imageUrl,
6666
deadline,
6767
startDate,
@@ -245,18 +245,17 @@ export function HackathonBanner({
245245
<h1 className='text-left text-3xl leading-tight font-bold text-white drop-shadow-lg md:text-4xl lg:text-5xl'>
246246
{title}
247247
</h1>
248-
{subtitle && typeof subtitle === 'string' ? (
249-
<div
250-
className='max-w-2xl text-left text-base text-gray-200 drop-shadow-md md:text-lg'
251-
dangerouslySetInnerHTML={sanitizeHtml(subtitle)}
252-
/>
248+
{tagline && typeof tagline === 'string' ? (
249+
<span className='max-w-2xl text-left text-base text-gray-200 drop-shadow-md md:text-lg'>
250+
{tagline}
251+
</span>
253252
) : (
254253
<div className='max-w-2xl text-left text-base text-gray-200 drop-shadow-md md:text-lg'>
255-
{subtitle}
254+
{tagline}
256255
</div>
257256
)}
258257

259-
{subtitle && (
258+
{tagline && (
260259
<div className='h-1 w-20 rounded-full bg-[#a7f950] md:w-24' />
261260
)}
262261
</div>

components/hackathons/overview/hackathonOverview.tsx

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client';
22
import ReactMarkdown from 'react-markdown';
3+
import remarkGfm from 'remark-gfm';
34
import { HackathonTimeline } from './hackathonTimeline';
45
import { HackathonPrizes } from './hackathonPrizes';
56

@@ -33,19 +34,8 @@ export function HackathonOverview({
3334
<div className={`w-full py-8 ${className}`}>
3435
<article className='prose prose-sm sm:prose lg:prose-lg dark:prose-invert max-w-none text-left'>
3536
<ReactMarkdown
37+
remarkPlugins={[remarkGfm]}
3638
components={{
37-
h1: ({ ...props }) => (
38-
<h1 className='mb-6 text-4xl font-bold' {...props} />
39-
),
40-
h2: ({ ...props }) => (
41-
<h2 className='mt-8 mb-4 text-3xl font-bold' {...props} />
42-
),
43-
h3: ({ ...props }) => (
44-
<h3 className='mt-6 mb-3 text-2xl font-semibold' {...props} />
45-
),
46-
p: ({ ...props }) => (
47-
<p className='mb-4 text-base leading-7' {...props} />
48-
),
4939
ul: ({ ...props }) => (
5040
<ul
5141
className='marker:text-primary mb-4 ml-4 list-inside list-disc space-y-2'
@@ -58,37 +48,34 @@ export function HackathonOverview({
5848
{...props}
5949
/>
6050
),
61-
li: ({ ...props }) => <li className='mb-1 text-base' {...props} />,
62-
blockquote: ({ ...props }) => (
63-
<blockquote
64-
className='border-primary my-4 border-l-4 pl-4 text-gray-600 italic dark:text-gray-400'
51+
52+
table: ({ ...props }) => (
53+
<table
54+
className='w-full border border-gray-400 text-sm text-white'
6555
{...props}
6656
/>
6757
),
68-
code: ({ ...props }) => (
69-
<code
70-
className='rounded bg-gray-100 px-2 py-1 font-mono text-sm dark:bg-gray-800'
58+
thead: ({ ...props }) => (
59+
<thead
60+
className='border-b border-gray-400 text-white'
7161
{...props}
7262
/>
7363
),
74-
pre: ({ ...props }) => (
75-
<pre
76-
className='mb-4 overflow-auto rounded bg-gray-100 p-4 dark:bg-gray-800'
77-
{...props}
78-
/>
64+
tbody: ({ ...props }) => (
65+
<tbody className='text-white' {...props} />
7966
),
80-
table: ({ ...props }) => (
81-
<table className='mb-4 w-full border-collapse' {...props} />
67+
tr: ({ ...props }) => (
68+
<tr className='border-b border-gray-400' {...props} />
8269
),
8370
th: ({ ...props }) => (
8471
<th
85-
className='border border-gray-300 bg-gray-100 px-4 py-2 dark:border-gray-700 dark:bg-gray-800'
72+
className='border border-gray-400 px-3 py-2 text-left font-semibold text-white'
8673
{...props}
8774
/>
8875
),
8976
td: ({ ...props }) => (
9077
<td
91-
className='border border-gray-300 px-4 py-2 dark:border-gray-700'
78+
className='border border-gray-400 px-3 py-2 text-white'
9279
{...props}
9380
/>
9481
),

components/hackathons/overview/hackathonPrizes.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
'use client';
22

3-
// interface Prize {
4-
// title: string
5-
// rank: string
6-
// prize: string
7-
// details: string[]
8-
// icon?: string
9-
// }
10-
113
interface HackathonPrizesProps {
124
title?: string;
135
totalPrizes?: string;

components/landing-page/Explore.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const tabs = [
117117
{ name: 'Featured Projects', value: 'featured-projects' },
118118
{ name: 'Ongoing Hackathons', value: 'ongoing-hackathons' },
119119
{ name: 'Open Grants', value: 'open-grants' },
120+
{ name: 'Bounties', value: 'live-grants' },
120121
];
121122

122123
export default function Explore() {

components/landing-page/Hero2.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export default function Hero2() {
118118
<div className='relative mx-auto hidden h-[500px] max-w-5xl md:block'>
119119
<div className='absolute top-12 left-0 z-10 w-72 -rotate-3 transform cursor-pointer shadow-xl transition-transform duration-300 hover:rotate-0'>
120120
<HackathonCard
121+
tagline='Build the future of boundless'
121122
organizationName='Boundless'
122123
deadlineInDays={10}
123124
categories={['Web3', 'DeFi', 'Blockchain']}
@@ -167,6 +168,7 @@ export default function Hero2() {
167168

168169
<div className='absolute bottom-0 left-1/2 z-20 w-96 -translate-x-1/2 transform cursor-pointer rounded-2xl shadow-xl transition-transform duration-300 hover:scale-105'>
169170
<HackathonCard
171+
tagline='Build the future of boundless'
170172
organizationName='Boundless'
171173
deadlineInDays={5}
172174
categories={['AI', 'Machine Learning', 'Open Source']}

components/landing-page/hackathon/HackathonCard.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ type HackathonCardProps = {
1414
organizerLogo: string;
1515
hackathonImage: string;
1616
hackathonTitle: string;
17-
hackathonDescription: string;
17+
tagline: string;
18+
hackathonDescription?: string;
1819
status: 'Published' | 'Ongoing' | 'Completed' | 'Cancelled';
1920
deadlineInDays: number;
2021
categories: string[];
@@ -45,14 +46,15 @@ function HackathonCard({
4546
organizerLogo,
4647
hackathonImage,
4748
hackathonTitle,
48-
hackathonDescription,
49+
// hackathonDescription,
4950
status,
5051
deadlineInDays,
5152
categories,
5253
location,
5354
venueType,
5455
participants,
5556
prizePool,
57+
tagline,
5658
isFullWidth = false,
5759
className,
5860
}: HackathonCardProps) {
@@ -255,9 +257,7 @@ function HackathonCard({
255257
<h2 className='line-clamp-2 text-base leading-tight font-semibold text-white sm:text-lg'>
256258
{hackathonTitle}
257259
</h2>
258-
<p className='mt-1 line-clamp-2 text-sm text-gray-400'>
259-
{hackathonDescription}
260-
</p>
260+
<p className='mt-1 line-clamp-2 text-sm text-gray-400'>{tagline}</p>
261261
</div>
262262

263263
<div className='flex flex-wrap items-center justify-between border-t border-neutral-800 px-4 pt-3 text-sm text-gray-400 sm:px-5'>

0 commit comments

Comments
 (0)