Can update admin general settings

This commit is contained in:
Pierre HUBERT 2021-05-13 17:17:22 +02:00
parent 6dde0f40c4
commit 163ff8471a
3 changed files with 28 additions and 5 deletions

View File

@ -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,

View File

@ -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 (
<Grid container spacing={2}>
<GeneralSettings admin={this.state.account}></GeneralSettings>
</Grid>
<div>
<PageTitle name="Account settings"></PageTitle>
<Grid container spacing={2}>
<GeneralSettings
admin={this.state.account}
></GeneralSettings>
</Grid>
</div>
);
}
}
@ -149,7 +155,7 @@ class GeneralSettings extends React.Component<
function SettingsSection(p: { title: string; children?: React.ReactNode }) {
return (
<Grid item xs={6} spacing={2}>
<Grid item sm={6} spacing={2}>
<Paper>
<Typography variant="h5" style={{ padding: "10px 10px " }}>
General settings

View File

@ -0,0 +1,17 @@
import { Paper, Typography } from "@material-ui/core";
/**
* Page title widget
*
* @author Pierre Hubert
*/
export function PageTitle(p: { name: string }) {
return (
<Typography
variant="h4"
style={{ marginBottom: "50px", color: "white" }}
>
{p.name}
</Typography>
);
}