Added submenu for admin
This commit is contained in:
parent
63f20869b4
commit
06d69c2cae
13
payment-iq/app/dashboard/admin/backofficeusers/page.tsx
Normal file
13
payment-iq/app/dashboard/admin/backofficeusers/page.tsx
Normal file
@ -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 (
|
||||||
|
<div>
|
||||||
|
{/* This page will now be rendered on the client-side */}
|
||||||
|
<Approve />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
13
payment-iq/app/dashboard/admin/page.tsx
Normal file
13
payment-iq/app/dashboard/admin/page.tsx
Normal file
@ -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 (
|
||||||
|
<div>
|
||||||
|
{/* This page will now be rendered on the client-side */}
|
||||||
|
hello
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,11 +1,19 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import DashboardIcon from "@mui/icons-material/Dashboard";
|
import DashboardIcon from "@mui/icons-material/Dashboard";
|
||||||
|
import { useState } from "react";
|
||||||
import { PAGE_LINKS } from "@/app/features/dashboard/sidebar/SidebarLink.constants";
|
import { PAGE_LINKS } from "@/app/features/dashboard/sidebar/SidebarLink.constants";
|
||||||
import PageLinks from "../../../components/PageLinks/PageLinks";
|
import PageLinks from "../../../components/PageLinks/PageLinks";
|
||||||
import "./sideBar.scss";
|
import "./sideBar.scss";
|
||||||
|
import clsx from "clsx";
|
||||||
|
|
||||||
const SideBar = () => {
|
const SideBar = () => {
|
||||||
|
const [openMenus, setOpenMenus] = useState<Record<string, boolean>>({});
|
||||||
|
|
||||||
|
const toggleMenu = (title: string) => {
|
||||||
|
setOpenMenus((prev) => ({ ...prev, [title]: !prev[title] }));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside className="sidebar">
|
<aside className="sidebar">
|
||||||
<div className="sidebar__header">
|
<div className="sidebar__header">
|
||||||
@ -14,14 +22,42 @@ const SideBar = () => {
|
|||||||
<DashboardIcon fontSize="small" className="sidebar__icon-spacing" />
|
<DashboardIcon fontSize="small" className="sidebar__icon-spacing" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{PAGE_LINKS.map((link) => (
|
|
||||||
|
{PAGE_LINKS.map((link) =>
|
||||||
|
link.children ? (
|
||||||
|
<div key={link.title}>
|
||||||
|
<button
|
||||||
|
onClick={() => toggleMenu(link.title)}
|
||||||
|
className="sidebar__dropdown-button"
|
||||||
|
>
|
||||||
|
{link.icon && <link.icon />}
|
||||||
|
<span className="sidebar__text">{link.title}</span>
|
||||||
|
<span className="sidebar__arrow">
|
||||||
|
{openMenus[link.title] ? "▲" : "▼"}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
{openMenus[link.title] && (
|
||||||
|
<div className="sidebar__submenu">
|
||||||
|
{link.children.map((child) => (
|
||||||
|
<PageLinks
|
||||||
|
key={child.path}
|
||||||
|
title={child.title}
|
||||||
|
path={child.path}
|
||||||
|
icon={child.icon}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<PageLinks
|
<PageLinks
|
||||||
key={link.path}
|
key={link.path}
|
||||||
title={link.title}
|
title={link.title}
|
||||||
path={link.path}
|
path={link.path}
|
||||||
icon={link.icon}
|
icon={link.icon}
|
||||||
/>
|
/>
|
||||||
))}
|
)
|
||||||
|
)}
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,6 +8,8 @@ import GavelIcon from "@mui/icons-material/Gavel";
|
|||||||
import HubIcon from "@mui/icons-material/Hub";
|
import HubIcon from "@mui/icons-material/Hub";
|
||||||
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
|
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
|
||||||
import InsightsIcon from "@mui/icons-material/Insights";
|
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";
|
import { ISidebarLink } from "@/app/features/dashboard/sidebar/SidebarLink.interfaces";
|
||||||
|
|
||||||
export const PAGE_LINKS: ISidebarLink[] = [
|
export const PAGE_LINKS: ISidebarLink[] = [
|
||||||
@ -28,7 +30,28 @@ export const PAGE_LINKS: ISidebarLink[] = [
|
|||||||
// { title: 'Analytics', path: '/analytics', icon: BarChartIcon },
|
// { title: 'Analytics', path: '/analytics', icon: BarChartIcon },
|
||||||
{ title: "Rules", path: "/dashboard/rules", icon: GavelIcon },
|
{ title: "Rules", path: "/dashboard/rules", icon: GavelIcon },
|
||||||
{ title: "Rules Hub", path: "/dashboard/rules-hub", icon: HubIcon },
|
{ 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: "Account IQ", path: "/dashboard/account-iq", icon: InsightsIcon },
|
||||||
// { title: 'Documentation', path: '/documentation', icon: DescriptionIcon },
|
// { title: 'Documentation', path: '/documentation', icon: DescriptionIcon },
|
||||||
// { title: 'Support', path: '/support', icon: SupportAgentIcon },
|
// { title: 'Support', path: '/support', icon: SupportAgentIcon },
|
||||||
|
|||||||
@ -4,4 +4,5 @@ export interface ISidebarLink {
|
|||||||
title: string;
|
title: string;
|
||||||
path: string;
|
path: string;
|
||||||
icon?: ElementType;
|
icon?: ElementType;
|
||||||
|
children?: ISidebarLink[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
z-index: 1100;
|
z-index: 1100;
|
||||||
border-right: 1px solid #333;
|
border-right: 1px solid #333;
|
||||||
|
|
||||||
.sidebar__header {
|
&__header {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
@ -20,8 +20,55 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
.sidebar__icon-spacing {
|
&__icon-spacing {
|
||||||
margin-left: 8px;
|
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;
|
||||||
|
border-left: 2px solid rgba(255, 255, 255, 0.1);
|
||||||
|
padding-left: 8px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: white;
|
||||||
|
padding: 8px 0;
|
||||||
|
font-size: 14px;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: color 0.2s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--primary-color); // Define your highlight color in variables
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user