From 1bcb36b6ee3e83427847a1258c143648e39ca1cf Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 21 Jan 2021 16:22:11 +0800 Subject: feat: Fix #207. --- FrontEnd/src/app/views/settings/index.tsx | 106 +++++++++++++++--------------- 1 file changed, 54 insertions(+), 52 deletions(-) (limited to 'FrontEnd/src') diff --git a/FrontEnd/src/app/views/settings/index.tsx b/FrontEnd/src/app/views/settings/index.tsx index cbdae8ac..0a85df83 100644 --- a/FrontEnd/src/app/views/settings/index.tsx +++ b/FrontEnd/src/app/views/settings/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { useHistory } from "react-router"; import { useTranslation } from "react-i18next"; -import { Form, Row, Col, Button, Modal } from "react-bootstrap"; +import { Container, Form, Row, Col, Button, Modal } from "react-bootstrap"; import { useUser, userService } from "@/services/user"; import OperationDialog from "../common/OperationDialog"; @@ -106,60 +106,62 @@ const SettingsPage: React.FC = (_) => { return ( <> - {user ? ( -
+ + {user ? ( +
+

+ {t("settings.subheaders.account")} +

+
{ + history.push(`/users/${user.username}`); + }} + > + {t("settings.gotoSelf")} +
+
setDialog("changepassword")} + > + {t("settings.changePassword")} +
+
{ + setDialog("logout"); + }} + > + {t("settings.logout")} +
+
+ ) : null} +

- {t("settings.subheaders.account")} + {t("settings.subheaders.customization")}

-
{ - history.push(`/users/${user.username}`); - }} - > - {t("settings.gotoSelf")} -
-
setDialog("changepassword")} - > - {t("settings.changePassword")} -
-
{ - setDialog("logout"); - }} - > - {t("settings.logout")} -
+ + +
{t("settings.languagePrimary")}
+ + {t("settings.languageSecondary")} + + + + { + void i18n.changeLanguage(e.target.value); + }} + > + + + + +
- ) : null} -
-

- {t("settings.subheaders.customization")} -

- - -
{t("settings.languagePrimary")}
- - {t("settings.languageSecondary")} - - - - { - void i18n.changeLanguage(e.target.value); - }} - > - - - - -
-
+
{(() => { switch (dialog) { case "changepassword": -- cgit v1.2.3