feat: 股票涨跌幅指标组件

This commit is contained in:
zdl
2025-11-05 16:49:04 +08:00
parent ca52d3bd87
commit 4c08ef57ff

View File

@@ -95,7 +95,6 @@ const StockChangeIndicators = ({
flexDirection={isLarge ? "column" : "row"} flexDirection={isLarge ? "column" : "row"}
alignItems={isLarge ? "flex-start" : "center"} alignItems={isLarge ? "flex-start" : "center"}
gap={isLarge ? 2 : 1} gap={isLarge ? 2 : 1}
flex="1"
maxW={isLarge ? "200px" : "none"} maxW={isLarge ? "200px" : "none"}
> >
{/* Large 模式:标签单独一行 */} {/* Large 模式:标签单独一行 */}
@@ -118,7 +117,7 @@ const StockChangeIndicators = ({
{/* 数字 */} {/* 数字 */}
<Text <Text
fontSize={isLarge ? "2xl" : "xs"} fontSize={isLarge ? "2xl" : "lg"}
fontWeight="bold" fontWeight="bold"
color={numberColor} color={numberColor}
lineHeight="1.2" lineHeight="1.2"
@@ -126,7 +125,7 @@ const StockChangeIndicators = ({
> >
{/* Default 模式:标签和数字在同一行 */} {/* Default 模式:标签和数字在同一行 */}
{!isLarge && ( {!isLarge && (
<Text as="span" color={labelColor} fontWeight="medium" fontSize="xs"> <Text as="span" color={labelColor} fontWeight="medium" fontSize="sm">
{label} {label}
</Text> </Text>
)} )}
@@ -143,7 +142,7 @@ const StockChangeIndicators = ({
} }
return ( return (
<Flex width="100%" justify="space-between" align="center" gap={isLarge ? 4 : 1}> <Flex width="fit-content" justify="flex-start" align="center" gap={isLarge ? 4 : 1}>
{renderIndicator('平均涨幅', avgChange)} {renderIndicator('平均涨幅', avgChange)}
{renderIndicator('最大涨幅', maxChange)} {renderIndicator('最大涨幅', maxChange)}
{renderIndicator('周涨幅', weekChange)} {renderIndicator('周涨幅', weekChange)}