Skip to content

Commit e9f022b

Browse files
authored
Merge pull request #5 from codersforcauses/user_page
Add user page frontend
2 parents e9ce76a + 47f71de commit e9f022b

3 files changed

Lines changed: 72 additions & 1 deletion

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_organization_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 ButtonGoOrganizationDashboard = () => {
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="/organization_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 Dashboard
35+
</a>
36+
</Link>
37+
);
38+
};
39+
40+
// Use default export so it can be easily imported into the page
41+
export default ButtonGoOrganizationDashboard;

client/src/pages/index.tsx

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

4-
import ButtonGoOrganizationDashboard from "../components/ui/button_go_organization_dashboard";
4+
import ButtonGoOrganizationDashboard from "../components/ui/button_go_user_page";
55

66
// this is a react functional component
77
// it returns a html element that will render the jsx inside it

client/src/pages/user_page.tsx

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 DashboardPage = () => {
9+
return (
10+
<>
11+
<Head>
12+
<title>Inventory 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 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 DashboardPage;

0 commit comments

Comments
 (0)