diff options
| author | crupest <crupest@outlook.com> | 2021-01-03 19:38:05 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-03 19:38:05 +0800 |
| commit | 418d631528fdb581a384068719e9af5dbaa66740 (patch) | |
| tree | 42e2c0396a16cb5fbaaae665a238a8a031bef7f0 /FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx | |
| parent | 4b3ae3edd9e8aceac5ff26ef137d2a8d686fe305 (diff) | |
| parent | 8af803cb0da57af1355ad28cd056cb5dcf6d6915 (diff) | |
| download | timeline-418d631528fdb581a384068719e9af5dbaa66740.tar.gz timeline-418d631528fdb581a384068719e9af5dbaa66740.tar.bz2 timeline-418d631528fdb581a384068719e9af5dbaa66740.zip | |
Merge pull request #197 from crupest/front-dev
Front: Highlight and bookmark timeline and new home page.
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx')
| -rw-r--r-- | FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx index 6c57e91d..7f5c8206 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx @@ -11,6 +11,8 @@ import { usePostList, useTimelineInfo, } from "@/services/timeline"; +import { getHttpBookmarkClient } from "@/http/bookmark"; +import { getHttpHighlightClient } from "@/http/highlight"; import { TimelineMemberDialog } from "./TimelineMember"; import TimelinePropertyChangeDialog from "./TimelinePropertyChangeDialog"; @@ -116,6 +118,38 @@ export default function TimelinePageTemplate<TManageItem>( ? onManage : undefined, onMember: () => setDialog("member"), + onBookmark: + user != null + ? () => { + void getHttpBookmarkClient() + .put(name, user.token) + .then(() => { + pushAlert({ + message: { + type: "i18n", + key: "timeline.addBookmarkSuccess", + }, + type: "success", + }); + }); + } + : undefined, + onHighlight: + user != null && user.hasHighlightTimelineAdministrationPermission + ? () => { + void getHttpHighlightClient() + .put(name, user.token) + .then(() => { + pushAlert({ + message: { + type: "i18n", + key: "timeline.addHighlightSuccess", + }, + type: "success", + }); + }); + } + : undefined, }; if (type === "cache") { |
