添加用户的看多/看空逻辑

This commit is contained in:
2025-12-25 13:40:11 +08:00
parent 448fe52431
commit ed75f1789e
2 changed files with 16 additions and 15 deletions

View File

@@ -252,17 +252,17 @@ const HorizontalDynamicNewsEventCard = React.memo(({
</Box> </Box>
</Tooltip> </Tooltip>
{/* 第二行:涨跌幅数据 */} {/* 第二行:涨跌幅数据 + 互动指标(右侧) */}
<StockChangeIndicators <HStack justify="space-between" align="center" w="full">
maxChange={event.related_max_chg} <StockChangeIndicators
avgChange={event.related_avg_chg} maxChange={event.related_max_chg}
expectationScore={event.expectation_surprise_score} avgChange={event.related_avg_chg}
size={indicatorSize} expectationScore={event.expectation_surprise_score}
/> size={indicatorSize}
/>
{/* 第三行:互动指标 - 独立一行更醒目 */} {/* 互动指标放右侧 */}
{showEngagement && ( {showEngagement && (
<Box mt={0.5}>
<EventEngagement <EventEngagement
eventId={event.id} eventId={event.id}
viewCount={event.view_count} viewCount={event.view_count}
@@ -270,11 +270,11 @@ const HorizontalDynamicNewsEventCard = React.memo(({
bullishCount={event.bullish_count} bullishCount={event.bullish_count}
bearishCount={event.bearish_count} bearishCount={event.bearish_count}
userVote={event.user_vote} userVote={event.user_vote}
size="sm" size="md"
onVoteChange={onVoteChange} onVoteChange={onVoteChange}
/> />
</Box> )}
)} </HStack>
</VStack> </VStack>
</CardBody> </CardBody>
</Card> </Card>

View File

@@ -52,9 +52,10 @@ const EventEngagement = ({
const sizeConfig = { const sizeConfig = {
xs: { fontSize: '10px', iconSize: 12, spacing: 1.5, pillPx: 2, pillPy: 0.5 }, xs: { fontSize: '10px', iconSize: 12, spacing: 1.5, pillPx: 2, pillPy: 0.5 },
sm: { fontSize: '11px', iconSize: 14, spacing: 2, pillPx: 2.5, pillPy: 1 }, sm: { fontSize: '11px', iconSize: 14, spacing: 2, pillPx: 2.5, pillPy: 1 },
md: { fontSize: '12px', iconSize: 16, spacing: 2.5, pillPx: 3, pillPy: 1.5 }, md: { fontSize: '13px', iconSize: 18, spacing: 3, pillPx: 3, pillPy: 1.5 },
lg: { fontSize: '14px', iconSize: 20, spacing: 3.5, pillPx: 3.5, pillPy: 2 },
}; };
const config = sizeConfig[size] || sizeConfig.sm; const config = sizeConfig[size] || sizeConfig.md;
const handleVote = useCallback(async (voteType) => { const handleVote = useCallback(async (voteType) => {
if (!isLoggedIn) { if (!isLoggedIn) {