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
12 changes: 6 additions & 6 deletions app/[hackathon]/InteractionClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,10 @@ export default function InteractionClient() {
switch (status) {
case 'upcoming':
return <Badge className="bg-blue-500 hover:bg-blue-600 text-white">Upcoming</Badge>
case 'active':
return <Badge className="bg-green-500 hover:bg-green-600 text-white">Active - {daysRemaining} days left</Badge>
case 'ended':
return <Badge className="bg-orange-500 hover:bg-orange-600 text-white">Submission Ended</Badge>
case 'accepting-submissions':
return <Badge className="bg-green-500 hover:bg-green-600 text-white">Accepting Submissions - {daysRemaining} days left</Badge>
case 'judging-submissions':
return <Badge className="bg-orange-500 hover:bg-orange-600 text-white">Judging Submissions</Badge>
case 'concluded':
return <Badge className="bg-gray-500 hover:bg-gray-600 text-white">Concluded</Badge>
default:
Expand Down Expand Up @@ -604,7 +604,7 @@ export default function InteractionClient() {
</div>
</div>
<div className="flex items-center gap-4">
<div className={`w-3 h-3 rounded-full ${status === 'ended' || status === 'concluded' ? 'bg-green-500' : status === 'active' ? 'bg-blue-500' : 'bg-gray-300'}`}></div>
<div className={`w-3 h-3 rounded-full ${status === 'judging-submissions' || status === 'concluded' ? 'bg-green-500' : status === 'accepting-submissions' ? 'bg-blue-500' : 'bg-gray-300'}`}></div>
<div>
<p className="font-semibold text-gray-800">Submission Deadline</p>
<p className="text-sm text-muted-foreground">
Expand Down Expand Up @@ -745,7 +745,7 @@ export default function InteractionClient() {
)}

{/* Project Submission */}
{status === 'active' && (
{status === 'accepting-submissions' && (
<Card className="border shadow-sm border-black bg-white">
<CardContent className="p-6">
<div className="text-center space-y-4">
Expand Down
320 changes: 204 additions & 116 deletions app/createHackathon/page.tsx

Large diffs are not rendered by default.

190 changes: 104 additions & 86 deletions app/explorer/page.tsx

Large diffs are not rendered by default.

27 changes: 15 additions & 12 deletions app/myHackathons/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ export default function MyHackathonsPage() {
<div className="flex items-center gap-2">
<Calendar className="w-4 h-4 text-blue-500" />
<span className="text-sm text-gray-600">
{status === 'active' ? `${getDaysRemaining(hackathon.endTime)} days left` :
{status === 'accepting-submissions' ? `${getDaysRemaining(hackathon.endTime)} days left` :
status === 'upcoming' ? 'Not started' :
status === 'ended' ? 'Ended' : 'Concluded'}
status === 'judging-submissions' ? 'Judging Submissions' : 'Concluded'}
</span>
</div>

Expand Down Expand Up @@ -610,14 +610,14 @@ export default function MyHackathonsPage() {
<div className="flex items-center gap-2">
<Calendar className="w-4 h-4 text-blue-500" />
<span className="text-sm text-gray-600">
{status === 'active' ? `${getDaysRemaining(hackathon.endTime)} days left to submit` :
{status === 'accepting-submissions' ? `${getDaysRemaining(hackathon.endTime)} days left to submit` :
status === 'upcoming' ? 'Not started' :
status === 'ended' ? 'Voting period - submissions closed' : 'Concluded'}
status === 'judging-submissions' ? 'Voting period - submissions closed' : 'Concluded'}
</span>
</div>

<div className="flex gap-2">
{status === 'ended' && userJudge.tokensRemaining > 0 && (
{status === 'judging-submissions' && userJudge.tokensRemaining > 0 && (
<Link href={`/h/judge?hackAddr=${hackathon.contractAddress}&chainId=${chainId}`}>
<Button size="sm" className="bg-[#FAE5C3] text-[#8B6914] hover:bg-[#8B6914] hover:text-white">
Vote on Projects
Expand Down Expand Up @@ -689,14 +689,14 @@ export default function MyHackathonsPage() {
<div className="flex items-center gap-2">
<Calendar className="w-4 h-4 text-blue-500" />
<span className="text-sm text-gray-600">
{status === 'active' ? `${getDaysRemaining(hackathon.endTime)} days left` :
{status === 'accepting-submissions' ? `${getDaysRemaining(hackathon.endTime)} days left` :
status === 'upcoming' ? 'Not started' :
status === 'ended' ? 'Ended' : 'Concluded'}
status === 'judging-submissions' ? 'Judging Submissions' : 'Concluded'}
</span>
</div>

<div className="flex gap-2">
{(status === 'ended' || status === 'active') && (
{(status === 'judging-submissions' || status === 'accepting-submissions') && (
<Link href={`/manage?hackAddr=${hackathon.contractAddress}&chainId=${chainId}`}>
<Button size="sm" className="bg-[#FAE5C3] text-[#8B6914] hover:bg-[#8B6914] hover:text-white">
Manage
Expand Down Expand Up @@ -855,10 +855,13 @@ export default function MyHackathonsPage() {
{activeTab === "judging" && "You haven't been assigned as a judge yet. Stay tuned for opportunities!"}
{activeTab === "organizing" && "You haven't organized any hackathons yet. Create your first event!"}
</p>
<Button className="bg-[#FAE5C3] text-[#8B6914] hover:bg-[#8B6914] hover:text-white">
{activeTab === "participating" ? "Explore Hackathons" :
activeTab === "judging" ? "Browse Opportunities" : "Create Hackathon"}
</Button>
<Link href={activeTab === "participating" ? "/explorer" :
activeTab === "judging" ? "/explorer" : "/createHackathon"}>
<Button className="bg-[#FAE5C3] text-[#8B6914] hover:bg-[#8B6914] hover:text-white">
{activeTab === "participating" ? "Explore Hackathons" :
activeTab === "judging" ? "Browse Opportunities" : "Create Hackathon"}
</Button>
</Link>
</div>
)}
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/organizer/[address]/OrganizerClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,11 @@ export default function OrganizerClient({ address }: OrganizerClientProps) {
<div className="w-full bg-white border border-amber-100 rounded-lg overflow-hidden hover:shadow-lg transition-all duration-300 cursor-pointer group relative">
{/* Gradient background overlay based on status */}
<div className={`absolute inset-0 transition-all duration-300 ${
status === 'active'
status === 'accepting-submissions'
? 'bg-gradient-to-r from-amber-50/60 via-orange-50/30 to-amber-50/60 group-hover:from-amber-100/60 group-hover:via-orange-100/30 group-hover:to-amber-100/60'
: status === 'upcoming'
? 'bg-gradient-to-r from-blue-50/60 via-indigo-50/30 to-blue-50/60 group-hover:from-blue-100/60 group-hover:via-indigo-100/30 group-hover:to-blue-100/60'
: status === 'ended'
: status === 'judging-submissions'
? 'bg-gradient-to-r from-orange-50/60 via-amber-50/30 to-orange-50/60 group-hover:from-orange-100/60 group-hover:via-amber-100/30 group-hover:to-orange-100/60'
: 'bg-gradient-to-r from-gray-50/60 via-slate-50/30 to-gray-50/60 group-hover:from-gray-100/60 group-hover:via-slate-100/30 group-hover:to-gray-100/60'
}`}></div>
Expand Down Expand Up @@ -522,7 +522,7 @@ export default function OrganizerClient({ address }: OrganizerClientProps) {
<div className={`absolute inset-0 transition-all duration-300 ${
status === 'upcoming'
? 'bg-gradient-to-r from-blue-50/60 via-indigo-50/30 to-blue-50/60 group-hover:from-blue-100/60 group-hover:via-indigo-100/30 group-hover:to-blue-100/60'
: status === 'ended'
: status === 'judging-submissions'
? 'bg-gradient-to-r from-orange-50/60 via-amber-50/30 to-orange-50/60 group-hover:from-orange-100/60 group-hover:via-amber-100/30 group-hover:to-orange-100/60'
: 'bg-gradient-to-r from-gray-50/60 via-slate-50/30 to-gray-50/60 group-hover:from-gray-100/60 group-hover:via-slate-100/30 group-hover:to-gray-100/60'
}`}></div>
Expand All @@ -536,7 +536,7 @@ export default function OrganizerClient({ address }: OrganizerClientProps) {
</h3>
<Badge className={`text-xs font-medium px-3 py-1 ${getStatusColor(status)} shadow-sm`}>
{status === 'upcoming' && '⏰'}
{status === 'ended' && '⏹️'}
{status === 'judging-submissions' && '⏹️'}
{status === 'concluded' && '✅'}
{status.toUpperCase()}
</Badge>
Expand Down
8 changes: 4 additions & 4 deletions components/hackathon-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export default function HackathonCard({ hackathon, showJoinButton = true }: Hack
switch (status) {
case 'upcoming':
return <Badge className="bg-blue-500 hover:bg-blue-600 text-white shadow-sm">Upcoming</Badge>
case 'active':
return <Badge className="bg-green-500 hover:bg-green-600 text-white shadow-sm">{daysRemaining} days left</Badge>
case 'ended':
return <Badge className="bg-orange-500 hover:bg-orange-600 text-white shadow-sm">Ended</Badge>
case 'accepting-submissions':
return <Badge className="bg-green-500 hover:bg-green-600 text-white shadow-sm">Accepting Submissions</Badge>
case 'judging-submissions':
return <Badge className="bg-orange-500 hover:bg-orange-600 text-white shadow-sm">Judging Submissions</Badge>
case 'concluded':
return <Badge className="bg-slate-500 hover:bg-slate-600 text-white shadow-sm">Concluded</Badge>
default:
Expand Down
6 changes: 3 additions & 3 deletions hooks/useHackathons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export const getDaysRemaining = (endTime: number): number => {
return Math.floor(getTimeRemaining(endTime) / 86400)
}

export const getHackathonStatus = (startTime: number, endTime: number, concluded: boolean): 'upcoming' | 'active' | 'ended' | 'concluded' => {
export const getHackathonStatus = (startTime: number, endTime: number, concluded: boolean): 'upcoming' | 'accepting-submissions' | 'judging-submissions' | 'concluded' => {
if (concluded) return 'concluded'
const now = getCurrentUTCTimestamp()
if (now < startTime) return 'upcoming'
if (now > endTime) return 'ended'
return 'active'
if (now > endTime) return 'judging-submissions'
return 'accepting-submissions'
}
125 changes: 125 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"lucide-react": "^0.454.0",
"next": "15.2.4",
"next-themes": "^0.4.4",
"pino-pretty": "^13.1.1",
"react": "^18.3.1",
"react-day-picker": "8.10.1",
"react-dom": "^18.3.1",
Expand Down