Show displayname as title for user

Change-Id: I0ba8e2265e5b8e1fe392f56052e96e0243cd3eb6
This commit is contained in:
Manuel Stahl 2020-04-21 18:39:51 +02:00
parent d812cff5fc
commit 1e6e526e3c

View File

@ -135,8 +135,17 @@ export const UserCreate = props => (
</Create> </Create>
); );
const UserTitle = ({ record }) => {
const translate = useTranslate();
return (
<span>
{translate("resources.users.name")}{" "}
{record ? `"${record.displayname}"` : ""}
</span>
);
};
export const UserEdit = props => ( export const UserEdit = props => (
<Edit {...props}> <Edit {...props} title={<UserTitle />}>
<TabbedForm toolbar={<UserEditToolbar />}> <TabbedForm toolbar={<UserEditToolbar />}>
<FormTab label="resources.users.name" icon={<PersonPinIcon />}> <FormTab label="resources.users.name" icon={<PersonPinIcon />}>
<TextInput source="id" disabled /> <TextInput source="id" disabled />