feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
||||
theme,
|
||||
} from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TableEmpty from '../common/table/TableEmpty';
|
||||
import {
|
||||
ConsoleSearchContext,
|
||||
useConsolePage,
|
||||
@@ -41,13 +42,17 @@ const classes = (base, extra) => [base, extra].filter(Boolean).join(' ');
|
||||
|
||||
export function ConsoleAlert({ className, style, type = 'info', ...props }) {
|
||||
const { token } = theme.useToken();
|
||||
const semantic = type[0].toUpperCase() + type.slice(1);
|
||||
const isSettings = useConsolePage()?.page.key === 'setting';
|
||||
const semantic = isSettings ? 'Info' : type[0].toUpperCase() + type.slice(1);
|
||||
return (
|
||||
<Alert
|
||||
{...props}
|
||||
type={type}
|
||||
showIcon
|
||||
className={classes('console-alert', className)}
|
||||
className={classes(
|
||||
isSettings ? 'console-alert console-alert--settings' : 'console-alert',
|
||||
className,
|
||||
)}
|
||||
style={{
|
||||
...style,
|
||||
marginBlock: style?.marginBlock ?? '0 16px',
|
||||
@@ -56,6 +61,9 @@ export function ConsoleAlert({ className, style, type = 'info', ...props }) {
|
||||
background: token[`color${semantic}Bg`],
|
||||
borderColor: token[`color${semantic}Border`],
|
||||
color: token.colorText,
|
||||
...(isSettings
|
||||
? { '--settings-alert-icon-color': token.colorInfo }
|
||||
: {}),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
@@ -135,15 +143,17 @@ export const ConsoleTable = forwardRef(function ConsoleTable(
|
||||
{ className, scroll, locale, size = 'middle', ...props },
|
||||
ref,
|
||||
) {
|
||||
const isSettings = useConsolePage()?.page.key === 'setting';
|
||||
return (
|
||||
<Table
|
||||
{...props}
|
||||
ref={ref}
|
||||
size={size}
|
||||
size={isSettings ? 'middle' : size}
|
||||
scroll={{ x: 'max-content', ...scroll }}
|
||||
locale={{
|
||||
emptyText: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />,
|
||||
...locale,
|
||||
...(isSettings ? { emptyText: <TableEmpty /> } : {}),
|
||||
}}
|
||||
className={classes('console-table', className)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user