Skip to content

Commit 59b06e1

Browse files
Merge pull request StabilityNexus#69 from khushal1512/main
feat(ui): implement core dashboard routes, navigation, and responsive token and metric card components
2 parents eb291f3 + 230490c commit 59b06e1

51 files changed

Lines changed: 7896 additions & 669 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
# misc
2424
.DS_Store
2525
*.pem
26-
26+
.vscode/
2727
# debug
2828
npm-debug.log*
2929
yarn-debug.log*
3030
yarn-error.log*
3131
.pnpm-debug.log*
32-
32+
pnpm-lock.yaml
3333
# env files (can opt-in for committing if needed)
3434
.env*
3535
!.env.example

app/(dashboard)/dashboard/page.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
"use client";
2+
3+
import React from "react";
4+
import DashboardMetrics from "@/components/dashboard/DashboardMetrics";
5+
import { TokenList } from "@/components/dashboard/TokenList";
6+
7+
const historyTokens = [
8+
{
9+
tokenId: "0x123...abc",
10+
name: "Vaccine Certificate",
11+
type: "Health",
12+
expiresIn: "3 years",
13+
actionWalletId: "0xkhushal...512",
14+
historyAction: "endorsed" as const,
15+
},
16+
{
17+
tokenId: "0x456...def",
18+
name: "University Degree",
19+
type: "Education",
20+
expiresIn: "Never",
21+
actionWalletId: "0xadmin...001",
22+
historyAction: "revoked" as const,
23+
},
24+
{
25+
tokenId: "0x789...ghi",
26+
name: "Employment Record",
27+
type: "Work",
28+
expiresIn: "10 years",
29+
actionWalletId: "0xcompany...789",
30+
historyAction: "flagged" as const,
31+
},
32+
];
33+
34+
const DashboardPage = () => {
35+
return (
36+
<div className="flex min-h-screen flex-col gap-8 bg-app-bg pb-12">
37+
<DashboardMetrics
38+
name="Khushal Agarwal"
39+
age={20}
40+
nationality="Indian"
41+
walletAddress="0x9032345320958093280943r82"
42+
endorsers={128}
43+
lastUpdated="1 Day Ago"
44+
trustScore={98}
45+
trustFlags="None"
46+
trustDescription="Your On-Chain Reputation is excellent"
47+
totalEndorsements={70}
48+
activeTokens={14}
49+
socials={3}
50+
badgesEarned="300+ Trust Received"
51+
/>
52+
53+
<div className="px-4 sm:px-6 md:pr-14 md:pl-10">
54+
<TokenList variant="history" tokens={historyTokens} />
55+
</div>
56+
</div>
57+
);
58+
};
59+
60+
export default DashboardPage;

app/(dashboard)/discover/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 React from "react";
4+
import { TokenList } from "@/components/dashboard/TokenList";
5+
6+
const discoverTokens = [
7+
{
8+
tokenId: "0xabc123",
9+
name: "Early Adopter",
10+
type: "Achievement",
11+
expiresIn: "Never",
12+
endorsements: 156,
13+
},
14+
{
15+
tokenId: "0xdef456",
16+
name: "Verified Human",
17+
type: "Identity",
18+
expiresIn: "1 year",
19+
endorsements: 89,
20+
},
21+
{
22+
tokenId: "0xghi789",
23+
name: "Alpha Tester",
24+
type: "Access",
25+
expiresIn: "6 months",
26+
endorsements: 34,
27+
},
28+
{
29+
tokenId: "0xjkl012",
30+
name: "Governance Delegate",
31+
type: "Role",
32+
expiresIn: "2 years",
33+
endorsements: 210,
34+
},
35+
{
36+
tokenId: "0xmno345",
37+
name: "Bug Bounty Hunter",
38+
type: "Skill",
39+
expiresIn: "Never",
40+
endorsements: 12,
41+
},
42+
];
43+
44+
export default function DiscoverPage() {
45+
return (
46+
<main className="flex flex-col gap-6 px-4 pt-9 pb-12 sm:px-6 md:pr-14 md:pl-10">
47+
<TokenList
48+
variant="discover"
49+
tokens={discoverTokens}
50+
onEndorse={(id) => console.log("Endorsing token:", id)}
51+
onRevoke={(id) => console.log("Revoking token:", id)}
52+
/>
53+
</main>
54+
);
55+
}

app/(dashboard)/home/page.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import React from "react";
2+
import Metrics from "@/components/dashboard/Metrics";
3+
import { TokenList } from "@/components/dashboard/TokenList";
4+
5+
// Sample token data — replace with real data from your API/contract using wagmi hooks
6+
const sampleTokens = [
7+
{
8+
tokenId: "0x1a2b3c",
9+
name: "Vaccine",
10+
type: "Oracle",
11+
expiresIn: "5 years",
12+
endorsements: 42,
13+
historyAction: "endorsed" as const,
14+
actionWalletId: "0xkhu...512",
15+
},
16+
{
17+
tokenId: "0x4d5e6f",
18+
name: "KYC Verified",
19+
type: "Identity",
20+
expiresIn: "2 years",
21+
endorsements: 18,
22+
historyAction: "flagged" as const,
23+
actionWalletId: "0xmod...999",
24+
},
25+
{
26+
tokenId: "0x7g8h9i",
27+
name: "Education",
28+
type: "Credential",
29+
expiresIn: "10 years",
30+
endorsements: 65,
31+
historyAction: "revoked" as const,
32+
actionWalletId: "0xuni...001",
33+
},
34+
{
35+
tokenId: "0xj0k1l2",
36+
name: "Employment",
37+
type: "Attestation",
38+
expiresIn: "1 year",
39+
endorsements: 12,
40+
},
41+
];
42+
43+
export default function Home() {
44+
return (
45+
<main className="flex flex-col gap-6 px-4 pt-9 pb-12 sm:px-6 md:pr-14 md:pl-10">
46+
<Metrics
47+
totalEndorsements={70}
48+
activeTokens={14}
49+
socials={3}
50+
badgesEarned="300+ Trust Received"
51+
/>
52+
53+
<TokenList variant="tokens" tokens={sampleTokens} />
54+
55+
<TokenList variant="history" tokens={sampleTokens.slice(0, 3)} />
56+
</main>
57+
);
58+
}

app/(dashboard)/layout.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from "react";
2+
import { DashboardSidebar } from "@/components/layout/SideBar";
3+
import { DashboardNavbar } from "@/components/layout/NavBar";
4+
5+
export default function DashboardLayout({
6+
children,
7+
}: {
8+
children: React.ReactNode;
9+
}) {
10+
return (
11+
<div className="flex h-screen overflow-hidden bg-dashboard-bg">
12+
{/* Sidebar */}
13+
<div className="no-scrollbar h-full">
14+
<DashboardSidebar />
15+
</div>
16+
17+
{/* Main content area (navbar + page) */}
18+
<div className="flex min-w-0 flex-1 flex-col overflow-hidden">
19+
{/* Top navbar */}
20+
<DashboardNavbar />
21+
22+
{/* Page content */}
23+
<main className="no-scrollbar flex-1 overflow-y-auto bg-app-bg">
24+
{children}
25+
</main>
26+
</div>
27+
</div>
28+
);
29+
}

app/[username]/layout.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from "react";
2+
3+
export default function PublicProfileLayout({
4+
children,
5+
}: {
6+
children: React.ReactNode;
7+
}) {
8+
return (
9+
// You can add public-facing headers or footers here later if you want
10+
<section className="min-h-screen bg-[#0a0a0a]">{children}</section>
11+
);
12+
}

app/[username]/page.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default function UsernamePage({
2+
params,
3+
}: {
4+
params: { username: string };
5+
}) {
6+
return (
7+
<main className="flex min-h-screen items-center justify-center bg-app-bg">
8+
<h1 className="font-utsaha text-2xl font-semibold text-white">
9+
@{params.username}
10+
</h1>
11+
</main>
12+
);
13+
}

app/dashboard/page.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/discover/page.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)