refactor: 移除暗色模式相关代码,使用固定浅色主题
- DeepAnalysisTab: 移除 useColorModeValue,使用固定颜色值 - NewsEventsTab: 移除 useColorModeValue,简化 hover 颜色 - FinancialPanorama: 移除 useColorMode/useColorModeValue - MarketDataView: 移除 dark 主题配置,简化颜色逻辑 - StockQuoteCard: 移除 useColorModeValue,使用固定颜色 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,6 @@ import {
|
||||
VStack,
|
||||
HStack,
|
||||
Divider,
|
||||
useColorModeValue,
|
||||
Select,
|
||||
Button,
|
||||
Tooltip,
|
||||
@@ -60,7 +59,6 @@ import {
|
||||
ButtonGroup,
|
||||
Stack,
|
||||
Collapse,
|
||||
useColorMode,
|
||||
} from '@chakra-ui/react';
|
||||
import {
|
||||
ChevronDownIcon,
|
||||
@@ -101,14 +99,13 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
||||
const [modalContent, setModalContent] = useState(null);
|
||||
const [expandedRows, setExpandedRows] = useState({});
|
||||
const toast = useToast();
|
||||
const { colorMode } = useColorMode();
|
||||
|
||||
|
||||
// 颜色配置(中国市场:红涨绿跌)
|
||||
const bgColor = useColorModeValue('white', 'gray.800');
|
||||
const borderColor = useColorModeValue('gray.200', 'gray.600');
|
||||
const hoverBg = useColorModeValue('gray.50', 'gray.700');
|
||||
const positiveColor = useColorModeValue('red.500', 'red.400'); // 红涨
|
||||
const negativeColor = useColorModeValue('green.500', 'green.400'); // 绿跌
|
||||
const bgColor = 'white';
|
||||
const borderColor = 'gray.200';
|
||||
const hoverBg = 'gray.50';
|
||||
const positiveColor = 'red.500'; // 红涨
|
||||
const negativeColor = 'green.500'; // 绿跌
|
||||
|
||||
// 加载所有财务数据
|
||||
const loadFinancialData = async () => {
|
||||
@@ -492,7 +489,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
||||
<React.Fragment key={section.key}>
|
||||
{section.title !== '资产总计' && section.title !== '负债合计' && (
|
||||
<Tr
|
||||
bg={useColorModeValue('gray.50', 'gray.700')}
|
||||
bg="gray.50"
|
||||
cursor="pointer"
|
||||
onClick={() => toggleSection(section.key)}
|
||||
>
|
||||
@@ -515,7 +512,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
||||
key={metric.key}
|
||||
_hover={{ bg: hoverBg, cursor: 'pointer' }}
|
||||
onClick={() => showMetricChart(metric.name, metric.key, balanceSheet, metric.path)}
|
||||
bg={metric.isTotal ? useColorModeValue('blue.50', 'blue.900') : 'transparent'}
|
||||
bg={metric.isTotal ? 'blue.50' : 'transparent'}
|
||||
>
|
||||
<Td position="sticky" left={0} bg={bgColor} zIndex={1}>
|
||||
<HStack spacing={2}>
|
||||
@@ -733,7 +730,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
||||
const renderSection = (section) => (
|
||||
<React.Fragment key={section.key}>
|
||||
<Tr
|
||||
bg={useColorModeValue('gray.50', 'gray.700')}
|
||||
bg="gray.50"
|
||||
cursor="pointer"
|
||||
onClick={() => toggleSection(section.key)}
|
||||
>
|
||||
@@ -755,8 +752,8 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
||||
key={metric.key}
|
||||
_hover={{ bg: hoverBg, cursor: 'pointer' }}
|
||||
onClick={() => showMetricChart(metric.name, metric.key, incomeStatement, metric.path)}
|
||||
bg={metric.isTotal ? useColorModeValue('blue.50', 'blue.900') :
|
||||
metric.isSubtotal ? useColorModeValue('orange.50', 'orange.900') : 'transparent'}
|
||||
bg={metric.isTotal ? 'blue.50' :
|
||||
metric.isSubtotal ? 'orange.50' : 'transparent'}
|
||||
>
|
||||
<Td position="sticky" left={0} bg={bgColor} zIndex={1}>
|
||||
<HStack spacing={2}>
|
||||
@@ -1268,7 +1265,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
||||
{ label: '资产负债率', value: financialMetrics[0].solvency?.asset_liability_ratio, format: 'percent' },
|
||||
{ label: '研发费用率', value: financialMetrics[0].expense_ratios?.rd_expense_ratio, format: 'percent' },
|
||||
].map((item, idx) => (
|
||||
<Box key={idx} p={3} borderRadius="md" bg={useColorModeValue('gray.50', 'gray.700')}>
|
||||
<Box key={idx} p={3} borderRadius="md" bg="gray.50">
|
||||
<Text fontSize="xs" color="gray.500">{item.label}</Text>
|
||||
<Text fontSize="lg" fontWeight="bold">
|
||||
{item.format === 'percent' ?
|
||||
|
||||
Reference in New Issue
Block a user