Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Commit a796bdc

Browse files
authored
Merge pull request #710 from aibtcdev/staging
Staging
2 parents dd71e33 + 25711ba commit a796bdc

38 files changed

Lines changed: 1067 additions & 301 deletions

src/app/account/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function AccountPageContent() {
2424

2525
const { data: agents = [] } = useQuery({
2626
queryKey: ["agents", userId],
27-
queryFn: fetchAgents,
27+
queryFn: () => fetchAgents(userId || undefined),
2828
enabled: isAuthenticated && !!userId,
2929
});
3030

src/app/aibtc-charter/page.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { useQuery } from "@tanstack/react-query";
44
import { MissionContent } from "@/components/aidaos/MissionContent";
55
import { fetchDAOByName } from "@/services/dao.service";
66
import { Loader } from "@/components/reusables/Loader";
7+
import { singleDaoName } from "@/config/features";
78

89
export const runtime = "edge";
910

1011
export default function AIBTCCharterPage() {
1112
const { data: dao, isLoading } = useQuery({
12-
queryKey: ["dao", "AIBTC-BREW"],
13-
queryFn: () => fetchDAOByName("AIBTC-BREW"),
13+
queryKey: ["dao", singleDaoName],
14+
queryFn: () => fetchDAOByName(singleDaoName),
1415
});
1516

1617
if (isLoading) {
@@ -32,12 +33,16 @@ export default function AIBTCCharterPage() {
3233
Charter Not Found
3334
</h2>
3435
<p className="text-zinc-400">
35-
Could not find the AIBTC Brew charter information.
36+
Could not find the {singleDaoName} charter information.
3637
</p>
3738
</div>
3839
</div>
3940
);
4041
}
4142

42-
return <MissionContent description={dao.description} />;
43+
return (
44+
<div className="px-1 md:px-16">
45+
<MissionContent description={dao.description} />
46+
</div>
47+
);
4348
}

src/app/aidaos/[name]/charter/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function CharterDAOPage() {
2222
<div className="flex justify-center items-center min-h-[400px] w-full">
2323
<div className="text-center space-y-4">
2424
<Loader />
25-
<p className="text-zinc-400">Loading DAO information...</p>
25+
<p className="text-zinc-400">Loading information...</p>
2626
</div>
2727
</div>
2828
);
@@ -32,10 +32,9 @@ export default function CharterDAOPage() {
3232
return (
3333
<div className="flex justify-center items-center min-h-[400px] w-full">
3434
<div className="text-center space-y-4">
35-
<h2 className="text-2xl font-semibold text-white">DAO Not Found</h2>
35+
<h2 className="text-2xl font-semibold text-white">Not Found</h2>
3636
<p className="text-zinc-400">
37-
Could not find a DAO with the name '
38-
{decodeURIComponent(encodedName)}'
37+
Could not find '{decodeURIComponent(encodedName)}'
3938
</p>
4039
</div>
4140
</div>

src/app/aidaos/[name]/extension/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function ExtensionsPage() {
4343
if (!extensions || extensions.length === 0) {
4444
return (
4545
<div className="text-center py-12">
46-
<p className="text-zinc-400">No extensions found for this DAO.</p>
46+
<p className="text-zinc-400">No extensions found.</p>
4747
</div>
4848
);
4949
}

src/app/aidaos/[name]/holders/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function HoldersPage() {
1818
const decodedName = decodeURIComponent(encodedName);
1919
// console.log(decodedName);
2020

21-
// First, fetch the DAO by name to get its ID
21+
// First, fetch by name to get its ID
2222
const { data: dao, isLoading: isLoadingDAO } = useQuery({
2323
queryKey: ["dao", decodedName],
2424
queryFn: () => fetchDAOByName(decodedName),
@@ -63,10 +63,9 @@ export default function HoldersPage() {
6363
return (
6464
<div className="flex justify-center items-center min-h-[400px] w-full">
6565
<div className="text-center space-y-4">
66-
<h2 className="text-2xl font-semibold text-white">DAO Not Found</h2>
66+
<h2 className="text-2xl font-semibold text-white">Not Found</h2>
6767
<p className="text-zinc-400">
68-
Could not find a DAO with the name &apos;
69-
{decodeURIComponent(encodedName)}&apos;
68+
Could not find &apos;{decodeURIComponent(encodedName)}&apos;
7069
</p>
7170
</div>
7271
</div>

src/app/aidaos/[name]/layout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export async function generateMetadata({
2525

2626
if (!dao) {
2727
return {
28-
title: "DAO Not Found",
29-
description: "The requested DAO could not be found.",
28+
title: "Not Found",
29+
description: "The requested item could not be found.",
3030
};
3131
}
3232

33-
// Now fetch the token using the DAO ID
33+
// Now fetch the token using the ID
3434
// const { data: token } = await supabase
3535
// .from("tokens")
3636
// .select("image_url")
@@ -79,7 +79,7 @@ export async function generateMetadata({
7979
index: true,
8080
follow: true,
8181
},
82-
keywords: [dao.name, "DAO", "Blockchain", "Governance", "Token"],
82+
keywords: [dao.name, "Blockchain", "Governance", "Token"],
8383
};
8484
}
8585

src/app/aidaos/[name]/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ function PageContent() {
5555
return (
5656
<div className="flex justify-center items-center min-h-[400px] w-full">
5757
<div className="text-center space-y-4">
58-
<h2 className="text-2xl font-semibold text-white">DAO Not Found</h2>
58+
<h2 className="text-2xl font-semibold text-white">Not Found</h2>
5959
<p className="text-zinc-400">
60-
Could not find a DAO with the name &apos;
61-
{decodeURIComponent(encodedName)}&apos;
60+
Could not find &apos;{decodeURIComponent(encodedName)}&apos;
6261
</p>
6362
</div>
6463
</div>

src/app/application-layout.tsx

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,26 @@ export default function ApplicationLayout({
253253
<div className="flex justify-center items-center gap-6 relative z-10"></div>
254254

255255
{/* Right Section - Navigation Links, BTC Balance Dropdown & Auth Button */}
256-
<div className="flex items-center gap-6 relative z-10 justify-end">
256+
<div className="flex items-center gap-2 lg:gap-3 xl:gap-6 relative z-10 justify-end flex-nowrap">
257257
<a
258258
href="https://docs.aibtc.com/how-aibtc-works"
259-
className="text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200"
259+
className="text-xs lg:text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200 whitespace-nowrap"
260260
target="_blank"
261261
>
262262
How it works
263263
</a>
264264
<Link
265265
href="/aibtc-charter"
266-
className="text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200"
266+
className="text-xs lg:text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200 whitespace-nowrap"
267267
>
268268
AIBTC Charter
269269
</Link>
270+
<Link
271+
href="/leaderboard"
272+
className="text-xs lg:text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200 whitespace-nowrap"
273+
>
274+
Leaderboard
275+
</Link>
270276
{/* Notification Bell - commented out per requirements */}
271277
{/* {isAuthenticated && (
272278
<div className="mr-3">
@@ -346,16 +352,25 @@ export default function ApplicationLayout({
346352
{/* Sidebar Header */}
347353
<div className="flex items-center justify-between p-4 border-b border-border/20 relative z-10">
348354
<div className="flex items-center gap-3">
349-
<Image
350-
src="/logos/aibtcdev-avatar-1000px.png"
351-
alt="AIBTC"
352-
width={24}
353-
height={24}
354-
className="shadow-lg shadow-primary/20"
355-
/>
356-
<span className="text-lg font-bold text-foreground">
357-
Menu
358-
</span>
355+
<div className="flex flex-col gap-1">
356+
<Image
357+
src="/logos/aibtcdev-primary-logo-black-wide-1000px.png"
358+
alt="AIBTCDEV"
359+
width={100}
360+
height={24}
361+
className="h-6 w-auto block dark:hidden"
362+
/>
363+
<Image
364+
src="/logos/aibtcdev-primary-logo-white-wide-1000px.png"
365+
alt="AIBTCDEV"
366+
width={100}
367+
height={24}
368+
className="h-6 w-auto hidden dark:block"
369+
/>
370+
<span className="text-[10px] text-muted-foreground whitespace-nowrap">
371+
The Bitcoin Coordination Network
372+
</span>
373+
</div>
359374
</div>
360375
<Button
361376
variant="ghost"
@@ -367,12 +382,31 @@ export default function ApplicationLayout({
367382
</Button>
368383
</div>
369384

370-
{/* Navigation - Empty since items moved to dropdown */}
385+
{/* Navigation */}
371386
<nav className="flex-1 px-4 py-6 relative z-10 overflow-y-auto">
372387
<div className="space-y-3">
373-
<div className="text-center text-muted-foreground text-sm py-8">
374-
Use the dropdown menu above to navigate
375-
</div>
388+
<a
389+
href="https://docs.aibtc.com/how-aibtc-works"
390+
target="_blank"
391+
className="block px-4 py-3 text-sm font-medium text-foreground/80 hover:text-foreground hover:bg-primary/10 rounded-sm transition-colors duration-200"
392+
onClick={() => setLeftPanelOpen(false)}
393+
>
394+
How it works
395+
</a>
396+
<Link
397+
href="/aibtc-charter"
398+
className="block px-4 py-3 text-sm font-medium text-foreground/80 hover:text-foreground hover:bg-primary/10 rounded-sm transition-colors duration-200"
399+
onClick={() => setLeftPanelOpen(false)}
400+
>
401+
AIBTC Charter
402+
</Link>
403+
<Link
404+
href="/leaderboard"
405+
className="block px-4 py-3 text-sm font-medium text-foreground/80 hover:text-foreground hover:bg-primary/10 rounded-sm transition-colors duration-200"
406+
onClick={() => setLeftPanelOpen(false)}
407+
>
408+
Leaderboard
409+
</Link>
376410
</div>
377411
</nav>
378412
</div>

src/app/extensions/page.tsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"use client";
2+
3+
import { useQuery } from "@tanstack/react-query";
4+
import DAOExtensions from "@/components/aidaos/DaoExtensions";
5+
import { fetchDAOByName, fetchDAOExtensions } from "@/services/dao.service";
6+
import { Loader } from "@/components/reusables/Loader";
7+
import { singleDaoName } from "@/config/features";
8+
9+
export const runtime = "edge";
10+
11+
export default function ExtensionsPage() {
12+
const daoName = singleDaoName;
13+
14+
// Fetch DAO to get its ID
15+
const { data: dao, isLoading: loadingDao } = useQuery({
16+
queryKey: ["dao", daoName],
17+
queryFn: () => fetchDAOByName(daoName),
18+
});
19+
const daoId = dao?.id;
20+
21+
// Fetch extensions
22+
const { data: extensions, isLoading: loadingExt } = useQuery({
23+
queryKey: ["daoExtensions", daoId],
24+
queryFn: () => (daoId ? fetchDAOExtensions(daoId) : []),
25+
enabled: !!daoId,
26+
staleTime: 600000,
27+
});
28+
29+
const isLoading = loadingDao || loadingExt;
30+
31+
if (isLoading) {
32+
return (
33+
<div className="flex justify-center items-center min-h-[400px] w-full">
34+
<div className="text-center space-y-4">
35+
<Loader />
36+
<p className="text-zinc-400">Loading extensions...</p>
37+
</div>
38+
</div>
39+
);
40+
}
41+
42+
if (!extensions || extensions.length === 0) {
43+
return (
44+
<div className="text-center py-12">
45+
<p className="text-zinc-400">No extensions found.</p>
46+
</div>
47+
);
48+
}
49+
50+
return (
51+
<div className="w-full px-16">
52+
<DAOExtensions extensions={extensions} />
53+
</div>
54+
);
55+
}

src/app/holders/page.tsx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
"use client";
2+
3+
import { useQuery } from "@tanstack/react-query";
4+
import { Loader } from "@/components/reusables/Loader";
5+
import DAOHolders from "@/components/aidaos/DaoHolders";
6+
import {
7+
fetchToken,
8+
fetchHolders,
9+
fetchDAOByName,
10+
} from "@/services/dao.service";
11+
import { singleDaoName } from "@/config/features";
12+
13+
export const runtime = "edge";
14+
15+
export default function HoldersPage() {
16+
const daoName = singleDaoName;
17+
18+
// First, fetch by name to get its ID
19+
const { data: dao, isLoading: isLoadingDAO } = useQuery({
20+
queryKey: ["dao", daoName],
21+
queryFn: () => fetchDAOByName(daoName),
22+
});
23+
24+
const daoId = dao?.id;
25+
26+
// Then use the ID to fetch the token
27+
const { data: token, isLoading: isLoadingToken } = useQuery({
28+
queryKey: ["token", daoId],
29+
queryFn: () => (daoId ? fetchToken(daoId) : null),
30+
staleTime: 600000, // 10 minutes
31+
enabled: !!daoId, // Only run this query when we have the daoId
32+
});
33+
34+
// Finally fetch the holders using the DAO ID
35+
const { data: holdersData, isLoading: isLoadingHolders } = useQuery({
36+
queryKey: ["holders", daoId],
37+
queryFn: () => fetchHolders(daoId!),
38+
enabled: !!daoId,
39+
});
40+
41+
const isLoading = isLoadingDAO || isLoadingToken || isLoadingHolders;
42+
43+
if (isLoading) {
44+
return (
45+
<div className="flex justify-center items-center w-full">
46+
<div className="text-center space-y-4">
47+
<Loader />
48+
<p className="text-zinc-400">Loading holders...</p>
49+
</div>
50+
</div>
51+
);
52+
}
53+
54+
if (!dao) {
55+
return (
56+
<div className="flex justify-center items-center min-h-[400px] w-full">
57+
<div className="text-center space-y-4">
58+
<h2 className="text-2xl font-semibold text-white">Not Found</h2>
59+
<p className="text-zinc-400">Could not find {singleDaoName}</p>
60+
</div>
61+
</div>
62+
);
63+
}
64+
65+
return (
66+
<div className="w-full px-16">
67+
<DAOHolders
68+
holders={holdersData?.holders || []}
69+
tokenSymbol={token?.symbol || ""}
70+
/>
71+
</div>
72+
);
73+
}

0 commit comments

Comments
 (0)