diff --git a/app/[hackathon]/InteractionClient.tsx b/app/[hackathon]/InteractionClient.tsx index 492c4c6..cb4669c 100644 --- a/app/[hackathon]/InteractionClient.tsx +++ b/app/[hackathon]/InteractionClient.tsx @@ -6,7 +6,6 @@ import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Avatar, AvatarFallback } from "@/components/ui/avatar" -import { Progress } from "@/components/ui/progress" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" @@ -22,23 +21,15 @@ const getImagePath = (path: string) => { import { HackathonData, getHackathonStatus, getDaysRemaining, Judge, Project } from "@/hooks/useHackathons" import { getPublicClient } from "@wagmi/core" import { config } from "@/utils/config" -import { getFactoryAddress } from "@/utils/contractAddress" -import { HACKHUB_FACTORY_ABI } from "@/utils/contractABI/HackHubFactory" import { HACKHUB_ABI } from "@/utils/contractABI/HackHub" import { formatEther } from "viem" import { Trophy, Users, - Clock, - Award, Target, Calendar, - ExternalLink, Vote, Gavel, - Code, - FileText, - Coins, Loader2, AlertCircle, RefreshCw, diff --git a/app/[hackathon]/judge/JudgeVotingClient.tsx b/app/[hackathon]/judge/JudgeVotingClient.tsx index f931fdb..564a11a 100644 --- a/app/[hackathon]/judge/JudgeVotingClient.tsx +++ b/app/[hackathon]/judge/JudgeVotingClient.tsx @@ -4,46 +4,26 @@ import { useState, useEffect } from "react" import { useSearchParams, useRouter } from "next/navigation" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" -import { Badge } from "@/components/ui/badge" -import { Avatar, AvatarFallback } from "@/components/ui/avatar" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Alert, AlertDescription } from "@/components/ui/alert" -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" -import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog" +import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog" import { HackathonData, getHackathonStatus, getDaysRemaining, Judge, Project } from "@/hooks/useHackathons" import { getPublicClient } from "@wagmi/core" import { config } from "@/utils/config" -import { getFactoryAddress } from "@/utils/contractAddress" -import { HACKHUB_FACTORY_ABI } from "@/utils/contractABI/HackHubFactory" import { HACKHUB_ABI } from "@/utils/contractABI/HackHub" import { formatEther } from "viem" import { - Trophy, - Users, - Clock, - Award, Target, - Calendar, ExternalLink, - Share2, Vote, - Gavel, Code, + ArrowLeft, + RefreshCw, + Gavel, FileText, - Coins, - CheckCircle, - XCircle, Loader2, AlertCircle, - RefreshCw, - Wifi, - WifiOff, - Plus, - Minus, - Eye, - History, - ArrowLeft } from "lucide-react" import { useChainId, useAccount, useWriteContract } from "wagmi" import { toast } from "sonner" @@ -66,8 +46,6 @@ export default function JudgeVotingClient() { const [error, setError] = useState(null) const [voting, setVoting] = useState(false) - const [isERC20Prize, setIsERC20Prize] = useState(false) - const [prizeTokenSymbol, setPrizeTokenSymbol] = useState("") const [modalOpen, setModalOpen] = useState(false) const [modalLink, setModalLink] = useState({ url: '', type: '' }) @@ -166,8 +144,6 @@ export default function JudgeVotingClient() { publicClient.readContract({ address: contractAddress, abi: HACKHUB_ABI, functionName: 'prizeToken' }) as Promise, ]) - // Set prize type - setIsERC20Prize(isERC20) // Get token symbol if it's an ERC20 prize let tokenSymbol = "" @@ -183,7 +159,6 @@ export default function JudgeVotingClient() { tokenSymbol = "TOKEN" } } - setPrizeTokenSymbol(tokenSymbol) // Fetch judges const judges: Judge[] = [] diff --git a/app/createHackathon/page.tsx b/app/createHackathon/page.tsx index 306c527..00e40c9 100644 --- a/app/createHackathon/page.tsx +++ b/app/createHackathon/page.tsx @@ -6,11 +6,9 @@ import { useAccount, useWriteContract, useWaitForTransactionReceipt, useChainId, import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' -import { Textarea } from '@/components/ui/textarea' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Avatar, AvatarFallback } from '@/components/ui/avatar' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { ArrowLeft, Plus, Trash2, Calendar, Clock, Users, Trophy, Sparkles, Info, Globe, Coins, CheckCircle, Eye, DollarSign } from 'lucide-react' import { HACKHUB_FACTORY_ABI } from '@/utils/contractABI/HackHubFactory' import { IERC20MinimalABI } from '@/utils/contractABI/Interfaces' @@ -21,7 +19,6 @@ import { convertUTCToTimestamp, timestampToContractDate, isInFuture, - getCurrentUTCTimestamp, type TimezoneMode } from '@/utils/timeUtils' diff --git a/app/explorer/page.tsx b/app/explorer/page.tsx index 5d46807..4223235 100644 --- a/app/explorer/page.tsx +++ b/app/explorer/page.tsx @@ -17,7 +17,7 @@ import { getFactoryAddress } from "@/utils/contractAddress" import { HACKHUB_FACTORY_ABI } from "@/utils/contractABI/HackHubFactory" import { HACKHUB_ABI } from "@/utils/contractABI/HackHub" import { formatEther } from "viem" -import { Search, Filter, Loader2, AlertCircle, RefreshCw, Wifi, WifiOff, Calendar, DollarSign } from "lucide-react" +import { Search, Loader2, AlertCircle, RefreshCw, Wifi, WifiOff, Calendar, DollarSign } from "lucide-react" import { Alert, AlertDescription } from "@/components/ui/alert" import { useChainId, useAccount } from "wagmi" import { Badge } from "@/components/ui/badge" @@ -38,7 +38,6 @@ const ERC20_ABI = [ export default function ExplorerPage() { const [searchTerm, setSearchTerm] = useState("") - const [selectedCategory, setSelectedCategory] = useState("All Categories") const [statusFilter, setStatusFilter] = useState("All Status") const [hackathons, setHackathons] = useState([]) @@ -567,7 +566,6 @@ export default function ExplorerPage() { - - -
+

Organizer's Events

+ +
{/* Spacer to center the title */} +
+ +
@@ -428,7 +433,7 @@ export default function OrganizerClient({ address }: OrganizerClientProps) {

🔥 Ongoing Hackathons

-
+
{sortedHackathons .filter(h => getHackathonStatus(h.startTime, h.endTime, h.concluded) === 'accepting-submissions') .map((hackathon) => { @@ -439,56 +444,70 @@ export default function OrganizerClient({ address }: OrganizerClientProps) { href={`/h?hackAddr=${hackathon.contractAddress}&chainId=${chainId}`} className="block" > -
+
{/* Gradient background overlay based on status */}
-
- {/* Left section - Name and Status */} -
-
-

- {hackathon.hackathonName} -

- - 🔥 {status.toUpperCase()} - -
-
- - {/* Center section - Block Image */} -
-
+
+ {/* Top section - Image */} +
+
Blockchain Block { + // Fallback to block.png if custom image fails to load + const target = e.target as HTMLImageElement; + target.src = getImagePath("/block.png"); + }} />
- {/* Right section - Date and Prize */} -
-
- - - {formatDate(hackathon.startTime)} - {formatDate(hackathon.endTime)} - -
-
+ {/* Title */} +

+ {hackathon.hackathonName} +

+ + {/* Status Badge */} +
+ + 🔥 {status === 'accepting-submissions' ? 'ACCEPTING SUBMISSIONS' : + status === 'judging-submissions' ? 'JUDGING SUBMISSIONS' : + status === 'upcoming' ? 'UPCOMING' : 'CONCLUDED'} + +
+ + {/* Date */} +
+ + + {formatDate(hackathon.startTime)} + +
+
+ + to {formatDate(hackathon.endTime)} + +
+ + {/* Prize - Push to bottom */} +
+
- {parseFloat(hackathon.prizePool).toFixed(2)} ETH + {parseFloat(hackathon.prizePool).toFixed(2)} ETH
@@ -506,7 +525,7 @@ export default function OrganizerClient({ address }: OrganizerClientProps) {

Upcoming & Past Hackathons

-
+
{sortedHackathons .filter(h => getHackathonStatus(h.startTime, h.endTime, h.concluded) !== 'accepting-submissions') .map((hackathon) => { @@ -517,57 +536,67 @@ export default function OrganizerClient({ address }: OrganizerClientProps) { href={`/h?hackAddr=${hackathon.contractAddress}&chainId=${chainId}`} className="block" > -
+
{/* Gradient background overlay based on status */}
-
- {/* Left section - Name and Status */} -
-
-

- {hackathon.hackathonName} -

- - {status === 'upcoming' && '⏰'} - {status === 'judging-submissions' && '⏹️'} - {status === 'concluded' && '✅'} - {status.toUpperCase()} - -
-
- - {/* Center section - Block Image */} -
-
+
+ {/* Top section - Image */} +
+
Blockchain Block { + // Fallback to block.png if custom image fails to load + const target = e.target as HTMLImageElement; + target.src = getImagePath("/block.png"); + }} />
- {/* Right section - Date and Prize */} -
-
- - - {formatDate(hackathon.startTime)} - {formatDate(hackathon.endTime)} - -
-
+ {/* Title */} +

+ {hackathon.hackathonName} +

+ + {/* Status Badge */} +
+ + {status === 'upcoming' ? 'UPCOMING' : + status === 'judging-submissions' ? 'JUDGING SUBMISSIONS' : 'CONCLUDED'} + +
+ + {/* Date */} +
+ + + {formatDate(hackathon.startTime)} + +
+
+ + to {formatDate(hackathon.endTime)} + +
+ + {/* Prize - Push to bottom */} +
+
- {parseFloat(hackathon.prizePool).toFixed(2)} ETH + {parseFloat(hackathon.prizePool).toFixed(2)} ETH
@@ -579,28 +608,6 @@ export default function OrganizerClient({ address }: OrganizerClientProps) {
)}
- - {/* No Results */} - {sortedHackathons.length === 0 && hackathons.length > 0 && ( -
-
- -
-

No hackathons found

-

- Try adjusting your search terms or status filter -

- -
- )} )} diff --git a/app/page.tsx b/app/page.tsx index dfc495e..6311a17 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -15,21 +15,12 @@ import { HACKHUB_ABI } from "@/utils/contractABI/HackHub" import { formatEther } from "viem" import { useChainId } from "wagmi" import { - Rocket, - Users, Code, - Search, Plus, - Target, Zap, - ArrowRight, - Globe, - Coins, - Calendar, DollarSign, ChevronDown } from "lucide-react" -import { formatUTCTimestamp } from '@/utils/timeUtils' // Helper function to get the correct image path for GitHub Pages const getImagePath = (path: string) => { @@ -41,8 +32,6 @@ export default function HomePage() { const [recentHackathons, setRecentHackathons] = useState([]) const [loading, setLoading] = useState(true) const [error, setError] = useState(null) - const [currentSlide, setCurrentSlide] = useState(0) - const scrollContainerRef = useRef(null) const chainId = useChainId() // Fetch recent hackathons from blockchain @@ -167,29 +156,6 @@ export default function HomePage() { // eslint-disable-next-line react-hooks/exhaustive-deps }, [chainId]) - // Handle scroll to update current slide indicator - const handleScroll = () => { - if (scrollContainerRef.current) { - const container = scrollContainerRef.current - const cardWidth = 400 // Approximate card width including gap - const scrollLeft = container.scrollLeft - const newSlide = Math.round(scrollLeft / cardWidth) - setCurrentSlide(newSlide) - } - } - - // Scroll to specific slide - const scrollToSlide = (slideIndex: number) => { - if (scrollContainerRef.current) { - const container = scrollContainerRef.current - const cardWidth = 400 // Approximate card width including gap - container.scrollTo({ - left: slideIndex * cardWidth, - behavior: 'smooth' - }) - setCurrentSlide(slideIndex) - } - } // Get status badge color and style @@ -220,7 +186,7 @@ export default function HomePage() {
{/* Main heading with enhanced styling */} -
+

Welcome to the Hub for @@ -244,7 +210,7 @@ export default function HomePage() { {/* Right side - HackHub image */}
-
+