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
|
* @param a New settings
|
||||||
*/
|
*/
|
||||||
static async UpdateGeneralSettings(s: NewAdminGeneralSettings) {
|
static async UpdateGeneralSettings(s: NewAdminGeneralSettings) {
|
||||||
await serverRequest("admins/update_general_settings", {
|
await serverRequest("accounts/update_general_settings", {
|
||||||
id: s.id,
|
id: s.id,
|
||||||
name: s.name,
|
name: s.name,
|
||||||
email: s.email,
|
email: s.email,
|
||||||
|
@ -17,6 +17,7 @@ import { useParams } from "react-router-dom";
|
|||||||
import { AccountHelper, AdminAccount } from "../../helpers/AccountHelper";
|
import { AccountHelper, AdminAccount } from "../../helpers/AccountHelper";
|
||||||
import { AsyncWidget } from "../widgets/AsyncWidget";
|
import { AsyncWidget } from "../widgets/AsyncWidget";
|
||||||
import { matAlert, snackbar } from "../widgets/DialogsProvider";
|
import { matAlert, snackbar } from "../widgets/DialogsProvider";
|
||||||
|
import { PageTitle } from "../widgets/PageTitle";
|
||||||
|
|
||||||
export function AccountSettingsRoute() {
|
export function AccountSettingsRoute() {
|
||||||
let params: any = useParams();
|
let params: any = useParams();
|
||||||
@ -62,9 +63,14 @@ class AccountSettingsRouteInner extends React.Component<
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
return (
|
return (
|
||||||
<Grid container spacing={2}>
|
<div>
|
||||||
<GeneralSettings admin={this.state.account}></GeneralSettings>
|
<PageTitle name="Account settings"></PageTitle>
|
||||||
</Grid>
|
<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 }) {
|
function SettingsSection(p: { title: string; children?: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<Grid item xs={6} spacing={2}>
|
<Grid item sm={6} spacing={2}>
|
||||||
<Paper>
|
<Paper>
|
||||||
<Typography variant="h5" style={{ padding: "10px 10px " }}>
|
<Typography variant="h5" style={{ padding: "10px 10px " }}>
|
||||||
General settings
|
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