feat: UI调整
This commit is contained in:
@@ -90,13 +90,15 @@ const StockChangeIndicators = ({
|
||||
borderWidth={isLarge ? "2px" : "1px"}
|
||||
borderColor={borderColor}
|
||||
borderRadius="md"
|
||||
px={isLarge ? 4 : (isDefault ? 2 : (isComfortable ? 3 : 2))}
|
||||
px={isLarge ? 4 : (isDefault ? 1.5 : (isComfortable ? 3 : 2))}
|
||||
py={isLarge ? 3 : (isDefault ? 1.5 : (isComfortable ? 2 : 1))}
|
||||
display="flex"
|
||||
flexDirection={(isLarge || isDefault) ? "column" : "row"}
|
||||
alignItems={(isLarge || isDefault) ? "flex-start" : "center"}
|
||||
gap={(isLarge || isDefault) ? (isLarge ? 2 : 1) : 1}
|
||||
maxW={isLarge ? "200px" : (isDefault ? "120px" : "none")}
|
||||
maxW={isLarge ? "200px" : "none"}
|
||||
flex="0 1 auto"
|
||||
minW="0"
|
||||
>
|
||||
{/* Large 和 Default 模式:标签单独一行 */}
|
||||
{(isLarge || isDefault) && (
|
||||
@@ -111,14 +113,14 @@ const StockChangeIndicators = ({
|
||||
{value !== 0 && (
|
||||
value > 0 ? (
|
||||
<TriangleUpIcon
|
||||
w={isLarge ? 4 : (isDefault ? 3 : 2)}
|
||||
h={isLarge ? 4 : (isDefault ? 3 : 2)}
|
||||
w={2}
|
||||
h={2}
|
||||
color={numberColor}
|
||||
/>
|
||||
) : (
|
||||
<TriangleDownIcon
|
||||
w={isLarge ? 4 : (isDefault ? 3 : 2)}
|
||||
h={isLarge ? 4 : (isDefault ? 3 : 2)}
|
||||
w={2}
|
||||
h={2}
|
||||
color={numberColor}
|
||||
/>
|
||||
)
|
||||
@@ -131,6 +133,8 @@ const StockChangeIndicators = ({
|
||||
color={numberColor}
|
||||
lineHeight="1.2"
|
||||
whiteSpace="nowrap"
|
||||
overflow="hidden"
|
||||
textOverflow="ellipsis"
|
||||
>
|
||||
{/* Comfortable 模式:标签和数字在同一行 */}
|
||||
{!isLarge && !isDefault && (
|
||||
@@ -138,7 +142,8 @@ const StockChangeIndicators = ({
|
||||
{label}
|
||||
</Text>
|
||||
)}
|
||||
{sign}{numStr}%
|
||||
{sign}{numStr}
|
||||
<Text as="span" fontWeight="medium" fontSize="sm">%</Text>
|
||||
</Text>
|
||||
</Flex>
|
||||
</Box>
|
||||
@@ -151,7 +156,7 @@ const StockChangeIndicators = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<Flex width="fit-content" justify="flex-start" align="center" gap={isLarge ? 4 : (isDefault ? 2 : 1)}>
|
||||
<Flex width="100%" justify="flex-start" align="center" gap={isLarge ? 4 : (isDefault ? 2 : 1)}>
|
||||
{renderIndicator('平均涨幅', avgChange)}
|
||||
{renderIndicator('最大涨幅', maxChange)}
|
||||
{renderIndicator('周涨幅', weekChange)}
|
||||
|
||||
Reference in New Issue
Block a user