feat: UI调整

This commit is contained in:
zdl
2025-10-31 16:29:11 +08:00
parent 14db374820
commit 2d936ca1c7
2 changed files with 32 additions and 3 deletions

View File

@@ -22,6 +22,11 @@ const StockChangeIndicators = ({
return useColorModeValue('gray.700', 'gray.400');
}
// 0值使用中性灰色
if (value === 0) {
return 'gray.700';
}
const absValue = Math.abs(value);
const isPositive = value > 0;
@@ -48,6 +53,11 @@ const StockChangeIndicators = ({
return useColorModeValue('gray.100', 'gray.700');
}
// 0值使用中性灰色背景
if (value === 0) {
return useColorModeValue('gray.100', 'gray.700');
}
const absValue = Math.abs(value);
const isPositive = value > 0;
@@ -74,6 +84,11 @@ const StockChangeIndicators = ({
return useColorModeValue('gray.300', 'gray.600');
}
// 0值使用中性灰色边框
if (value === 0) {
return useColorModeValue('gray.300', 'gray.600');
}
const absValue = Math.abs(value);
const isPositive = value > 0;
@@ -99,7 +114,8 @@ const StockChangeIndicators = ({
if (value == null) return null;
const sign = value > 0 ? '+' : '';
const numStr = Math.abs(value).toFixed(1);
// 0值显示为 "0",其他值显示一位小数
const numStr = value === 0 ? '0' : Math.abs(value).toFixed(1);
const numberColor = getNumberColor(value);
const bgColor = getBgColor(value);
const borderColor = getBorderColor(value);