Skip to content

Commit 0071f80

Browse files
committed
User dashboard implemented with imported friends inventory and groups tables
1 parent 1f594f5 commit 0071f80

1 file changed

Lines changed: 80 additions & 7 deletions

File tree

client/src/pages/user_dashboard.tsx

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
// src/pages/organization_dashboard.tsx (Update the import path)
1+
// src/pages/user_dashboard.tsx (Update the import path)
2+
//import "";
23

34
import Head from "next/head";
5+
import Link from "next/link";
6+
7+
import UserNavbar from "../components/ui/user_navbar";
8+
import UserFriendsTable from "../components/ui/user_tables/user_friends_table";
9+
import UserGroupsTable from "../components/ui/user_tables/user_groups_table";
10+
import UserInventoryTable from "../components/ui/user_tables/user_inventory_table";
11+
12+
{
13+
/* optional: later have a list for friends in said groups or something in above "my groups" */
14+
}
15+
416
// The Header component is now one directory level up from 'pages',
517
// so the path is '../components/Header'
618
//import Header from '../components/Header';
@@ -11,15 +23,76 @@ const UserDashboardPage = () => {
1123
<Head>
1224
<title>User Dashboard</title>
1325
</Head>
14-
<div className="dashboard-container">
15-
{/* 1. Navigation Bar */}
16-
{/* <Header /> */}
26+
{/* 1. Navigation Bar */}
27+
<UserNavbar />
1728

29+
{/* Page background */}
30+
<div className="min-h-screen bg-gray-100 p-6">
1831
{/* 2. Main content wrapper */}
19-
<main className="dashboard-content">
32+
<main className="mx-auto h-[80vh] max-w-6xl">
2033
{/* Components for Statistics, Recent Activity, and Quick Actions */}
21-
<h1>Welcome to the User Dashboard!</h1>{" "}
22-
{/* Add a temporary header to confirm it works */}
34+
<h1 className="mb-6 text-3xl font-bold">
35+
Welcome to the User Dashboard!
36+
</h1>
37+
38+
{/* Dashboard Grid */}
39+
<div className="grid h-full grid-flow-col grid-rows-3 gap-4">
40+
{/* Inventory Panel (Scrollable) */}
41+
<div className="row-span-3 flex flex-col rounded-xl bg-white p-4 shadow">
42+
<div className="mb-3 flex items-center justify-between">
43+
<h2 className="mb-2 text-xl font-semibold">My Inventory</h2>
44+
{/* route to inventory page TODO:*/}
45+
<Link href="/user_inventory">
46+
<button className="cursor-pointer text-sm font-semibold text-blue-600 hover:underline">
47+
View My Inventory
48+
</button>
49+
</Link>
50+
</div>
51+
<UserInventoryTable />
52+
</div>
53+
54+
{/* Top right panel */}
55+
<div className="col-span-2 flex flex-col rounded-xl bg-white p-4 shadow">
56+
<div className="mb-3 flex items-center justify-between">
57+
<h2 className="mb-2 text-xl font-semibold">Due Soon</h2>
58+
{/* route to inventory page TODO: (or just regular inventory page ig) */}
59+
<Link href="/user_inventory">
60+
<button className="cursor-pointer text-sm font-semibold text-blue-600 hover:underline">
61+
View My Inventory Due Soon
62+
</button>
63+
</Link>
64+
</div>
65+
<UserInventoryTable />
66+
</div>
67+
68+
{/* Middle right panel */}
69+
<div className="col-span-2 row-span-1 flex flex-col rounded-xl bg-white p-4 shadow">
70+
<div className="mb-3 flex items-center justify-between">
71+
<h2 className="mb-2 text-xl font-semibold">My Groups</h2>
72+
{/* route to groups page TODO:*/}
73+
<Link href="/user_groups">
74+
<button className="cursor-pointer text-sm font-semibold text-blue-600 hover:underline">
75+
View My Groups
76+
</button>
77+
</Link>
78+
</div>
79+
<UserGroupsTable />
80+
</div>
81+
82+
{/* Bottom right panel */}
83+
<div className="col-span-2 row-span-1 flex flex-col rounded-xl bg-white p-4 shadow">
84+
<div className="mb-3 flex items-center justify-between">
85+
<h2 className="mb-2 text-xl font-semibold">My Friends</h2>
86+
{/* route to groups page TODO:*/}
87+
<Link href="/user_friends">
88+
<button className="cursor-pointer text-sm font-semibold text-blue-600 hover:underline">
89+
View My Friends
90+
</button>
91+
</Link>
92+
</div>
93+
<UserFriendsTable />
94+
</div>
95+
</div>
2396
</main>
2497
</div>
2598
</>

0 commit comments

Comments
 (0)