事件中心UI优化

This commit is contained in:
2025-11-07 10:56:08 +08:00
parent 2a122b0013
commit 3eff0554f9
7 changed files with 219 additions and 77 deletions

View File

@@ -18,6 +18,7 @@ import { StarIcon } from '@chakra-ui/icons';
import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart';
import MiniKLineChart from './MiniKLineChart';
import StockChartModal from '../../../../components/StockChart/StockChartModal';
import { getChangeColor } from '../../../../utils/colorUtils';
/**
* 股票卡片组件
@@ -66,12 +67,7 @@ const StockListItem = ({
return `${prefix}${parseFloat(value).toFixed(2)}%`;
};
// 获取涨跌幅颜色
const getChangeColor = (value) => {
const num = parseFloat(value);
if (isNaN(num) || num === 0) return 'gray.500';
return num > 0 ? 'red.500' : 'green.500';
};
// 使用工具函数获取涨跌幅颜色(已从 colorUtils 导入)
// 获取涨跌幅数据(优先使用 quotefallback 到 stock
const change = quote?.change ?? stock.daily_change ?? null;