@@ -41,7 +41,7 @@ const PermissionLabel = styled.label`
4141 ${ tw `border-neutral-500 bg-neutral-800` } ;
4242 }
4343 }
44-
44+
4545 &:not(:first-of-type) {
4646 ${ tw `mt-4 sm:mt-2` } ;
4747 }
@@ -90,11 +90,11 @@ const PermissionTitledBox = memo(({ isEditable, permission, permissions, classNa
9090 < div css = { tw `flex items-center` } >
9191 < p css = { tw `text-sm uppercase flex-1` } > { permission } </ p >
9292 { isEditable &&
93- < Input
94- type = { 'checkbox' }
95- checked = { permissions . every ( p => values . permissions . includes ( p ) ) }
96- onChange = { onCheckboxClicked }
97- />
93+ < Input
94+ type = { 'checkbox' }
95+ checked = { permissions . every ( p => values . permissions . includes ( p ) ) }
96+ onChange = { onCheckboxClicked }
97+ />
9898 }
9999 </ div >
100100 }
@@ -132,30 +132,39 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
132132
133133 return (
134134 < Modal { ...props } top = { false } showSpinnerOverlay = { isSubmitting } >
135- < h2 css = { tw `text-2xl` } ref = { ref } >
136- { subuser ?
137- `${ canEditUser ? 'Modify' : 'View' } permissions for ${ subuser . email } `
138- :
139- 'Create new subuser'
140- }
141- </ h2 >
142- < FlashMessageRender byKey = { 'user:edit' } css = { tw `mt-4` } />
143- { ( ! user . rootAdmin && loggedInPermissions [ 0 ] !== '*' ) &&
144- < div css = { tw `mt-4 pl-4 py-2 border-l-4 border-cyan-400` } >
145- < p css = { tw `text-sm text-neutral-300` } >
146- Only permissions which your account is currently assigned may be selected when creating or
147- modifying other users.
148- </ p >
135+ < div css = { tw `flex justify-between` } >
136+ < div >
137+ < h2 css = { tw `text-2xl mr-4` } ref = { ref } >
138+ { subuser ?
139+ `${ canEditUser ? 'Modify' : 'View' } permissions for ${ subuser . email } `
140+ :
141+ 'Create new subuser '
142+ }
143+ </ h2 >
144+ </ div >
145+ < div >
146+ < Button type = { 'submit' } css = { tw `w-full sm:w-auto` } >
147+ { subuser ? 'Save' : 'Invite User' }
148+ </ Button >
149+ </ div >
149150 </ div >
151+ < FlashMessageRender byKey = { 'user:edit' } css = { tw `mt-4` } />
152+ { ( ! user . rootAdmin && loggedInPermissions [ 0 ] !== '*' ) &&
153+ < div css = { tw `mt-4 pl-4 py-2 border-l-4 border-cyan-400` } >
154+ < p css = { tw `text-sm text-neutral-300` } >
155+ Only permissions which your account is currently assigned may be selected when creating or
156+ modifying other users.
157+ </ p >
158+ </ div >
150159 }
151160 { ! subuser &&
152- < div css = { tw `mt-6 ` } >
153- < Field
154- name = { 'email' }
155- label = { 'User Email' }
156- description = { 'Enter the email address of the user you wish to invite as a subuser for this server.' }
157- />
158- </ div >
161+ < div css = { tw `mt-4 ` } >
162+ < Field
163+ name = { 'email' }
164+ label = { 'User Email' }
165+ description = { 'Enter the email address of the user you wish to invite as a subuser for this server.' }
166+ />
167+ </ div >
159168 }
160169 < div css = { tw `my-6` } >
161170 { Object . keys ( permissions ) . filter ( key => key !== 'websocket' ) . map ( ( key , index ) => {
@@ -190,9 +199,9 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
190199 < div css = { tw `flex-1` } >
191200 < Label as = { 'p' } css = { tw `font-medium` } > { pkey } </ Label >
192201 { permissions [ key ] . keys [ pkey ] . length > 0 &&
193- < p css = { tw `text-xs text-neutral-400 mt-1` } >
194- { permissions [ key ] . keys [ pkey ] }
195- </ p >
202+ < p css = { tw `text-xs text-neutral-400 mt-1` } >
203+ { permissions [ key ] . keys [ pkey ] }
204+ </ p >
196205 }
197206 </ div >
198207 </ PermissionLabel >
@@ -258,7 +267,7 @@ export default ({ subuser, ...props }: Props) => {
258267 } ) }
259268 >
260269 < Form >
261- < EditSubuserModal ref = { ref } subuser = { subuser } { ...props } />
270+ < EditSubuserModal ref = { ref } subuser = { subuser } { ...props } />
262271 </ Form >
263272 </ Formik >
264273 ) ;
0 commit comments