feat: migrate icons from custom SVGs and MUI to Lucide React
Replace custom SVG icons and @mui/icons-material with lucide-react for consistent, lightweight icon management across the application. ## Changes - Add lucide-react package and remove @mui/icons-material - Create theme-aware Icon wrapper component with color resolution - Create iconMap.js for legacy icon name mappings - Migrate 64 components to use new Icon component - Remove 74 unused SVG files from assets/icons/ ## Benefits - Consistent icon API across the application - Smaller bundle size with tree-shakeable imports - Theme-aware color support via MUI theme paths - Simpler maintenance with single icon library
This commit is contained in:
1 parent
b5caabed20
commit
ba0c89fc6c
140 files changed
+421
-746
No files matched your search
@@ -1,9 +1,8 @@
|
||||
// Components
|
||||
import { Box, Stack, Typography, Button } from "@mui/material";
|
||||
import Image from "@/Components/v1/Image/index.jsx";
|
||||
import SettingsIcon from "@/assets/icons/settings-bold.svg?react";
|
||||
import Icon from "@/Components/v1/Icon";
|
||||
import ThemeSwitch from "@/Components/v1/ThemeSwitch/index.jsx";
|
||||
import ArrowOutwardIcon from "@mui/icons-material/ArrowOutward";
|
||||
//Utils
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
@@ -46,7 +45,7 @@ const Controls = ({ url, type }) => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<SettingsIcon /> {t("configure")}
|
||||
<Icon name="Settings" size={18} style={{ marginRight: '8px' }} /> {t("configure")}
|
||||
</Button>
|
||||
</Box>
|
||||
</Stack>
|
||||
@@ -111,7 +110,7 @@ const ControlsHeader = ({ statusPage, isPublic, url, type = "uptime" }) => {
|
||||
}}
|
||||
>
|
||||
<Typography>{t("publicLink")}</Typography>
|
||||
<ArrowOutwardIcon />
|
||||
<Icon name="ExternalLink" size={18} />
|
||||
</Stack>
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Components
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
import CheckCircleIcon from "@mui/icons-material/CheckCircle";
|
||||
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
|
||||
import Icon from "@/Components/v1/Icon";
|
||||
|
||||
// Utils
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
@@ -10,18 +9,14 @@ import PropTypes from "prop-types";
|
||||
const getMonitorStatus = (monitors, theme) => {
|
||||
const monitorsStatus = {
|
||||
icon: (
|
||||
<ErrorOutlineIcon
|
||||
sx={{ color: theme.palette.primary.contrastTextSecondaryDarkBg }}
|
||||
/>
|
||||
<Icon name="AlertTriangle" size={24} color="primary.contrastTextSecondaryDarkBg" />
|
||||
),
|
||||
};
|
||||
if (monitors.every((monitor) => monitor.status === true)) {
|
||||
monitorsStatus.msg = "All systems operational";
|
||||
monitorsStatus.color = theme.palette.success.lowContrast;
|
||||
monitorsStatus.icon = (
|
||||
<CheckCircleIcon
|
||||
sx={{ color: theme.palette.primary.contrastTextSecondaryDarkBg }}
|
||||
/>
|
||||
<Icon name="CheckCircle2" size={24} color="primary.contrastTextSecondaryDarkBg" />
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user