From 6775b254270c8c7aaaee641181ad43e5558c0356 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 3 Sep 2020 21:10:58 +0800 Subject: ... --- .../src/app/views/timeline/TimelineInfoCard.tsx | 108 +++++++++++++-------- 1 file changed, 65 insertions(+), 43 deletions(-) (limited to 'Timeline/ClientApp/src/app/views/timeline') diff --git a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx index 9f989148..764910aa 100644 --- a/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx +++ b/Timeline/ClientApp/src/app/views/timeline/TimelineInfoCard.tsx @@ -8,6 +8,8 @@ import { timelineVisibilityTooltipTranslationMap } from "@/services/timeline"; import BlobImage from "../common/BlobImage"; import { TimelineCardComponentProps } from "../timeline-common/TimelinePageTemplateUI"; +import CollapseButton from "../timeline-common/CollapseButton"; +import SyncStatusBadge from "../timeline-common/SyncStatusBadge"; export type OrdinaryTimelineManageItem = "delete"; @@ -16,55 +18,75 @@ export type TimelineInfoCardProps = TimelineCardComponentProps< >; const TimelineInfoCard: React.FC = (props) => { - const { onMember, onManage } = props; + const { + timeline, + onMember, + onManage, + collapse, + syncStatus, + toggleCollapse, + } = props; const { t } = useTranslation(); - const avatar = useAvatar(props.timeline.owner.username); + const avatar = useAvatar(timeline?.owner?.username); return ( -
-

- {props.timeline.name} -

-
- - {props.timeline.owner.nickname} - - @{props.timeline.owner.username} - +
+
+ +
-

{props.timeline.description}

- - {t(timelineVisibilityTooltipTranslationMap[props.timeline.visibility])} - -
- {onManage != null ? ( - - - {t("timeline.manage")} - - - onManage("property")}> - {t("timeline.manageItem.property")} - - - {t("timeline.manageItem.member")} - - - onManage("delete")} - > - {t("timeline.manageItem.delete")} - - - - ) : ( - - )} + +
+

+ {timeline.name} +

+
+ + {timeline.owner.nickname} + + @{timeline.owner.username} + +
+

{timeline.description}

+ + {t(timelineVisibilityTooltipTranslationMap[timeline.visibility])} + +
+ {onManage != null ? ( + + + {t("timeline.manage")} + + + onManage("property")}> + {t("timeline.manageItem.property")} + + + {t("timeline.manageItem.member")} + + + onManage("delete")} + > + {t("timeline.manageItem.delete")} + + + + ) : ( + + )} +
); -- cgit v1.2.3