This commit is contained in:
Mitchell Magro 2025-06-18 18:24:37 +02:00
parent d2e7db54c2
commit ad85a18225
12 changed files with 132 additions and 80 deletions

View File

@ -8,23 +8,24 @@ const LinkContainer = styled('div')(({ theme }) => ({
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
padding: '12px 1px', padding: '12px 1px',
// borderRadius: theme.shape.borderRadius,s borderRadius: '4px',
// color: theme.palette.text.primary, color: theme.palette.text.tertiary,
textDecoration: 'none', textDecoration: 'none',
transition: 'background 0.2s ease-in-out', transition: 'background 0.2s ease-in-out',
'&:hover': { '&:hover': {
color: 'rgb(255, 255, 255)', color: 'rgb(255, 255, 255)',
background: 'rgba(255, 255, 255, 0.08)', background: 'rgba(255, 255, 255, 0.08)',
// backgroundColor: theme.palette.action.hover, backgroundColor: theme.palette.action.hover,
cursor: 'pointer', cursor: 'pointer',
}, },
})); }));
// background-color: rgb(69, 190, 171);
const LinkText = styled('span')({ const LinkText = styled('span')(({ theme }) => ({
color: theme.palette.text.tertiary,
marginLeft: '12px', marginLeft: '12px',
fontWeight: 500, fontWeight: 500,
}); }));
export default function SidebarLink({ title, path, icon: Icon }: ISidebarLink) { export default function SidebarLink({ title, path, icon: Icon }: ISidebarLink) {
return ( return (

View File

@ -1,4 +1,4 @@
'use client' 'use client';
import React from 'react'; import React from 'react';
import { styled } from '@mui/system'; import { styled } from '@mui/system';
@ -9,30 +9,32 @@ import SidebarLink from './SideBarLink';
// Sidebar Container (styled using MUI System) // Sidebar Container (styled using MUI System)
export const Sidebar = styled('div')(({ theme }) => ({ export const Sidebar = styled('div')(({ theme }) => ({
width: '240px', width: '240px',
backgroundColor: 'rgb(69, 190, 171)', backgroundColor: theme.palette.background.primary,
color: 'white', color: 'white',
padding: theme.spacing(2), padding: theme.spacing(2),
height: '100vh', height: '100vh',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
justifyContent: 'space-between', justifyContent: 'space-between',
transition: 'width 0.3s ease', // Transition for resizing
})); }));
// Main Content Area // Main Content Area
export const MainContent = styled('div')(({ theme }) => ({ export const MainContent = styled('div')(({ theme }) => ({
marginLeft: '240px', flexGrow: 1,
padding: theme.spacing(3), padding: theme.spacing(4),
backgroundColor: 'green', backgroundColor: theme.palette.background.default,
minHeight: '100vh', minHeight: '100vh',
overflowY: 'auto',
})); }));
// Sidebar Navigation Items // Sidebar Header
export const SidebarItem = styled('div')(({ theme }) => ({ export const SidebarHeader = styled('div')(({ theme }) => ({
padding: theme.spacing(1.5), marginBottom: theme.spacing(2),
cursor: 'pointer', fontSize: '20px',
'&:hover': { fontWeight: 600,
backgroundColor: 'brown', display: 'flex',
}, alignItems: 'center',
})); }));
// Page Wrapper that holds Sidebar and Content // Page Wrapper that holds Sidebar and Content
@ -42,18 +44,18 @@ export const LayoutWrapper = styled('div')({
height: '100vh', height: '100vh',
}); });
// Sidebar Header interface SidebarLayoutProps {
export const SidebarHeader = styled('div')(({ theme }) => ({ children: React.ReactNode; // Add children to accept passed content
marginBottom: theme.spacing(2), }
fontSize: '20px',
fontWeight: 600,
}));
const SidebarLayout = () => { const SidebarLayout: React.FC<SidebarLayoutProps> = ({ children }) => {
return ( return (
<LayoutWrapper> <LayoutWrapper>
<Sidebar> <Sidebar>
<SidebarHeader>PaymentIQ<DashboardIcon sx={{ marginLeft: 0.5 }}/></SidebarHeader> <SidebarHeader>
PaymentIQ
<DashboardIcon sx={{ marginLeft: 0.5 }} />
</SidebarHeader>
{SIDEBAR_LINKS.map((link) => ( {SIDEBAR_LINKS.map((link) => (
<SidebarLink <SidebarLink
key={link.path} key={link.path}
@ -63,8 +65,9 @@ const SidebarLayout = () => {
/> />
))} ))}
</Sidebar> </Sidebar>
<MainContent>{children}</MainContent> {/* Render children here */}
</LayoutWrapper> </LayoutWrapper>
); );
} };
export default SidebarLayout; export default SidebarLayout;

View File

@ -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 (
<div>
{/* This page will now be rendered on the client-side */}
<h1>Approve</h1>
</div>
);
}

View File

@ -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 (
<div>
{/* This page will now be rendered on the client-side */}
<h1>Investigate</h1>
</div>
);
}

View File

@ -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 <SidebarLayout>{children}</SidebarLayout>; // Ensure that the sidebar wraps all dashboard pages
};
export default DashboardLayout;

View File

@ -0,0 +1,17 @@
'use client';
import React from 'react';
import { Typography, Paper } from '@mui/material';
const DashboardPage = () => {
return (
<div style={{ width: '100vh' }}>
<Typography variant="h4" gutterBottom>
Dashboard Overview
</Typography>
{/* Add your dashboard content here */}
</div>
);
};
export default DashboardPage;

View File

@ -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 (
<div>
{/* This page will now be rendered on the client-side */}
<h1>Transactions</h1>
</div>
);
}

View File

@ -1,31 +1,16 @@
import type { Metadata } from "next"; import ThemeRegistry from '@/config/ThemeRegistry';
import { Geist, Geist_Mono } from "next/font/google"; import type { Metadata } from 'next';
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Create Next App", title: 'Your App',
description: "Generated by create next app", description: 'Generated by Next.js',
}; };
export default function RootLayout({ export default function RootLayout({ children }: { children: React.ReactNode }) {
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return ( return (
<html lang="en"> <html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}> <body>
{children} <ThemeRegistry>{children}</ThemeRegistry>
</body> </body>
</html> </html>
); );

View File

@ -1,4 +1,3 @@
import Image from "next/image";
import SidebarLayout from '@/app/components/sidebar/Sidebar'; import SidebarLayout from '@/app/components/sidebar/Sidebar';
export default function Home() { export default function Home() {

View File

@ -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 (
<ThemeProvider theme={theme}>
<CssBaseline />
{children}
</ThemeProvider>
);
}

View File

@ -1,41 +1,27 @@
import { createTheme } from '@mui/material/styles'; import { createTheme } from '@mui/material/styles';
// Define your color palette const palette = {
const lightPalette = {
primary: { primary: {
main: '#1976d2', // Blue color main: '#1976d2',
}, },
secondary: { secondary: {
main: '#d32f2f', // Red color main: '#d32f2f',
}, },
background: { background: {
default: '#fafafa', default: '#fafafa',
paper: '#ffffff', paper: '#ffffff',
primary: 'rgb(69, 190, 171)',
}, },
text: { text: {
primary: '#000000', primary: '#000000',
secondary: '#555555', 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 = { const typography = {
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif', fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
h1: { h1: {
@ -56,11 +42,9 @@ const typography = {
const theme = createTheme({ const theme = createTheme({
palette: { palette: {
mode: 'light', // Change this to 'dark' for dark mode mode: 'light', // Change this to 'dark' for dark mode
...(process.env.NODE_ENV === 'development' // Switch for dev mode ...palette
? lightPalette
: darkPalette),
}, },
typography, // typography,
breakpoints: { breakpoints: {
values: { values: {
xs: 0, xs: 0,

View File

@ -16,9 +16,9 @@ import { ISidebarLink } from '@/interfaces/SidebarLink.interfaces';
export const SIDEBAR_LINKS: ISidebarLink[] = [ export const SIDEBAR_LINKS: ISidebarLink[] = [
{ title: 'Home', path: '/', icon: HomeIcon }, { title: 'Home', path: '/dashboard', icon: HomeIcon },
{ title: 'Transaction', path: '/transaction', icon: AccountBalanceWalletIcon }, { title: 'Transaction', path: '/dashboard/transactions', icon: AccountBalanceWalletIcon },
{ title: 'Approve', path: '/approve', icon: CheckCircleIcon }, { title: 'Approve', path: '/dashboard/approve', icon: CheckCircleIcon },
{ title: 'Investigate', path: '/investigate', icon: SearchIcon }, { title: 'Investigate', path: '/investigate', icon: SearchIcon },
{ title: 'KYC', path: '/kyc', icon: VerifiedUserIcon }, { title: 'KYC', path: '/kyc', icon: VerifiedUserIcon },
{ title: 'User Accounts', path: '/user-accounts', icon: PeopleIcon }, { title: 'User Accounts', path: '/user-accounts', icon: PeopleIcon },