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