diff --git a/payment-iq/app/dashboard/admin/backofficeusers/page.tsx b/payment-iq/app/dashboard/admin/backofficeusers/page.tsx
new file mode 100644
index 0000000..8cf2923
--- /dev/null
+++ b/payment-iq/app/dashboard/admin/backofficeusers/page.tsx
@@ -0,0 +1,13 @@
+// This ensures this component is rendered only on the client side
+"use client";
+
+import { Approve } from "@/app/features/Pages/Approve/Approve";
+
+export default function BackOfficeUsersPage() {
+ return (
+
+ {/* This page will now be rendered on the client-side */}
+
+
+ );
+}
diff --git a/payment-iq/app/dashboard/admin/page.tsx b/payment-iq/app/dashboard/admin/page.tsx
new file mode 100644
index 0000000..e91d47b
--- /dev/null
+++ b/payment-iq/app/dashboard/admin/page.tsx
@@ -0,0 +1,13 @@
+// This ensures this component is rendered only on the client side
+"use client";
+
+import { Approve } from "@/app/features/Pages/Approve/Approve";
+
+export default function BackOfficeUsersPage() {
+ return (
+
+ {/* This page will now be rendered on the client-side */}
+ hello
+
+ );
+}
diff --git a/payment-iq/app/features/dashboard/sidebar/Sidebar.tsx b/payment-iq/app/features/dashboard/sidebar/Sidebar.tsx
index 381003f..9554995 100644
--- a/payment-iq/app/features/dashboard/sidebar/Sidebar.tsx
+++ b/payment-iq/app/features/dashboard/sidebar/Sidebar.tsx
@@ -1,11 +1,19 @@
"use client";
import DashboardIcon from "@mui/icons-material/Dashboard";
+import { useState } from "react";
import { PAGE_LINKS } from "@/app/features/dashboard/sidebar/SidebarLink.constants";
import PageLinks from "../../../components/PageLinks/PageLinks";
import "./sideBar.scss";
+import clsx from "clsx";
const SideBar = () => {
+ const [openMenus, setOpenMenus] = useState>({});
+
+ const toggleMenu = (title: string) => {
+ setOpenMenus((prev) => ({ ...prev, [title]: !prev[title] }));
+ };
+
return (
@@ -14,14 +22,42 @@ const SideBar = () => {
- {PAGE_LINKS.map((link) => (
-
- ))}
+
+ {PAGE_LINKS.map((link) =>
+ link.children ? (
+
+
toggleMenu(link.title)}
+ className="sidebar__dropdown-button"
+ >
+ {link.icon && }
+ {link.title}
+
+ {openMenus[link.title] ? "▲" : "▼"}
+
+
+ {openMenus[link.title] && (
+
+ {link.children.map((child) => (
+
+ ))}
+
+ )}
+
+ ) : (
+
+ )
+ )}
);
};
diff --git a/payment-iq/app/features/dashboard/sidebar/SidebarLink.constants.ts b/payment-iq/app/features/dashboard/sidebar/SidebarLink.constants.ts
index 62c143d..c8228c6 100644
--- a/payment-iq/app/features/dashboard/sidebar/SidebarLink.constants.ts
+++ b/payment-iq/app/features/dashboard/sidebar/SidebarLink.constants.ts
@@ -8,6 +8,8 @@ import GavelIcon from "@mui/icons-material/Gavel";
import HubIcon from "@mui/icons-material/Hub";
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
import InsightsIcon from "@mui/icons-material/Insights";
+import ListAltIcon from "@mui/icons-material/ListAlt";
+import SettingsIcon from "@mui/icons-material/Settings";
import { ISidebarLink } from "@/app/features/dashboard/sidebar/SidebarLink.interfaces";
export const PAGE_LINKS: ISidebarLink[] = [
@@ -28,7 +30,28 @@ export const PAGE_LINKS: ISidebarLink[] = [
// { title: 'Analytics', path: '/analytics', icon: BarChartIcon },
{ title: "Rules", path: "/dashboard/rules", icon: GavelIcon },
{ title: "Rules Hub", path: "/dashboard/rules-hub", icon: HubIcon },
- { title: "Admin", path: "/dashboard/admin", icon: AdminPanelSettingsIcon },
+ {
+ title: "Admin",
+ path: "/dashboard/admin",
+ icon: AdminPanelSettingsIcon,
+ children: [
+ {
+ title: "Manage Users",
+ path: "/admin/users",
+ icon: PeopleIcon,
+ },
+ {
+ title: "Transactions",
+ path: "/admin/transactions",
+ icon: ListAltIcon,
+ },
+ {
+ title: "Settings",
+ path: "/admin/settings",
+ icon: SettingsIcon,
+ },
+ ],
+ },
{ title: "Account IQ", path: "/dashboard/account-iq", icon: InsightsIcon },
// { title: 'Documentation', path: '/documentation', icon: DescriptionIcon },
// { title: 'Support', path: '/support', icon: SupportAgentIcon },
diff --git a/payment-iq/app/features/dashboard/sidebar/SidebarLink.interfaces.ts b/payment-iq/app/features/dashboard/sidebar/SidebarLink.interfaces.ts
index 8de910e..d274129 100644
--- a/payment-iq/app/features/dashboard/sidebar/SidebarLink.interfaces.ts
+++ b/payment-iq/app/features/dashboard/sidebar/SidebarLink.interfaces.ts
@@ -4,4 +4,5 @@ export interface ISidebarLink {
title: string;
path: string;
icon?: ElementType;
+ children?: ISidebarLink[];
}
diff --git a/payment-iq/app/features/dashboard/sidebar/sideBar.scss b/payment-iq/app/features/dashboard/sidebar/sideBar.scss
index 04d49db..123db72 100644
--- a/payment-iq/app/features/dashboard/sidebar/sideBar.scss
+++ b/payment-iq/app/features/dashboard/sidebar/sideBar.scss
@@ -1,27 +1,74 @@
.sidebar {
- position: fixed;
- top: 0;
- left: 0;
- width: 240px;
- height: 100vh;
- background-color: var(--background-primary);
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 240px;
+ height: 100vh;
+ background-color: var(--background-primary);
+ color: white;
+ display: flex;
+ flex-direction: column;
+ padding: 16px;
+ z-index: 1100;
+ border-right: 1px solid #333;
+
+ &__header {
+ font-size: 20px;
+ font-weight: 600;
+ margin-bottom: 24px;
+ display: flex;
+ align-items: center;
color: white;
+
+ &__icon-spacing {
+ margin-left: 8px;
+ }
+ }
+
+ &__dropdown-button {
+ padding: 10px 0;
+ background: none;
+ border: none;
+ color: white;
+ font-size: 16px;
+ text-align: left;
+ display: flex;
+ align-items: center;
+ width: 100%;
+ cursor: pointer;
+ transition: background-color 0.2s ease;
+
+ &:hover {
+ background-color: rgba(255, 255, 255, 0.08);
+ }
+
+ svg {
+ margin-right: 10px;
+ }
+
+ .sidebar__arrow {
+ margin-left: auto;
+ font-size: 12px;
+ }
+ }
+
+ &__submenu {
+ margin-left: 28px;
display: flex;
flex-direction: column;
- padding: 16px;
- z-index: 1100;
- border-right: 1px solid #333;
+ border-left: 2px solid rgba(255, 255, 255, 0.1);
+ padding-left: 8px;
- .sidebar__header {
- font-size: 20px;
- font-weight: 600;
- margin-bottom: 24px;
- display: flex;
- align-items: center;
- color: white;
+ a {
+ color: white;
+ padding: 8px 0;
+ font-size: 14px;
+ text-decoration: none;
+ transition: color 0.2s ease;
- .sidebar__icon-spacing {
- margin-left: 8px;
- }
+ &:hover {
+ color: var(--primary-color); // Define your highlight color in variables
+ }
}
+ }
}