From e23e9ccd8213ef79319f0bb517feed8b1cb58621 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:52:00 +0100 Subject: [PATCH] Create `UserEditActions` on user page (#222) * Create `UserEditActions` on user page * Fix crash with crashes `undefined` --- src/components/users.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/users.js b/src/components/users.js index 5c045fd..29879e4 100644 --- a/src/components/users.js +++ b/src/components/users.js @@ -259,20 +259,31 @@ export function generateRandomUser() { }; } -const UserEditToolbar = props => { +const UserEditToolbar = props => ( + + + +); + +const UserEditActions = ({ data }) => { const translate = useTranslate(); + var userStatus = ""; + if (data) { + userStatus = data.deactivated; + } + return ( - - + + {!userStatus && } - - + ); }; @@ -334,7 +345,7 @@ export const UserEdit = props => { const classes = useStyles(); const translate = useTranslate(); return ( - }> + } actions={}> }>