feat: 相关概念UI调整
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
Box,
|
|
||||||
HStack,
|
HStack,
|
||||||
Text,
|
Text,
|
||||||
useColorModeValue,
|
useColorModeValue,
|
||||||
@@ -18,8 +17,6 @@ import moment from 'moment';
|
|||||||
* @param {string|Object} props.eventTime - 事件发生时间
|
* @param {string|Object} props.eventTime - 事件发生时间
|
||||||
*/
|
*/
|
||||||
const TradingDateInfo = ({ effectiveTradingDate, eventTime }) => {
|
const TradingDateInfo = ({ effectiveTradingDate, eventTime }) => {
|
||||||
const sectionBg = useColorModeValue('gray.50', 'gray.750');
|
|
||||||
const headingColor = useColorModeValue('gray.700', 'gray.200');
|
|
||||||
const stockCountColor = useColorModeValue('gray.500', 'gray.400');
|
const stockCountColor = useColorModeValue('gray.500', 'gray.400');
|
||||||
|
|
||||||
if (!effectiveTradingDate) {
|
if (!effectiveTradingDate) {
|
||||||
@@ -27,11 +24,10 @@ const TradingDateInfo = ({ effectiveTradingDate, eventTime }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box mb={4} p={3} bg={sectionBg} borderRadius="md">
|
|
||||||
<HStack spacing={2}>
|
<HStack spacing={2}>
|
||||||
<FaCalendarAlt color="gray" />
|
<FaCalendarAlt color="gray" size={12} />
|
||||||
<Text fontSize="sm" color={headingColor}>
|
<Text fontSize="xs" color={stockCountColor}>
|
||||||
涨跌幅数据日期:{effectiveTradingDate}
|
涨跌幅数据:{effectiveTradingDate}
|
||||||
{eventTime && effectiveTradingDate !== moment(eventTime).format('YYYY-MM-DD') && (
|
{eventTime && effectiveTradingDate !== moment(eventTime).format('YYYY-MM-DD') && (
|
||||||
<Text as="span" ml={2} fontSize="xs" color={stockCountColor}>
|
<Text as="span" ml={2} fontSize="xs" color={stockCountColor}>
|
||||||
(事件发生于 {typeof eventTime === 'object' ? moment(eventTime).format('YYYY-MM-DD HH:mm') : moment(eventTime).format('YYYY-MM-DD HH:mm')},显示下一交易日数据)
|
(事件发生于 {typeof eventTime === 'object' ? moment(eventTime).format('YYYY-MM-DD HH:mm') : moment(eventTime).format('YYYY-MM-DD HH:mm')},显示下一交易日数据)
|
||||||
@@ -39,7 +35,6 @@ const TradingDateInfo = ({ effectiveTradingDate, eventTime }) => {
|
|||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</HStack>
|
</HStack>
|
||||||
</Box>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -204,9 +204,16 @@ const RelatedConceptsSection = ({ eventTitle, effectiveTradingDate, eventTime })
|
|||||||
<Box bg={sectionBg} p={3} borderRadius="md">
|
<Box bg={sectionBg} p={3} borderRadius="md">
|
||||||
{/* 标题栏 */}
|
{/* 标题栏 */}
|
||||||
<Flex justify="space-between" align="center" mb={3}>
|
<Flex justify="space-between" align="center" mb={3}>
|
||||||
|
<Flex align="center" gap={3}>
|
||||||
<Heading size="sm" color={headingColor}>
|
<Heading size="sm" color={headingColor}>
|
||||||
相关概念
|
相关概念
|
||||||
</Heading>
|
</Heading>
|
||||||
|
{/* 交易日期信息 */}
|
||||||
|
<TradingDateInfo
|
||||||
|
effectiveTradingDate={effectiveTradingDate}
|
||||||
|
eventTime={eventTime}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
@@ -230,11 +237,6 @@ const RelatedConceptsSection = ({ eventTitle, effectiveTradingDate, eventTime })
|
|||||||
))}
|
))}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
{/* 交易日期信息 */}
|
|
||||||
<TradingDateInfo
|
|
||||||
effectiveTradingDate={effectiveTradingDate}
|
|
||||||
eventTime={eventTime}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* 详细模式:卡片网格(可折叠) */}
|
{/* 详细模式:卡片网格(可折叠) */}
|
||||||
<Collapse in={isExpanded} animateOpacity>
|
<Collapse in={isExpanded} animateOpacity>
|
||||||
|
|||||||
Reference in New Issue
Block a user