增加事件的分享功能
This commit is contained in:
@@ -16,6 +16,7 @@ import dayjs from 'dayjs';
|
||||
import { Eye } from 'lucide-react';
|
||||
import StockChangeIndicators from '../StockChangeIndicators';
|
||||
import { EventFollowButton } from '@views/Community/components/EventCard/atoms';
|
||||
import ShareButton from '@components/ShareButton';
|
||||
|
||||
/**
|
||||
* 事件头部信息区组件
|
||||
@@ -70,27 +71,39 @@ const EventHeaderInfo = ({ event, importance, isFollowing, followerCount, onTogg
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* 第一行:标题 + 关注按钮 */}
|
||||
{/* 第一行:标题 + 关注按钮 + 分享按钮 */}
|
||||
<Flex align="center" justify="space-between" mb={3} gap={4}>
|
||||
{/* 标题 */}
|
||||
<Heading size="md" color={headingColor} flex={1}>
|
||||
{event.title}
|
||||
</Heading>
|
||||
|
||||
{/* 关注按钮 */}
|
||||
<EventFollowButton
|
||||
isFollowing={isFollowing}
|
||||
followerCount={followerCount}
|
||||
onToggle={onToggleFollow}
|
||||
size="sm"
|
||||
showCount={true}
|
||||
/>
|
||||
<HStack spacing={2}>
|
||||
{/* 关注按钮 */}
|
||||
<EventFollowButton
|
||||
isFollowing={isFollowing}
|
||||
followerCount={followerCount}
|
||||
onToggle={onToggleFollow}
|
||||
size="sm"
|
||||
showCount={true}
|
||||
/>
|
||||
|
||||
{/* 分享按钮 */}
|
||||
<ShareButton
|
||||
title={event.title}
|
||||
desc={event.description?.slice(0, 100) || ''}
|
||||
link={`${window.location.origin}/community?event=${event.id}`}
|
||||
imgUrl={`${window.location.origin}/logo192.png`}
|
||||
variant="icon"
|
||||
size="sm"
|
||||
/>
|
||||
</HStack>
|
||||
</Flex>
|
||||
{/* 第二行:浏览数 + 日期 */}
|
||||
<Flex align="left" mb={3} gap={4}>
|
||||
{/* 浏览数 */}
|
||||
<HStack spacing={1}>
|
||||
<Eye color="gray.400" size={16} />
|
||||
<Icon as={Eye} boxSize={4} color="gray.400" />
|
||||
<Text fontSize="sm" color="gray.400" whiteSpace="nowrap">
|
||||
{(event.view_count || 0).toLocaleString()}次浏览
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user