From 918f95072952ddfdbcc131228455ca48b0299774 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 31 Jan 2021 13:21:06 +0800 Subject: ... --- FrontEnd/src/app/locales/en/translation.json | 1 - FrontEnd/src/app/locales/zh/translation.json | 1 - FrontEnd/src/app/views/home/index.tsx | 16 +++------------- 3 files changed, 3 insertions(+), 15 deletions(-) (limited to 'FrontEnd/src') diff --git a/FrontEnd/src/app/locales/en/translation.json b/FrontEnd/src/app/locales/en/translation.json index 0aafb2ae..c86e1e33 100644 --- a/FrontEnd/src/app/locales/en/translation.json +++ b/FrontEnd/src/app/locales/en/translation.json @@ -21,7 +21,6 @@ "chooseImage": "Choose a image", "loadImageError": "Failed to load image.", "home": { - "go": "Go!", "highlightTimeline": "Highlight Timelines", "relatedTimeline": "Timelines Related To You", "publicTimeline": "Public Timelines", diff --git a/FrontEnd/src/app/locales/zh/translation.json b/FrontEnd/src/app/locales/zh/translation.json index a12a6296..4c839387 100644 --- a/FrontEnd/src/app/locales/zh/translation.json +++ b/FrontEnd/src/app/locales/zh/translation.json @@ -21,7 +21,6 @@ "chooseImage": "选择一个图片", "loadImageError": "加载图片失败", "home": { - "go": "冲!", "highlightTimeline": "高光时间线", "relatedTimeline": "关于你的时间线", "publicTimeline": "公开时间线", diff --git a/FrontEnd/src/app/views/home/index.tsx b/FrontEnd/src/app/views/home/index.tsx index 3c53736d..bcf6ad6e 100644 --- a/FrontEnd/src/app/views/home/index.tsx +++ b/FrontEnd/src/app/views/home/index.tsx @@ -21,16 +21,6 @@ const HomePage: React.FC = () => { const [dialog, setDialog] = React.useState<"create" | null>(null); - const goto = React.useCallback((): void => { - if (navText === "") { - history.push("users/crupest"); - } else if (navText.startsWith("@")) { - history.push(`users/${navText.slice(1)}`); - } else { - history.push(`timelines/${navText}`); - } - }, [navText, history]); - return ( <> @@ -40,9 +30,9 @@ const HomePage: React.FC = () => { className="justify-content-center" value={navText} onChange={setNavText} - onButtonClick={goto} - buttonText={t("home.go")} - placeholder="@crupest" + onButtonClick={() => { + history.push(`search?q=${navText}`); + }} additionalButton={ user != null && (