From d9c2d4e6293599c5499d68679e4fe33b241379f1 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 3 Sep 2020 18:56:40 +0800 Subject: Move AppBar to App . --- .../ClientApp/src/app/views/settings/index.tsx | 170 ++++++++++----------- 1 file changed, 83 insertions(+), 87 deletions(-) (limited to 'Timeline/ClientApp/src/app/views/settings') diff --git a/Timeline/ClientApp/src/app/views/settings/index.tsx b/Timeline/ClientApp/src/app/views/settings/index.tsx index 123e1353..964e7442 100644 --- a/Timeline/ClientApp/src/app/views/settings/index.tsx +++ b/Timeline/ClientApp/src/app/views/settings/index.tsx @@ -4,7 +4,6 @@ import { useTranslation } from "react-i18next"; import { Form, Container, Row, Col, Button, Modal } from "react-bootstrap"; import { useUser, userService } from "@/services/user"; -import AppBar from "../common/AppBar"; import OperationDialog, { OperationInputErrorInfo, } from "../common/OperationDialog"; @@ -121,92 +120,89 @@ const SettingsPage: React.FC = (_) => { const language = i18n.language.slice(0, 2); return ( - <> - - - {user ? ( - <> - - -
{ - history.push(`/users/${user.username}`); - }} - > - {t("settings.gotoSelf")} -
- -
- - -
setDialog("changepassword")} - > - {t("settings.changePassword")} -
- -
- - -
{ - setDialog("logout"); - }} - > - {t("settings.logout")} -
- -
- - ) : null} - - -
{t("settings.languagePrimary")}
-

{t("settings.languageSecondary")}

- - - { - void i18n.changeLanguage(e.target.value); - }} - > - - - - -
- {(() => { - switch (dialog) { - case "changepassword": - return ( - { - setDialog(null); - }} - /> - ); - case "logout": - return ( - setDialog(null)} - onConfirm={() => { - void userService.logout().then(() => { - history.push("/"); - }); - }} - /> - ); - default: - return null; - } - })()} -
- + + {user ? ( + <> + + +
{ + history.push(`/users/${user.username}`); + }} + > + {t("settings.gotoSelf")} +
+ +
+ + +
setDialog("changepassword")} + > + {t("settings.changePassword")} +
+ +
+ + +
{ + setDialog("logout"); + }} + > + {t("settings.logout")} +
+ +
+ + ) : null} + + +
{t("settings.languagePrimary")}
+

{t("settings.languageSecondary")}

+ + + { + void i18n.changeLanguage(e.target.value); + }} + > + + + + +
+ {(() => { + switch (dialog) { + case "changepassword": + return ( + { + setDialog(null); + }} + /> + ); + case "logout": + return ( + setDialog(null)} + onConfirm={() => { + void userService.logout().then(() => { + history.push("/"); + }); + }} + /> + ); + default: + return null; + } + })()} +
); }; -- cgit v1.2.3