refactor: 大量前端页面/组件样式从硬编码颜色迁移到 antd token 主题变量
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Modal, Button, Card, Statistic, Row, Col, message } from 'antd';
|
||||
import { Modal, Button, Card, Statistic, Row, Col, message, theme } from 'antd';
|
||||
import { CheckOutlined, CloseOutlined, SwapOutlined } from '@ant-design/icons';
|
||||
import ReactDiffViewer from 'react-diff-viewer-continued';
|
||||
|
||||
@@ -26,6 +26,7 @@ const ChapterContentComparison: React.FC<ChapterContentComparisonProps> = ({
|
||||
onApply,
|
||||
onDiscard
|
||||
}) => {
|
||||
const { token } = theme.useToken();
|
||||
const [applying, setApplying] = useState(false);
|
||||
const [viewMode, setViewMode] = useState<'split' | 'unified'>('split');
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
@@ -195,7 +196,7 @@ const ChapterContentComparison: React.FC<ChapterContentComparisonProps> = ({
|
||||
styles={{
|
||||
variables: {
|
||||
light: {
|
||||
diffViewerBackground: '#fff', // Keep white for diff viewer readability
|
||||
diffViewerBackground: token.colorBgContainer,
|
||||
addedBackground: 'var(--color-success-bg)',
|
||||
addedColor: 'var(--color-text-primary)',
|
||||
removedBackground: 'var(--color-error-bg)',
|
||||
|
||||
Reference in New Issue
Block a user