Skip to content

Commit

Permalink
Merge pull request #2 from ad956/feature/gym-member
Browse files Browse the repository at this point in the history
🎨 Add Dashboard Route & Clean Up Navigation UI
  • Loading branch information
ad956 authored Oct 30, 2024
2 parents ed8234b + 4329f9c commit b450aad
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 39 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function Sidebar() {
};

const sidebarItems = [
{ label: "Dashboard", path: "/user/dashboard", icon: getIcon("Dashboard") },
{ label: "Dashboard", path: "/user/", icon: getIcon("Dashboard") },
{ label: "QR Code", path: "/user/qrcode", icon: getIcon("QRCode") },
{
label: "Membership",
Expand Down
60 changes: 24 additions & 36 deletions client/src/pages/user/components/Headbar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,32 @@ import { NavLink } from "react-router-dom";

export default function Headbar({ userData }) {
return (
<header className="bg-white shadow-md text-gray-800 py-3 px-8">
<div className="max-w-7xl mx-auto flex justify-between items-center">
<div className="flex items-center gap-4">
<Image
src="https://i.pinimg.com/736x/fc/ce/92/fcce92b6dd2ebb5259426a424a6f983d.jpg"
alt="FitConnect"
width={40}
height={40}
className="object-contain"
/>
<h1 className="text-2xl font-bold text-blue-600">FitConnect</h1>
</div>
<div className="flex items-center gap-6">
<div className="flex items-center bg-blue-50 rounded-lg px-4 py-2">
<FaCoins className="text-yellow-500 mr-2" />
<div>
<p className="font-semibold text-blue-600">
{userData.creditPoints} pts
</p>
<p className="text-xs text-gray-500">Credit Balance</p>
</div>
</div>
<div className="flex items-center gap-3">
<User
name={"Anand"}
avatarProps={{
src: "https://i.pinimg.com/736x/fc/ce/92/fcce92b6dd2ebb5259426a424a6f983d.jpg",
}}
className=""
description={
<NavLink
href={`/settings`}
className="text-xs text-primary"
>{`@${"ad956"}`}</NavLink>
}
/>
<header className="grid place-items-end bg-white shadow-md text-gray-800 py-3 px-8">
<div className="flex items-center gap-6">
<div className="flex items-center bg-blue-50 rounded-lg px-4 py-2">
<FaCoins className="text-yellow-500 mr-2" />
<div>
<p className="font-semibold text-blue-600">
{userData.creditPoints} pts
</p>
<p className="text-xs text-gray-500">Credit Balance</p>
</div>
</div>
<div className="flex items-center gap-3">
<User
name={"Anand"}
avatarProps={{
src: "https://i.pinimg.com/736x/fc/ce/92/fcce92b6dd2ebb5259426a424a6f983d.jpg",
}}
className=""
description={
<NavLink
href={`/settings`}
className="text-xs text-primary"
>{`@${"ad956"}`}</NavLink>
}
/>
</div>
</div>
</header>
);
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/user/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Layout } from "@components";
import { Layout, PageNotFound } from "@components";
import { Routes, Route } from "react-router-dom";
import {
Dashboard,
Expand Down Expand Up @@ -39,11 +39,12 @@ export default function UserLayout() {
<Headbar userData={userData} />
<section className="flex-1 overflow-y-auto">
<Routes>
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/" element={<Dashboard />} />
<Route path="/qrcode" element={<p>Profile</p>} />
<Route path="/membership" element={<Membership />} />
<Route path="/transactions" element={<Transactions />} />
<Route path="/profile" element={<Profile />} />
<Route path="*" element={<PageNotFound />} />
</Routes>
</section>
</div>
Expand Down

0 comments on commit b450aad

Please sign in to comment.