mirror of
https://gitlab.com/comunic/comunicconsole
synced 2024-11-23 13:59:23 +00:00
Can update admin general settings
This commit is contained in:
parent
6dde0f40c4
commit
163ff8471a
@ -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,
|
||||
|
@ -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
|
||||
|
17
src/ui/widgets/PageTitle.tsx
Normal file
17
src/ui/widgets/PageTitle.tsx
Normal 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>
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user