From 17272858aaf09eac5a3550b23e97f8d339847bd9 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 13 Feb 2021 16:18:50 +0800 Subject: ... --- .../views/timeline-common/TimelinePageTemplateUI.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx') diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx index b0d3fe97..48263486 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx @@ -7,7 +7,7 @@ import { getAlertHost } from "@/services/alert"; import { HttpTimelineInfo } from "@/http/timeline"; import Timeline from "./Timeline"; -import TimelinePostEdit, { TimelinePostSendCallback } from "./TimelinePostEdit"; +import TimelinePostEdit from "./TimelinePostEdit"; export interface TimelineCardComponentProps { timeline: HttpTimelineInfo; @@ -25,16 +25,17 @@ export interface TimelinePageTemplateUIOperations { onMember: () => void; onBookmark?: () => void; onHighlight?: () => void; - onPost?: TimelinePostSendCallback; } export interface TimelinePageTemplateUIProps { - timeline?: + timeline: | (HttpTimelineInfo & { operations: TimelinePageTemplateUIOperations; }) | "notexist" - | "offline"; + | "offline" + | "loading" + | "error"; notExistMessageI18nKey: string; CardComponent: React.ComponentType>; } @@ -90,7 +91,7 @@ export default function TimelinePageTemplateUI( let body: React.ReactElement; - if (timeline == null) { + if (timeline == "loading") { body = (
@@ -101,6 +102,9 @@ export default function TimelinePageTemplateUI( body =

Offline!

; } else if (timeline === "notexist") { body =

{t(props.notExistMessageI18nKey)}

; + } else if (timeline === "error") { + // TODO: i18n + body =

Error!

; } else { const { operations } = timeline; body = ( @@ -120,7 +124,7 @@ export default function TimelinePageTemplateUI( >
- {operations.onPost != null ? ( + {timeline.postable ? ( <>
( /> -- cgit v1.2.3