diff --git a/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js b/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js index 2eb1ea34..b7c35204 100644 --- a/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js +++ b/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js @@ -2,13 +2,15 @@ // 精简模式股票卡片组件(浮动卡片样式) import React from 'react'; +import { useSelector } from 'react-redux'; import { Box, Text, Tooltip, useColorModeValue, } from '@chakra-ui/react'; -import { getChangeColor, getChangeBackgroundGradient, getChangeBorderColor } from '../../../../utils/colorUtils'; +import { selectIsMobile } from '@store/slices/deviceSlice'; +import { getChangeColor, getChangeBackgroundGradient, getChangeBorderColor } from '@utils/colorUtils'; /** * 精简模式股票卡片组件 @@ -17,6 +19,7 @@ import { getChangeColor, getChangeBackgroundGradient, getChangeBorderColor } fro * @param {Object} props.quote - 股票行情数据(可选) */ const CompactStockItem = ({ stock, quote = null }) => { + const isMobile = useSelector(selectIsMobile); const nameColor = useColorModeValue('gray.700', 'gray.300'); const handleViewDetail = () => { @@ -45,10 +48,10 @@ const CompactStockItem = ({ stock, quote = null }) => { > { }} transition="all 0.3s ease-in-out" display="inline-block" - minW="150px" + minW="100px" > {/* 股票代码 */} {stock.stock_code} @@ -84,7 +87,7 @@ const CompactStockItem = ({ stock, quote = null }) => { {/* 涨跌幅 - 超大号显示 */} { {/* 股票名称(小字) */} { return ( { {/* 第二行:相关度 + 涨跌幅 */} - + {/* 相关度标签 */} - + 相关度: {relevanceScore}% @@ -87,8 +87,8 @@ const SimpleConceptCard = ({ concept, onClick, getRelevanceColor }) => { {changePct !== null && (