From fb3ef58c8789f91e8600697521e6a6adb648556a Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 4 Apr 2021 23:12:35 +0800 Subject: ... --- FrontEnd/src/app/views/timeline-common/Timeline.tsx | 20 ++++++++++---------- .../src/app/views/timeline-common/TimelineTop.tsx | 12 ++++++++---- .../app/views/timeline-common/timeline-common.sass | 9 +++++++++ 3 files changed, 27 insertions(+), 14 deletions(-) (limited to 'FrontEnd/src') diff --git a/FrontEnd/src/app/views/timeline-common/Timeline.tsx b/FrontEnd/src/app/views/timeline-common/Timeline.tsx index f2c38aeb..f7f7dcfc 100644 --- a/FrontEnd/src/app/views/timeline-common/Timeline.tsx +++ b/FrontEnd/src/app/views/timeline-common/Timeline.tsx @@ -73,22 +73,22 @@ const Timeline: React.FC = (props) => { }, [timelineName, reloadKey]); React.useEffect(() => { - if (Array.isArray(posts)) { + if (state === "loaded") { onLoad?.(); } - }, [posts, onLoad]); + }, [state, onLoad]); switch (state) { case "loading": return ( -
- -
+ ); case "offline": return ( diff --git a/FrontEnd/src/app/views/timeline-common/TimelineTop.tsx b/FrontEnd/src/app/views/timeline-common/TimelineTop.tsx index 6ee4e3e6..6382d2c5 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelineTop.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelineTop.tsx @@ -1,21 +1,25 @@ import React from "react"; +import clsx from "clsx"; import TimelineLine, { TimelineLineProps } from "./TimelineLine"; export interface TimelineTopProps { height?: number | string; lineProps?: TimelineLineProps; - children?: React.ReactElement; + className?: string; + style?: React.CSSProperties; } const TimelineTop: React.FC = (props) => { - const { height, children } = props; + const { height, style, className } = props; const lineProps = props.lineProps ?? { center: "none" }; return ( -
+
- {children}
); }; diff --git a/FrontEnd/src/app/views/timeline-common/timeline-common.sass b/FrontEnd/src/app/views/timeline-common/timeline-common.sass index 5f329d1f..e634e77e 100644 --- a/FrontEnd/src/app/views/timeline-common/timeline-common.sass +++ b/FrontEnd/src/app/views/timeline-common/timeline-common.sass @@ -37,6 +37,15 @@ $timeline-line-color-current: #36c2e6 to transform: rotate(1turn) +@keyframes timeline-top-loading-enter + from + transform: translate(0, -100%) + + to + +.timeline-top-loading-enter + animation: 1s timeline-top-loading-enter + .timeline-line display: flex flex-direction: column -- cgit v1.2.3