aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views/home/index.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-04-11 22:59:41 +0800
committercrupest <crupest@outlook.com>2022-04-11 22:59:41 +0800
commit9c0cb8f8d3944c813ef28ff9f736f148fd701a66 (patch)
tree69842e08eaf6d16a055d464d46ba435a188c8d39 /FrontEnd/src/views/home/index.tsx
parent65210138df643a475632690e2fb20401c1edbb95 (diff)
downloadtimeline-9c0cb8f8d3944c813ef28ff9f736f148fd701a66.tar.gz
timeline-9c0cb8f8d3944c813ef28ff9f736f148fd701a66.tar.bz2
timeline-9c0cb8f8d3944c813ef28ff9f736f148fd701a66.zip
...
Diffstat (limited to 'FrontEnd/src/views/home/index.tsx')
-rw-r--r--FrontEnd/src/views/home/index.tsx14
1 files changed, 8 insertions, 6 deletions
diff --git a/FrontEnd/src/views/home/index.tsx b/FrontEnd/src/views/home/index.tsx
index 9533ea5a..0eeb4b77 100644
--- a/FrontEnd/src/views/home/index.tsx
+++ b/FrontEnd/src/views/home/index.tsx
@@ -1,8 +1,8 @@
import React from "react";
import { useNavigate } from "react-router-dom";
-import { HttpTimelineInfo } from "@/http/timeline";
-import { getHttpHighlightClient } from "@/http/highlight";
+import { Page } from "@/http/common";
+import { getHttpBookmarkClient, TimelineBookmark } from "@/http/bookmark";
import SearchInput from "../common/SearchInput";
import TimelineListView from "./TimelineListView";
@@ -10,6 +10,8 @@ import WebsiteIntroduction from "./WebsiteIntroduction";
import "./index.css";
+const highlightTimelineUsername = "crupest";
+
const highlightTimelineMessageMap = {
loading: "home.loadingHighlightTimelines",
done: "home.loadedHighlightTimelines",
@@ -25,14 +27,14 @@ const HomeV2: React.FC = () => {
"loading" | "done" | "error"
>("loading");
const [highlightTimelines, setHighlightTimelines] = React.useState<
- HttpTimelineInfo[] | undefined
+ Page<TimelineBookmark> | undefined
>();
React.useEffect(() => {
if (highlightTimelineState === "loading") {
let subscribe = true;
- void getHttpHighlightClient()
- .list()
+ void getHttpBookmarkClient()
+ .list(highlightTimelineUsername)
.then(
(data) => {
if (subscribe) {
@@ -67,7 +69,7 @@ const HomeV2: React.FC = () => {
<WebsiteIntroduction className="m-2" />
<TimelineListView
headerText={highlightTimelineMessageMap[highlightTimelineState]}
- timelines={highlightTimelines}
+ timelines={highlightTimelines?.items}
/>
</>
);