+
+
-
@@ -34,4 +92,4 @@ export const DashboardLayout: React.FC = () => {
);
-};
\ No newline at end of file
+};
diff --git a/src/components/layout/Navbar.tsx b/src/components/layout/Navbar.tsx
index 511c56842..3963cdf86 100644
--- a/src/components/layout/Navbar.tsx
+++ b/src/components/layout/Navbar.tsx
@@ -1,74 +1,123 @@
-import React, { useState } from 'react';
-import { useNavigate, Link } from 'react-router-dom';
-import { Menu, X, Bell, MessageCircle, User, LogOut, Building2, CircleDollarSign } from 'lucide-react';
-import { useAuth } from '../../context/AuthContext';
-import { Avatar } from '../ui/Avatar';
-import { Button } from '../ui/Button';
+import React, { useState } from "react";
+import { useNavigate, Link } from "react-router-dom";
+import {
+ Menu,
+ X,
+ Bell,
+ MessageCircle,
+ User,
+ LogOut,
+ Building2,
+ CircleDollarSign,
+ Shield,
+ Users,
+ Handshake,
+ UsersRoundIcon,
+ Briefcase,
+} from "lucide-react";
+import { useAuth } from "../../context/AuthContext";
+import { Avatar } from "../ui/Avatar";
+import { Button } from "../ui/Button";
export const Navbar: React.FC = () => {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const { user, logout } = useAuth();
const navigate = useNavigate();
-
- const toggleMenu = () => {
- setIsMenuOpen(!isMenuOpen);
- };
-
+
+ const toggleMenu = () => setIsMenuOpen(!isMenuOpen);
+
const handleLogout = () => {
logout();
- navigate('/login');
+ navigate("/login");
};
-
- // User dashboard route based on role
- const dashboardRoute = user?.role === 'entrepreneur'
- ? '/dashboard/entrepreneur'
- : '/dashboard/investor';
-
- // User profile route based on role and ID
- const profileRoute = user
- ? `/profile/${user.role}/${user.id}`
- : '/login';
-
- const navLinks = [
- {
- icon: user?.role === 'entrepreneur' ?
:
,
- text: 'Dashboard',
- path: dashboardRoute,
- },
- {
- icon:
,
- text: 'Messages',
- path: user ? '/messages' : '/login',
- },
- {
- icon:
,
- text: 'Notifications',
- path: user ? '/notifications' : '/login',
- },
- {
- icon:
,
- text: 'Profile',
- path: profileRoute,
- }
- ];
-
+
+ // Determine dashboard route by role
+ const dashboardRoute =
+ user?.role === "entrepreneur"
+ ? "/dashboard/entrepreneur"
+ : user?.role === "investor"
+ ? "/dashboard/investor"
+ : user?.role === "admin"
+ ? "/dashboard/admin"
+ : "/login";
+
+ // Determine profile route by role
+ const profileRoute = user ? `/profile/${user.role}/${user.userId}` : "/login";
+
+ // Navigation links by role
+ let navLinks: { icon: JSX.Element; text: string; path: string }[] = [];
+
+ if (user?.role === "admin") {
+ navLinks = [
+ {
+ icon:
,
+ text: "Admin Dashboard",
+ path: dashboardRoute,
+ },
+ {
+ icon:
,
+ text: "Manage Users",
+ path: "/admin/all-users",
+ },
+ {
+ icon:
,
+ text: "Campaigns",
+ path: "/admin/campaigns",
+ },
+ {
+ icon:
,
+ text: "Supporters",
+ path: "/admin/Supporters",
+ },
+ {
+ icon:
,
+ text: "Notifications",
+ path: "/notifications",
+ },
+ ];
+ } else {
+ // Normal user (entrepreneur or investor)
+ navLinks = [
+ {
+ icon:
+ user?.role === "entrepreneur" ? (
+
+ ) : (
+
+ ),
+ text: "Dashboard",
+ path: dashboardRoute,
+ },
+ {
+ icon:
,
+ text: "Messages",
+ path: "/messages",
+ },
+ {
+ icon:
,
+ text: "Notifications",
+ path: "/notifications",
+ },
+ { icon:
, text: "Profile", path: profileRoute },
+ ];
+ }
+
return (
);
diff --git a/src/components/ui/Input.tsx b/src/components/ui/Input.tsx
index 2e16a6973..d12f46b49 100644
--- a/src/components/ui/Input.tsx
+++ b/src/components/ui/Input.tsx
@@ -1,66 +1,82 @@
-import React, { forwardRef } from 'react';
+import React, { forwardRef } from "react";
-export interface InputProps extends React.InputHTMLAttributes