community增加事件详情
This commit is contained in:
@@ -306,12 +306,7 @@ const DetailModal = ({ isOpen, onClose, selectedDate, ztDetail, events, loading
|
||||
const [detailDrawerVisible, setDetailDrawerVisible] = useState(false);
|
||||
const [selectedContent, setSelectedContent] = useState(null);
|
||||
|
||||
if (!selectedDate) return null;
|
||||
|
||||
const dateStr = `${selectedDate.getFullYear()}年${selectedDate.getMonth() + 1}月${selectedDate.getDate()}日`;
|
||||
const isPastDate = selectedDate < new Date(new Date().setHours(0, 0, 0, 0));
|
||||
|
||||
// 板块数据处理
|
||||
// 板块数据处理 - 必须在条件返回之前调用所有hooks
|
||||
const sectorList = useMemo(() => {
|
||||
if (!ztDetail?.sector_data) return [];
|
||||
return Object.entries(ztDetail.sector_data)
|
||||
@@ -323,6 +318,12 @@ const DetailModal = ({ isOpen, onClose, selectedDate, ztDetail, events, loading
|
||||
.sort((a, b) => b.count - a.count);
|
||||
}, [ztDetail]);
|
||||
|
||||
// 条件返回必须在所有hooks之后
|
||||
if (!selectedDate) return null;
|
||||
|
||||
const dateStr = `${selectedDate.getFullYear()}年${selectedDate.getMonth() + 1}月${selectedDate.getDate()}日`;
|
||||
const isPastDate = selectedDate < new Date(new Date().setHours(0, 0, 0, 0));
|
||||
|
||||
// 渲染重要性星级
|
||||
const renderStars = (star) => {
|
||||
const stars = [];
|
||||
|
||||
Reference in New Issue
Block a user