From 6897006e1534bbeda60ed666f9c281220026ed54 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 4 Nov 2020 16:53:09 +0800 Subject: feat: Redesign settings ui. --- FrontEnd/src/app/views/settings/index.tsx | 109 +++++++++++++++--------------- 1 file changed, 54 insertions(+), 55 deletions(-) (limited to 'FrontEnd/src/app/views/settings/index.tsx') diff --git a/FrontEnd/src/app/views/settings/index.tsx b/FrontEnd/src/app/views/settings/index.tsx index 4d4f18b5..513885e8 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, Container, Row, Col, Button, Modal } from "react-bootstrap"; +import { Form, Row, Col, Button, Modal } from "react-bootstrap"; import { useUser, userService } from "@/services/user"; import OperationDialog from "../common/OperationDialog"; @@ -105,62 +105,61 @@ 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); +
+

+ {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.customization")} +

+ + +
{t("settings.languagePrimary")}
+ + {t("settings.languageSecondary")} + + + + { + void i18n.changeLanguage(e.target.value); + }} + > + + + + +
+
{(() => { switch (dialog) { case "changepassword": @@ -187,7 +186,7 @@ const SettingsPage: React.FC = (_) => { return null; } })()} -
+ ); }; -- cgit v1.2.3