aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views/timeline-common
diff options
context:
space:
mode:
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common')
-rw-r--r--FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx14
-rw-r--r--FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx4
2 files changed, 18 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..3833cdd9 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
@@ -11,6 +11,7 @@ import {
usePostList,
useTimelineInfo,
} from "@/services/timeline";
+import { getHttpBookmarkClient } from "@/http/bookmark";
import { TimelineMemberDialog } from "./TimelineMember";
import TimelinePropertyChangeDialog from "./TimelinePropertyChangeDialog";
@@ -116,6 +117,19 @@ export default function TimelinePageTemplate<TManageItem>(
? onManage
: undefined,
onMember: () => setDialog("member"),
+ onBookmark:
+ user != null
+ ? () => {
+ void getHttpBookmarkClient()
+ .put(name, user.token)
+ .then(() => {
+ pushAlert({
+ message: "Succeeded to add bookmark!", //TODO: i18n
+ type: "success",
+ });
+ });
+ }
+ : undefined,
};
if (type === "cache") {
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
index f60383dd..b7cd4a45 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
@@ -15,6 +15,8 @@ export interface TimelineCardComponentProps<TManageItems> {
timeline: TimelineInfo;
onManage?: (item: TManageItems | "property") => void;
onMember: () => void;
+ onBookmark?: () => void;
+ onHighlight?: () => void;
className?: string;
collapse: boolean;
syncStatus: TimelineSyncStatus;
@@ -28,6 +30,7 @@ export interface TimelinePageTemplateUIProps<TManageItems> {
posts?: TimelinePostInfoEx[];
onManage?: (item: TManageItems | "property") => void;
onMember: () => void;
+ onBookmark?: () => void;
onPost?: TimelinePostSendCallback;
}
| I18nText;
@@ -153,6 +156,7 @@ export default function TimelinePageTemplateUI<TManageItems>(
timeline={data.timeline}
onManage={data.onManage}
onMember={data.onMember}
+ onBookmark={data.onBookmark}
syncStatus={syncStatus}
collapse={cardCollapse}
toggleCollapse={toggleCardCollapse}