From 25d4831aac40f5438d91d8a303af930e0d97cb2d Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 13 Apr 2021 18:29:38 +0800 Subject: ... --- .../src/app/views/timeline-common/TimelinePostView.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePostView.tsx') diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePostView.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePostView.tsx index 4cafdaa0..4f9c6e97 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelinePostView.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelinePostView.tsx @@ -30,6 +30,21 @@ const TimelinePostView: React.FC = (props) => { ] = React.useState(false); const [deleteDialog, setDeleteDialog] = React.useState(false); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const cardRef = React.useRef(null!); + React.useEffect(() => { + const cardIntersectionObserver = new IntersectionObserver(([e]) => { + if (e.isIntersecting) { + cardRef.current.style.animationName = "timeline-post-enter"; + } + }); + cardIntersectionObserver.observe(cardRef.current); + + return () => { + cardIntersectionObserver.disconnect(); + }; + }, []); + return (
= (props) => { style={style} > -
+
{post.editable ? (