refactor: migrate from MUI to Ant Design for layout and components
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 16s

- Updated package.json to remove MUI dependencies and add Ant Design.
- Refactored App component to use Ant Design's Layout, Header, Footer, and Sidebar.
- Created new Footer, Header, and Sidebar components using Ant Design.
- Removed old Header component that used MUI.
- Updated Home component to use Ant Design's Typography and Button.
- Added global styles in index.less and theme styles in theme.less and layout.less.
- Removed MUI theme configuration and replaced it with Ant Design's theming.
This commit is contained in:
2025-11-22 19:49:02 +01:00
parent c986c1215a
commit ea9d79f671
16 changed files with 3268 additions and 783 deletions

View File

@@ -0,0 +1,5 @@
import { Footer } from 'antd/es/layout/layout';
export const AppFooter: React.FC = () => {
return <Footer>MitM Webserver App by Marcus Almert ©2025</Footer>;
};

View File

@@ -0,0 +1,11 @@
import { Layout } from 'antd';
import React from 'react';
import '../theme/layout.less';
const { Header } = Layout;
const AppHeader: React.FC = () => {
return <Header>MitM Webserver</Header>;
};
export default AppHeader;

View File

@@ -0,0 +1,38 @@
// src/components/Sidebar.tsx
import { HomeOutlined, InfoCircleOutlined, SettingOutlined } from '@ant-design/icons';
import { Layout, Menu } from 'antd';
import React from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import '../theme/layout.less';
const { Sider } = Layout;
const menuItems = [
{ key: '/', icon: <HomeOutlined />, label: 'Home' },
{ key: '/about', icon: <InfoCircleOutlined />, label: 'About' },
{ key: '/settings', icon: <SettingOutlined />, label: 'Settings' },
];
interface SidebarProps {
collapsed: boolean;
onCollapse: (collapsed: boolean) => void;
}
const Sidebar: React.FC<SidebarProps> = ({ collapsed, onCollapse }) => {
const navigate = useNavigate();
const location = useLocation();
return (
<Sider collapsible collapsed={collapsed} onCollapse={onCollapse}>
<Menu
theme="dark"
mode="inline"
selectedKeys={[location.pathname]}
items={menuItems}
onClick={(e) => navigate(e.key)}
/>
</Sider>
);
};
export default Sidebar;