diff --git a/app/[hackathon]/InteractionClient.tsx b/app/[hackathon]/InteractionClient.tsx index cec4e3d..54c2711 100644 --- a/app/[hackathon]/InteractionClient.tsx +++ b/app/[hackathon]/InteractionClient.tsx @@ -13,6 +13,12 @@ import { Label } from "@/components/ui/label" import { Alert, AlertDescription } from "@/components/ui/alert" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog" +// Helper function to get the correct image path for GitHub Pages +const getImagePath = (path: string) => { + const basePath = process.env.NODE_ENV === 'production' ? '/HackHub-WebUI' : ''; + return `${basePath}${path}`; +}; + import { HackathonData, getHackathonStatus, getDaysRemaining, Judge, Project } from "@/hooks/useHackathons" import { getPublicClient } from "@wagmi/core" import { config } from "@/utils/config" @@ -476,7 +482,7 @@ export default function InteractionClient() { {/* Background Image */}
Hackathon Background diff --git a/app/explorer/page.tsx b/app/explorer/page.tsx index 842fdc3..f8e25da 100644 --- a/app/explorer/page.tsx +++ b/app/explorer/page.tsx @@ -4,6 +4,12 @@ import { useState, useEffect } from "react" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" + +// Helper function to get the correct image path for GitHub Pages +const getImagePath = (path: string) => { + const basePath = process.env.NODE_ENV === 'production' ? '/HackHub-WebUI' : ''; + return `${basePath}${path}`; +}; import { HackathonData, getHackathonStatus } from "@/hooks/useHackathons" import { getPublicClient } from "@wagmi/core" import { config } from "@/utils/config" @@ -374,7 +380,7 @@ export default function ExplorerPage() {
Blockchain Block
Blockchain Block { + const basePath = process.env.NODE_ENV === 'production' ? '/HackHub-WebUI' : ''; + return `${basePath}${path}`; +}; import { HackathonData, getHackathonStatus } from "@/hooks/useHackathons" import { getPublicClient } from "@wagmi/core" import { config } from "@/utils/config" @@ -469,7 +475,7 @@ export default function OrganizerClient({ address }: OrganizerClientProps) {
Blockchain Block
Blockchain Block ) -} \ No newline at end of file +} \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index 529e861..e58caa3 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -30,6 +30,12 @@ import { } from "lucide-react" import { formatUTCTimestamp } from '@/utils/timeUtils' +// Helper function to get the correct image path for GitHub Pages +const getImagePath = (path: string) => { + const basePath = process.env.NODE_ENV === 'production' ? '/HackHub-WebUI' : ''; + return `${basePath}${path}`; +}; + export default function HomePage() { const [recentHackathons, setRecentHackathons] = useState([]) const [loading, setLoading] = useState(true) @@ -268,7 +274,7 @@ export default function HomePage() {
HackHub - Think, Build, Innovate @@ -288,7 +294,7 @@ export default function HomePage() {
Be Part of the Revolution diff --git a/next.config.mjs b/next.config.mjs index 3cc89bf..badd605 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,8 @@ const nextConfig = { output: 'export', distDir: 'out', + basePath: process.env.NODE_ENV === 'production' ? '/HackHub-WebUI' : '', + assetPrefix: process.env.NODE_ENV === 'production' ? '/HackHub-WebUI/' : '', images: { unoptimized: true, }