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 */}
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() {
@@ -288,7 +294,7 @@ export default function HomePage() {
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,
}