From ad85a18225de5f94b09d24eee6e3be8ead2342b9 Mon Sep 17 00:00:00 2001 From: Mitchell Magro Date: Wed, 18 Jun 2025 18:24:37 +0200 Subject: [PATCH] s --- .../app/components/sidebar/SideBarLink.tsx | 13 ++--- payment-iq/app/components/sidebar/Sidebar.tsx | 47 ++++++++++--------- payment-iq/app/dashboard/approve/page.tsx | 13 +++++ payment-iq/app/dashboard/investigate/page.tsx | 13 +++++ payment-iq/app/dashboard/layout.tsx | 10 ++++ payment-iq/app/dashboard/page.tsx | 17 +++++++ .../app/dashboard/transactions/page.tsx | 13 +++++ payment-iq/app/layout.tsx | 29 +++--------- payment-iq/app/page.tsx | 1 - payment-iq/config/ThemeRegistry.tsx | 14 ++++++ payment-iq/config/theme.ts | 36 ++++---------- payment-iq/constants/SidebarLink.constants.ts | 6 +-- 12 files changed, 132 insertions(+), 80 deletions(-) create mode 100644 payment-iq/app/dashboard/approve/page.tsx create mode 100644 payment-iq/app/dashboard/investigate/page.tsx create mode 100644 payment-iq/app/dashboard/layout.tsx create mode 100644 payment-iq/app/dashboard/page.tsx create mode 100644 payment-iq/app/dashboard/transactions/page.tsx create mode 100644 payment-iq/config/ThemeRegistry.tsx diff --git a/payment-iq/app/components/sidebar/SideBarLink.tsx b/payment-iq/app/components/sidebar/SideBarLink.tsx index 5d08673..17601cf 100644 --- a/payment-iq/app/components/sidebar/SideBarLink.tsx +++ b/payment-iq/app/components/sidebar/SideBarLink.tsx @@ -8,23 +8,24 @@ const LinkContainer = styled('div')(({ theme }) => ({ display: 'flex', alignItems: 'center', padding: '12px 1px', -// borderRadius: theme.shape.borderRadius,s -// color: theme.palette.text.primary, + borderRadius: '4px', + color: theme.palette.text.tertiary, textDecoration: 'none', transition: 'background 0.2s ease-in-out', '&:hover': { color: 'rgb(255, 255, 255)', background: 'rgba(255, 255, 255, 0.08)', - // backgroundColor: theme.palette.action.hover, + backgroundColor: theme.palette.action.hover, cursor: 'pointer', }, })); -// background-color: rgb(69, 190, 171); -const LinkText = styled('span')({ + +const LinkText = styled('span')(({ theme }) => ({ + color: theme.palette.text.tertiary, marginLeft: '12px', fontWeight: 500, -}); +})); export default function SidebarLink({ title, path, icon: Icon }: ISidebarLink) { return ( diff --git a/payment-iq/app/components/sidebar/Sidebar.tsx b/payment-iq/app/components/sidebar/Sidebar.tsx index d74be7d..cff7d8e 100644 --- a/payment-iq/app/components/sidebar/Sidebar.tsx +++ b/payment-iq/app/components/sidebar/Sidebar.tsx @@ -1,4 +1,4 @@ -'use client' +'use client'; import React from 'react'; import { styled } from '@mui/system'; @@ -9,30 +9,32 @@ import SidebarLink from './SideBarLink'; // Sidebar Container (styled using MUI System) export const Sidebar = styled('div')(({ theme }) => ({ width: '240px', - backgroundColor: 'rgb(69, 190, 171)', + backgroundColor: theme.palette.background.primary, color: 'white', padding: theme.spacing(2), height: '100vh', display: 'flex', flexDirection: 'column', justifyContent: 'space-between', + transition: 'width 0.3s ease', // Transition for resizing })); // Main Content Area export const MainContent = styled('div')(({ theme }) => ({ - marginLeft: '240px', - padding: theme.spacing(3), - backgroundColor: 'green', + flexGrow: 1, + padding: theme.spacing(4), + backgroundColor: theme.palette.background.default, minHeight: '100vh', + overflowY: 'auto', })); -// Sidebar Navigation Items -export const SidebarItem = styled('div')(({ theme }) => ({ - padding: theme.spacing(1.5), - cursor: 'pointer', - '&:hover': { - backgroundColor: 'brown', - }, +// Sidebar Header +export const SidebarHeader = styled('div')(({ theme }) => ({ + marginBottom: theme.spacing(2), + fontSize: '20px', + fontWeight: 600, + display: 'flex', + alignItems: 'center', })); // Page Wrapper that holds Sidebar and Content @@ -42,18 +44,18 @@ export const LayoutWrapper = styled('div')({ height: '100vh', }); -// Sidebar Header -export const SidebarHeader = styled('div')(({ theme }) => ({ - marginBottom: theme.spacing(2), - fontSize: '20px', - fontWeight: 600, -})); +interface SidebarLayoutProps { + children: React.ReactNode; // Add children to accept passed content +} -const SidebarLayout = () => { - return ( +const SidebarLayout: React.FC = ({ children }) => { + return ( - PaymentIQ + + PaymentIQ + + {SIDEBAR_LINKS.map((link) => ( { /> ))} + {children} {/* Render children here */} ); -} +}; export default SidebarLayout; diff --git a/payment-iq/app/dashboard/approve/page.tsx b/payment-iq/app/dashboard/approve/page.tsx new file mode 100644 index 0000000..c496001 --- /dev/null +++ b/payment-iq/app/dashboard/approve/page.tsx @@ -0,0 +1,13 @@ +// This ensures this component is rendered only on the client side +'use client'; + +import React from 'react'; + +export default function ApprovePage() { + return ( +
+ {/* This page will now be rendered on the client-side */} +

Approve

+
+ ); +} \ No newline at end of file diff --git a/payment-iq/app/dashboard/investigate/page.tsx b/payment-iq/app/dashboard/investigate/page.tsx new file mode 100644 index 0000000..28fbef1 --- /dev/null +++ b/payment-iq/app/dashboard/investigate/page.tsx @@ -0,0 +1,13 @@ +// This ensures this component is rendered only on the client side +'use client'; + +import React from 'react'; + +export default function InvestigatePage() { + return ( +
+ {/* This page will now be rendered on the client-side */} +

Investigate

+
+ ); +} \ No newline at end of file diff --git a/payment-iq/app/dashboard/layout.tsx b/payment-iq/app/dashboard/layout.tsx new file mode 100644 index 0000000..e9aefe5 --- /dev/null +++ b/payment-iq/app/dashboard/layout.tsx @@ -0,0 +1,10 @@ +'use client'; + +import React from 'react'; +import SidebarLayout from '../components/sidebar/Sidebar'; + +const DashboardLayout: React.FC<{ children: React.ReactNode }> = ({ children }) => { + return {children}; // Ensure that the sidebar wraps all dashboard pages +}; + +export default DashboardLayout; diff --git a/payment-iq/app/dashboard/page.tsx b/payment-iq/app/dashboard/page.tsx new file mode 100644 index 0000000..4520b57 --- /dev/null +++ b/payment-iq/app/dashboard/page.tsx @@ -0,0 +1,17 @@ +'use client'; + +import React from 'react'; +import { Typography, Paper } from '@mui/material'; + +const DashboardPage = () => { + return ( +
+ + Dashboard Overview + + {/* Add your dashboard content here */} +
+ ); +}; + +export default DashboardPage; diff --git a/payment-iq/app/dashboard/transactions/page.tsx b/payment-iq/app/dashboard/transactions/page.tsx new file mode 100644 index 0000000..800d90d --- /dev/null +++ b/payment-iq/app/dashboard/transactions/page.tsx @@ -0,0 +1,13 @@ +// This ensures this component is rendered only on the client side +'use client'; + +import React from 'react'; + +export default function TransactionPage() { + return ( +
+ {/* This page will now be rendered on the client-side */} +

Transactions

+
+ ); +} \ No newline at end of file diff --git a/payment-iq/app/layout.tsx b/payment-iq/app/layout.tsx index 42fc323..e7709d0 100644 --- a/payment-iq/app/layout.tsx +++ b/payment-iq/app/layout.tsx @@ -1,31 +1,16 @@ -import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; -import "./globals.css"; - -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); +import ThemeRegistry from '@/config/ThemeRegistry'; +import type { Metadata } from 'next'; export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: 'Your App', + description: 'Generated by Next.js', }; -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { +export default function RootLayout({ children }: { children: React.ReactNode }) { return ( - - {children} + + {children} ); diff --git a/payment-iq/app/page.tsx b/payment-iq/app/page.tsx index b29a582..3915b26 100644 --- a/payment-iq/app/page.tsx +++ b/payment-iq/app/page.tsx @@ -1,4 +1,3 @@ -import Image from "next/image"; import SidebarLayout from '@/app/components/sidebar/Sidebar'; export default function Home() { diff --git a/payment-iq/config/ThemeRegistry.tsx b/payment-iq/config/ThemeRegistry.tsx new file mode 100644 index 0000000..19ddc63 --- /dev/null +++ b/payment-iq/config/ThemeRegistry.tsx @@ -0,0 +1,14 @@ + +'use client'; + +import { ThemeProvider, CssBaseline } from '@mui/material'; +import theme from './theme'; + +export default function ThemeRegistry({ children }: { children: React.ReactNode }) { + return ( + + + {children} + + ); +} diff --git a/payment-iq/config/theme.ts b/payment-iq/config/theme.ts index f8f151f..c1b46e5 100644 --- a/payment-iq/config/theme.ts +++ b/payment-iq/config/theme.ts @@ -1,41 +1,27 @@ import { createTheme } from '@mui/material/styles'; -// Define your color palette -const lightPalette = { +const palette = { primary: { - main: '#1976d2', // Blue color + main: '#1976d2', }, secondary: { - main: '#d32f2f', // Red color + main: '#d32f2f', }, background: { default: '#fafafa', paper: '#ffffff', + primary: 'rgb(69, 190, 171)', }, text: { primary: '#000000', secondary: '#555555', + tertiary: '#fff', + }, + action: { + hover: 'rgba(0, 0, 0, 0.08)', }, }; -const darkPalette = { - primary: { - main: '#90caf9', // Light blue - }, - secondary: { - main: '#f48fb1', // Light pink - }, - background: { - default: '#121212', - paper: '#1d1d1d', - }, - text: { - primary: '#ffffff', - secondary: '#bbbbbb', - }, -}; - -// Typography customization const typography = { fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif', h1: { @@ -56,11 +42,9 @@ const typography = { const theme = createTheme({ palette: { mode: 'light', // Change this to 'dark' for dark mode - ...(process.env.NODE_ENV === 'development' // Switch for dev mode - ? lightPalette - : darkPalette), + ...palette }, - typography, + // typography, breakpoints: { values: { xs: 0, diff --git a/payment-iq/constants/SidebarLink.constants.ts b/payment-iq/constants/SidebarLink.constants.ts index a637279..2a0e9aa 100644 --- a/payment-iq/constants/SidebarLink.constants.ts +++ b/payment-iq/constants/SidebarLink.constants.ts @@ -16,9 +16,9 @@ import { ISidebarLink } from '@/interfaces/SidebarLink.interfaces'; export const SIDEBAR_LINKS: ISidebarLink[] = [ - { title: 'Home', path: '/', icon: HomeIcon }, - { title: 'Transaction', path: '/transaction', icon: AccountBalanceWalletIcon }, - { title: 'Approve', path: '/approve', icon: CheckCircleIcon }, + { title: 'Home', path: '/dashboard', icon: HomeIcon }, + { title: 'Transaction', path: '/dashboard/transactions', icon: AccountBalanceWalletIcon }, + { title: 'Approve', path: '/dashboard/approve', icon: CheckCircleIcon }, { title: 'Investigate', path: '/investigate', icon: SearchIcon }, { title: 'KYC', path: '/kyc', icon: VerifiedUserIcon }, { title: 'User Accounts', path: '/user-accounts', icon: PeopleIcon },