Merge pull request #2554 from AreYouRlyScared/subusers

Duplicate save/invite button at top
This commit is contained in:
Dane Everitt 2020-10-31 22:30:52 -07:00 committed by GitHub
commit 9ff691bfde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,26 +95,33 @@ const EditSubuserModal = ({ subuser }: Props) => {
})} })}
> >
<Form> <Form>
<h2 css={tw`text-2xl`} ref={ref}> <div css={tw`flex justify-between`}>
{subuser ? `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` : 'Create new subuser'} <h2 css={tw`text-2xl`} ref={ref}>
</h2> {subuser ? `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` : 'Create new subuser'}
<FlashMessageRender byKey={'user:edit'} css={tw`mt-4`}/> </h2>
{(!isRootAdmin && loggedInPermissions[0] !== '*') && <div>
<div css={tw`mt-4 pl-4 py-2 border-l-4 border-cyan-400`}> <Button type={'submit'} css={tw`w-full sm:w-auto`}>
<p css={tw`text-sm text-neutral-300`}> {subuser ? 'Save' : 'Invite User'}
Only permissions which your account is currently assigned may be selected when creating or </Button>
modifying other users. </div>
</p>
</div> </div>
<FlashMessageRender byKey={'user:edit'} css={tw`mt-4`} />
{(!isRootAdmin && loggedInPermissions[0] !== '*') &&
<div css={tw`mt-4 pl-4 py-2 border-l-4 border-cyan-400`}>
<p css={tw`text-sm text-neutral-300`}>
Only permissions which your account is currently assigned may be selected when creating or
modifying other users.
</p>
</div>
} }
{!subuser && {!subuser &&
<div css={tw`mt-6`}> <div css={tw`mt-6`}>
<Field <Field
name={'email'} name={'email'}
label={'User Email'} label={'User Email'}
description={'Enter the email address of the user you wish to invite as a subuser for this server.'} description={'Enter the email address of the user you wish to invite as a subuser for this server.'}
/> />
</div> </div>
} }
<div css={tw`my-6`}> <div css={tw`my-6`}>
{Object.keys(permissions).filter(key => key !== 'websocket').map((key, index) => ( {Object.keys(permissions).filter(key => key !== 'websocket').map((key, index) => (