File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed
src/components/Users/form Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -70,15 +70,18 @@ class UsersForm extends Component {
7070
7171 { this . props . currentUser && this . props . currentUser . role === 'admin' && ! this . props . isProfile &&
7272 < >
73- < RadioFormItem
74- name = { 'role' }
75- schema = { usersFields }
76- />
77-
78- < SwitchFormItem
79- name = { 'disabled' }
80- schema = { usersFields }
81- />
73+ { this . props . isProfile ? null : (
74+ < >
75+ < SwitchFormItem
76+ name = { 'disabled' }
77+ schema = { usersFields }
78+ />
79+ < RadioFormItem
80+ name = { 'role' }
81+ schema = { usersFields }
82+ />
83+ </ >
84+ ) }
8285 </ >
8386 }
8487
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ class UsersFormPage extends Component {
4343
4444 isProfile = ( ) => {
4545 const { match } = this . props ;
46+ const currentUser = JSON . parse ( localStorage . getItem ( 'user' ) ) ;
47+ const currentUserId = currentUser . user . id ;
48+ if ( match . params . id === currentUserId ) {
49+ return true
50+ }
4651 return match . url === '/app/profile' ;
4752 } ;
4853
You can’t perform that action at this time.
0 commit comments