Skip to content

Commit c1c4ddb

Browse files
authored
Merge pull request #7 from codersforcauses/user_dashboard
Adding User Dashboard Page
2 parents c6b4a0c + 3dc0e5e commit c1c4ddb

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// src/components/ui/button_go_user_dashboard.tsx
2+
3+
/*
4+
This is the button component that will take us to the organization dashboard page
5+
Copy this function into its own file so it can be reused in multiple places
6+
*/
7+
8+
// Next.js uses the Link component for client-side navigation
9+
// better and faster then <a> tags.
10+
import Link from "next/link";
11+
import React from "react";
12+
13+
/*
14+
legacyBehavior is used to enable the older behavior of Link component
15+
we dont actually need to have an <a> tag inside Link cause Link itself can handle it,
16+
but for styling purposes we are using it here
17+
*/
18+
const ButtonGoUserDashboard = () => {
19+
return (
20+
// Change the href to match the new page name, the name is based on the file name
21+
// example: organization_dashboard.tsx -> /organization_dashboard
22+
<Link href="/user_dashboard" legacyBehavior>
23+
<a
24+
style={{
25+
padding: "10px 20px",
26+
marginTop: "20px",
27+
backgroundColor: "#0070f3",
28+
color: "white",
29+
borderRadius: "5px",
30+
textDecoration: "none",
31+
fontSize: "1.1em",
32+
}}
33+
>
34+
Go to User Dashboard
35+
</a>
36+
</Link>
37+
);
38+
};
39+
40+
// Use default export so it can be easily imported into the page
41+
export default ButtonGoUserDashboard;

client/src/pages/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// this is the path to this page
22
// src/pages/index.tsx
33

4+
import ButtonGoUserDashboard from "../components/ui/button_go_user_dashboard";
45
import ButtonGoOrganizationDashboard from "../components/ui/button_go_organization_dashboard";
56
import ButtonGoUserPage from "../components/ui/button_go_user_page";
67

@@ -27,6 +28,7 @@ const LandingPage = () => {
2728
*/}
2829

2930
<ButtonGoOrganizationDashboard />
31+
<ButtonGoUserDashboard />
3032
<ButtonGoUserPage />
3133
</div>
3234
);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// src/pages/organization_dashboard.tsx (Update the import path)
2+
3+
import Head from "next/head";
4+
// The Header component is now one directory level up from 'pages',
5+
// so the path is '../components/Header'
6+
//import Header from '../components/Header';
7+
8+
const UserDashboardPage = () => {
9+
return (
10+
<>
11+
<Head>
12+
<title>User Dashboard</title>
13+
</Head>
14+
<div className="dashboard-container">
15+
{/* 1. Navigation Bar */}
16+
{/* <Header /> */}
17+
18+
{/* 2. Main content wrapper */}
19+
<main className="dashboard-content">
20+
{/* 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 */}
23+
</main>
24+
</div>
25+
</>
26+
);
27+
};
28+
29+
// export to make the function available to other parts of the app
30+
export default UserDashboardPage;

0 commit comments

Comments
 (0)