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
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:
5
frontend/src/Layout/Footer.tsx
Normal file
5
frontend/src/Layout/Footer.tsx
Normal 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>;
|
||||
};
|
||||
11
frontend/src/Layout/Header.tsx
Normal file
11
frontend/src/Layout/Header.tsx
Normal 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;
|
||||
38
frontend/src/Layout/Sidebar.tsx
Normal file
38
frontend/src/Layout/Sidebar.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user