aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views/home/index.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-16 18:13:28 +0800
committercrupest <crupest@outlook.com>2021-04-16 18:13:28 +0800
commitd3508f1f5f105fe3edb7c196ab2fb99c84b145f8 (patch)
tree21998e1eb5750d06178ebd3cf66164b40f3e660f /FrontEnd/src/app/views/home/index.tsx
parentb0cf464004142dce602fa882c8d638605be7e479 (diff)
downloadtimeline-d3508f1f5f105fe3edb7c196ab2fb99c84b145f8.tar.gz
timeline-d3508f1f5f105fe3edb7c196ab2fb99c84b145f8.tar.bz2
timeline-d3508f1f5f105fe3edb7c196ab2fb99c84b145f8.zip
...
Diffstat (limited to 'FrontEnd/src/app/views/home/index.tsx')
-rw-r--r--FrontEnd/src/app/views/home/index.tsx58
1 files changed, 14 insertions, 44 deletions
diff --git a/FrontEnd/src/app/views/home/index.tsx b/FrontEnd/src/app/views/home/index.tsx
index a0df6a5a..519d59f8 100644
--- a/FrontEnd/src/app/views/home/index.tsx
+++ b/FrontEnd/src/app/views/home/index.tsx
@@ -1,15 +1,10 @@
import React from "react";
import { useHistory } from "react-router";
-import { useTranslation } from "react-i18next";
-import { Container, Button, Row, Col } from "react-bootstrap";
import { HttpTimelineInfo } from "@/http/timeline";
import { getHttpHighlightClient } from "@/http/highlight";
-import { useUser } from "@/services/user";
-
import SearchInput from "../common/SearchInput";
-import TimelineCreateDialog from "../center/TimelineCreateDialog";
import TimelineListView from "./TimelineListView";
import WebsiteIntroduction from "./WebsiteIntroduction";
@@ -22,14 +17,8 @@ const highlightTimelineMessageMap = {
const HomeV2: React.FC = () => {
const history = useHistory();
- const { t } = useTranslation();
-
- const user = useUser();
-
const [navText, setNavText] = React.useState<string>("");
- const [dialog, setDialog] = React.useState<"create" | null>(null);
-
const [highlightTimelineState, setHighlightTimelineState] = React.useState<
"loading" | "done" | "error"
>("loading");
@@ -64,39 +53,20 @@ const HomeV2: React.FC = () => {
return (
<>
- <Container fluid className="px-0">
- <Row className="mx-0 my-3 px-2 justify-content-end">
- <Col xs="12" sm="auto">
- <SearchInput
- value={navText}
- onChange={setNavText}
- onButtonClick={() => {
- history.push(`search?q=${navText}`);
- }}
- additionalButton={
- user != null && (
- <Button
- variant="outline-success"
- onClick={() => {
- setDialog("create");
- }}
- >
- {t("home.createButton")}
- </Button>
- )
- }
- />
- </Col>
- </Row>
- <WebsiteIntroduction className="p-2" />
- <TimelineListView
- headerText={highlightTimelineMessageMap[highlightTimelineState]}
- timelines={highlightTimelines}
- />
- </Container>
- {dialog === "create" && (
- <TimelineCreateDialog open close={() => setDialog(null)} />
- )}
+ <SearchInput
+ className="mx-2 my-3 float-sm-right"
+ value={navText}
+ onChange={setNavText}
+ onButtonClick={() => {
+ history.push(`search?q=${navText}`);
+ }}
+ alwaysOneline
+ />
+ <WebsiteIntroduction className="m-2" />
+ <TimelineListView
+ headerText={highlightTimelineMessageMap[highlightTimelineState]}
+ timelines={highlightTimelines}
+ />
</>
);
};