2.7 KiB
2.7 KiB
Material-UI Migration Summary
This document outlines the migration of the Altarra app from Tailwind CSS to Material-UI (MUI).
Dependencies Added
@mui/material@^5.14.20@mui/icons-material@^5.14.20@emotion/react@^11.11.1@emotion/styled@^11.11.0
Changes Made
1. Theme Setup
- Created
src/context/ThemeProvider.tsx- Custom MUI theme with:- Primary color:
#006600(green) - Secondary color:
#FF0000(red) - Custom typography and component overrides
- Primary color:
2. Layout
- Updated
src/app/layout.tsxto:- Use
ThemeProviderwrapper - Remove Tailwind CSS import
- Use MUI
Boxfor flex layouts
- Use
3. Component Migration
FormField.tsx
- Replaced custom input with
TextFieldcomponent - Automatic error handling with
helperTextprop - Integrated label and validation styling
SubmitButton.tsx
- Replaced custom button with
Buttoncomponent - Used
startIconfor loading spinner (CircularProgress) - Automatic disabled state styling
StatusMessage.tsx
- Replaced custom alerts with
Alertcomponent - Automatic severity-based styling (success, error, info)
IdentityForm.tsx
- Used
Boxcomponent for form wrapper - Used
Typographyfor headings - FormField components integrated
RackHeightsForm.tsx
- Replaced form inputs with FormField components
- Used
Alertfor success message - Used
Buttonfor secondary actions - Replaced custom spinner with MUI
CircularProgress
HomePage.tsx
- Used
Box,Paper,Typography, andButtoncomponents - Language toggle buttons use variant-based styling
- Logo and layout uses MUI's sx prop system
LandingPage.tsx
- Used
Papercomponent for card styling - Used
Buttonwith link functionality - Replaced Lucide icon with
OpenInNewIconfrom@mui/icons-material
Footer.tsx
- Used
Box,Typography, andContainercomponents - Maintained styling with MUI theming
Spinner.tsx
- Replaced custom spinner with
CircularProgresscomponent
Styling Approach
All components now use MUI's sx prop system, which provides:
- Type-safe styling
- Direct access to theme values
- Responsive design support
- Better performance
Migration Benefits
- Consistency: Unified design system across the app
- Accessibility: Better built-in a11y features
- Theming: Centralized theme management
- Components: Rich set of pre-built components
- Developer Experience: Better TypeScript support and IDE integration
Notes
- Tailwind CSS configuration can be safely removed if no longer needed
- The app maintains the same visual appearance and functionality
- All forms and interactive elements work as before
- Language switching is preserved
- Responsive design is maintained through MUI's breakpoint system