diff options
author | crupest <crupest@outlook.com> | 2021-02-13 16:18:50 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-13 16:18:50 +0800 |
commit | 17272858aaf09eac5a3550b23e97f8d339847bd9 (patch) | |
tree | 2317d17f5f515d5c647c1bfcd32413b3529bc0ba /FrontEnd/src/app/views/timeline-common/TimelineCardTemplate.tsx | |
parent | a7cc64ca2b30b47c57cae2115e10f34f361c90b9 (diff) | |
download | timeline-17272858aaf09eac5a3550b23e97f8d339847bd9.tar.gz timeline-17272858aaf09eac5a3550b23e97f8d339847bd9.tar.bz2 timeline-17272858aaf09eac5a3550b23e97f8d339847bd9.zip |
...
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelineCardTemplate.tsx')
-rw-r--r-- | FrontEnd/src/app/views/timeline-common/TimelineCardTemplate.tsx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelineCardTemplate.tsx b/FrontEnd/src/app/views/timeline-common/TimelineCardTemplate.tsx index 53312758..d6eaa16c 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelineCardTemplate.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelineCardTemplate.tsx @@ -3,10 +3,15 @@ import clsx from "clsx"; import { useTranslation } from "react-i18next"; import { Dropdown, Button } from "react-bootstrap"; -import { TimelineCardComponentProps } from "../timeline-common/TimelinePageTemplateUI"; -import CollapseButton from "../timeline-common/CollapseButton"; +import { getHttpHighlightClient } from "@/http/highlight"; +import { getHttpBookmarkClient } from "@/http/bookmark"; + import { useUser } from "@/services/user"; import { pushAlert } from "@/services/alert"; +import { timelineVisibilityTooltipTranslationMap } from "@/services/timeline"; + +import { TimelineCardComponentProps } from "../timeline-common/TimelinePageTemplateUI"; +import CollapseButton from "../timeline-common/CollapseButton"; export interface TimelineCardTemplateProps extends Omit<TimelineCardComponentProps<"">, "operations"> { @@ -33,7 +38,6 @@ function TimelineCardTemplate({ infoArea, manageArea, toggleCollapse, - syncStatus, className, }: TimelineCardTemplateProps): React.ReactElement | null { const { t } = useTranslation(); @@ -43,7 +47,6 @@ function TimelineCardTemplate({ return ( <div className={clsx("cru-card p-2 clearfix", className)}> <div className="float-right d-flex align-items-center"> - <SyncStatusBadge status={syncStatus} className="mr-2" /> <CollapseButton collapse={collapse} onClick={toggleCollapse} /> </div> <div style={{ display: collapse ? "none" : "block" }}> @@ -61,8 +64,8 @@ function TimelineCardTemplate({ onClick={ user != null && user.hasHighlightTimelineAdministrationPermission ? () => { - timelineService - .setHighlight(timeline.name, !timeline.isHighlight) + getHttpHighlightClient() + [timeline.isHighlight ? "delete" : "put"](timeline.name) .catch(() => { pushAlert({ message: { @@ -85,8 +88,8 @@ function TimelineCardTemplate({ "icon-button text-yellow mr-3" )} onClick={() => { - timelineService - .setBookmark(timeline.name, !timeline.isBookmark) + getHttpBookmarkClient() + [timeline.isBookmark ? "delete" : "put"](timeline.name) .catch(() => { pushAlert({ message: { |