feat: 去掉antd

This commit is contained in:
2025-03-20 21:47:50 +08:00
parent c206add7eb
commit cfd263a1e7
36 changed files with 1369 additions and 769 deletions

View File

@@ -10,19 +10,30 @@ import { Redirect } from './modules/Redirect';
import { CustomThemeProvider } from '@kevisual/center-components/theme/index.tsx';
import { useTheme } from '@mui/material/styles';
import { ToastContainer } from 'react-toastify';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import 'dayjs/locale/en';
import zhCN from 'antd/locale/zh_CN';
import enUS from 'antd/locale/en_US';
import ConfigProvider from 'antd/es/config-provider';
import { useTranslation } from 'react-i18next';
import { useEffect, useState } from 'react';
const AntProvider = ({ children }: { children: React.ReactNode }) => {
const theme = useTheme();
const primaryColor = theme.palette.primary.main;
const secondaryColor = theme.palette.secondary.main;
const { i18n } = useTranslation();
const [locale, setLocale] = useState(zhCN);
useEffect(() => {
if (i18n.language === 'en') {
setLocale(enUS);
} else {
setLocale(zhCN);
}
}, [i18n.language]);
return (
<ConfigProvider
locale={zhCN}
locale={locale}
theme={{
token: {
colorPrimary: primaryColor,
@@ -43,7 +54,7 @@ const AntProvider = ({ children }: { children: React.ReactNode }) => {
},
Tooltip: {
zIndexPopupBase: 2000,
}
},
},
}}>
{children}