From 163ff8471a0f097bad7a71cd1d14a13e4246a2d7 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 13 May 2021 17:17:22 +0200 Subject: [PATCH] Can update admin general settings --- src/helpers/AccountHelper.ts | 2 +- src/ui/routes/AccountSettingsRoute.tsx | 14 ++++++++++---- src/ui/widgets/PageTitle.tsx | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 src/ui/widgets/PageTitle.tsx diff --git a/src/helpers/AccountHelper.ts b/src/helpers/AccountHelper.ts index 567a012..eeca73a 100644 --- a/src/helpers/AccountHelper.ts +++ b/src/helpers/AccountHelper.ts @@ -127,7 +127,7 @@ export class AccountHelper { * @param a New settings */ static async UpdateGeneralSettings(s: NewAdminGeneralSettings) { - await serverRequest("admins/update_general_settings", { + await serverRequest("accounts/update_general_settings", { id: s.id, name: s.name, email: s.email, diff --git a/src/ui/routes/AccountSettingsRoute.tsx b/src/ui/routes/AccountSettingsRoute.tsx index 43adf86..3c9d7c2 100644 --- a/src/ui/routes/AccountSettingsRoute.tsx +++ b/src/ui/routes/AccountSettingsRoute.tsx @@ -17,6 +17,7 @@ import { useParams } from "react-router-dom"; import { AccountHelper, AdminAccount } from "../../helpers/AccountHelper"; import { AsyncWidget } from "../widgets/AsyncWidget"; import { matAlert, snackbar } from "../widgets/DialogsProvider"; +import { PageTitle } from "../widgets/PageTitle"; export function AccountSettingsRoute() { let params: any = useParams(); @@ -62,9 +63,14 @@ class AccountSettingsRouteInner extends React.Component< build() { return ( - - - +
+ + + + +
); } } @@ -149,7 +155,7 @@ class GeneralSettings extends React.Component< function SettingsSection(p: { title: string; children?: React.ReactNode }) { return ( - + General settings diff --git a/src/ui/widgets/PageTitle.tsx b/src/ui/widgets/PageTitle.tsx new file mode 100644 index 0000000..3162ff8 --- /dev/null +++ b/src/ui/widgets/PageTitle.tsx @@ -0,0 +1,17 @@ +import { Paper, Typography } from "@material-ui/core"; + +/** + * Page title widget + * + * @author Pierre Hubert + */ +export function PageTitle(p: { name: string }) { + return ( + + {p.name} + + ); +}