From c3d233c41a0eb98d53e95ebf5d22379498f8c633 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Sat, 4 Apr 2026 13:34:48 +0530 Subject: [PATCH] header and footer --- src/AppTheme.tsx | 13 ++++++++ src/Footer.tsx | 46 ++++++++++++++++++--------- src/Header.tsx | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ src/Home.tsx | 20 ++++-------- src/main.jsx | 35 +++++++++++++++++---- 5 files changed, 162 insertions(+), 34 deletions(-) create mode 100644 src/AppTheme.tsx create mode 100644 src/Header.tsx diff --git a/src/AppTheme.tsx b/src/AppTheme.tsx new file mode 100644 index 0000000..cdb2f7a --- /dev/null +++ b/src/AppTheme.tsx @@ -0,0 +1,13 @@ +import * as React from "react"; +import { ThemeProvider, createTheme } from "@mui/material/styles"; + +const theme = createTheme({ + palette: { + // mode: "light", // or "dark" + mode: "dark", // or "dark" + }, +}); + +export default function AppTheme({ children }: { children: React.ReactNode }) { + return {children}; +} diff --git a/src/Footer.tsx b/src/Footer.tsx index 2c102db..85298ef 100644 --- a/src/Footer.tsx +++ b/src/Footer.tsx @@ -2,6 +2,9 @@ import * as React from 'react'; import Container from '@mui/material/Container'; import Link from '@mui/material/Link'; import Typography from '@mui/material/Typography'; +import {AppBar, Box, Button, IconButton, Toolbar, Tooltip} from "@mui/material"; +import MenuIcon from "@mui/icons-material/Menu"; +import LogoutIcon from "@mui/icons-material/Logout"; function Copyright() { return ( @@ -17,19 +20,34 @@ function Copyright() { export default function Footer() { return ( - - - - - + + + + + + + + + ); } diff --git a/src/Header.tsx b/src/Header.tsx new file mode 100644 index 0000000..82af891 --- /dev/null +++ b/src/Header.tsx @@ -0,0 +1,82 @@ +import * as React from "react"; +import { + AppBar, + Toolbar, + Typography, + IconButton, + Tooltip, + Button, + Box, +} from "@mui/material"; +import MenuIcon from "@mui/icons-material/Menu"; +import LogoutIcon from "@mui/icons-material/Logout"; +import { useNavigate } from "react-router-dom"; + +interface HeaderProps { + headerTitle: string; + isMobile: boolean; + onDrawerToggle: () => void; + onLogout: () => void; + username?: string; +} + +export default function Header({ + headerTitle, + isMobile, + onDrawerToggle, + onLogout, + username, +}: HeaderProps) { + const navigate = useNavigate(); + + return ( + theme.zIndex.drawer + 1, + backdropFilter: "blur(8px)", + boxShadow: "none", + borderBottom: "1px solid", + borderColor: "divider", + }} + > + + {isMobile && ( + + + + )} + + + {headerTitle} + + + + + + + + + + + + + + ); +} \ No newline at end of file diff --git a/src/Home.tsx b/src/Home.tsx index 1cb663a..ea6eabc 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -1,20 +1,12 @@ import * as React from "react"; -import AppTheme from './shared-theme/AppTheme'; -import CssBaseline from '@mui/material/CssBaseline'; import { Box, Typography } from '@mui/material'; -import Footer from './Footer'; - -export default function Home(props: { disableCustomTheme?: boolean }) { +export default function Home() { return ( - - - - - Welcome to Khata - - -