From 880ed701d5ae3f3b21b30d3b9e2db5d98d6b9513 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 3 Sep 2020 18:56:40 +0800 Subject: Move AppBar to App . --- Timeline/ClientApp/src/app/App.tsx | 75 +++++---- Timeline/ClientApp/src/app/views/about/index.tsx | 156 +++++++++---------- Timeline/ClientApp/src/app/views/admin/Admin.tsx | 2 - Timeline/ClientApp/src/app/views/home/index.tsx | 2 - Timeline/ClientApp/src/app/views/login/index.tsx | 151 +++++++++--------- .../ClientApp/src/app/views/settings/index.tsx | 170 ++++++++++----------- .../timeline-common/TimelinePageTemplateUI.tsx | 7 +- 7 files changed, 268 insertions(+), 295 deletions(-) (limited to 'Timeline') diff --git a/Timeline/ClientApp/src/app/App.tsx b/Timeline/ClientApp/src/app/App.tsx index b64414b7..b68eddb6 100644 --- a/Timeline/ClientApp/src/app/App.tsx +++ b/Timeline/ClientApp/src/app/App.tsx @@ -11,6 +11,7 @@ import About from "./views/about"; import User from "./views/user"; import TimelinePage from "./views/timeline"; import AlertHost from "./views/common/alert/AlertHost"; + import { dataStorage } from "./services/common"; import { userService, useRawUser } from "./services/user"; @@ -38,50 +39,46 @@ const App: React.FC = () => { void dataStorage.ready().then(() => setLoading(false)); }, []); - let body; if (user === undefined || loading) { - body = ; + return ; } else { - body = ( - - - - - - - - - - - - - - - - - - - - - {user && user.administrator && ( - - + return ( + }> + + + + + + + + + + + + + + + + + - )} - - - - - + + + + {user && user.administrator && ( + + + + )} + + + + + + + ); } - - return ( - }> - {body} - - - ); }; export default hot(App); diff --git a/Timeline/ClientApp/src/app/views/about/index.tsx b/Timeline/ClientApp/src/app/views/about/index.tsx index 78cffb5f..e7771cec 100644 --- a/Timeline/ClientApp/src/app/views/about/index.tsx +++ b/Timeline/ClientApp/src/app/views/about/index.tsx @@ -1,8 +1,6 @@ import React from "react"; import { useTranslation, Trans } from "react-i18next"; -import AppBar from "../common/AppBar"; - import authorAvatarUrl from "./author-avatar.png"; import githubLogoUrl from "./github.png"; @@ -75,97 +73,91 @@ const AboutPage: React.FC = () => { const { t } = useTranslation(); return ( - <> - -
-
-

{t("about.author.title")}

-
-
- -
-

- {t("about.author.fullname")} - 杨宇千 -

-

- {t("about.author.nickname")} - crupest -

-

- {t("about.author.introduction")} - {t("about.author.introductionContent")} -

-
+
+
+

{t("about.author.title")}

+
+
+ +
+

+ {t("about.author.fullname")} + 杨宇千 +

+

+ {t("about.author.nickname")} + crupest +

+

+ {t("about.author.introduction")} + {t("about.author.introductionContent")} +

-

- {t("about.author.links")} - - - -

-
-
-

{t("about.site.title")}

-

- - 01234 - 56 - -

+ {t("about.author.links")} - {t("about.site.repo")} +

-
-

{t("about.credits.title")}

-

{t("about.credits.content")}

-

{t("about.credits.frontend")}

-
    - {frontendCredits.map((item, index) => { - return ( -
  • - - {item.name} - -
  • - ); - })} -
  • ...
  • -
-

{t("about.credits.backend")}

-
    - {backendCredits.map((item, index) => { - return ( -
  • - - {item.name} - -
  • - ); - })} -
  • ...
  • -
-
- +
+

{t("about.site.title")}

+

+ + 01234 + 56 + +

+

+ + {t("about.site.repo")} + +

+
+
+

{t("about.credits.title")}

+

{t("about.credits.content")}

+

{t("about.credits.frontend")}

+
    + {frontendCredits.map((item, index) => { + return ( +
  • + + {item.name} + +
  • + ); + })} +
  • ...
  • +
+

{t("about.credits.backend")}

+
    + {backendCredits.map((item, index) => { + return ( +
  • + + {item.name} + +
  • + ); + })} +
  • ...
  • +
+
+
); }; diff --git a/Timeline/ClientApp/src/app/views/admin/Admin.tsx b/Timeline/ClientApp/src/app/views/admin/Admin.tsx index e0f59b0f..9c0250e7 100644 --- a/Timeline/ClientApp/src/app/views/admin/Admin.tsx +++ b/Timeline/ClientApp/src/app/views/admin/Admin.tsx @@ -8,7 +8,6 @@ import { } from "react-router"; import { Nav } from "react-bootstrap"; -import AppBar from "../common/AppBar"; import { UserWithToken } from "@/services/user"; import UserAdmin from "./UserAdmin"; @@ -34,7 +33,6 @@ const Admin: React.FC = (props) => { ): React.ReactNode => { return ( -