Duplicate save/invite button at top

Adds the Save / Invite User button at the top also
This commit is contained in:
Charles Morgan 2020-10-18 04:31:54 -04:00
parent c370e08f65
commit e0bc9ac50f
No known key found for this signature in database
GPG key ID: D71946CD723249BD

View file

@ -132,14 +132,23 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
return (
<Modal {...props} top={false} showSpinnerOverlay={isSubmitting}>
<h2 css={tw`text-2xl`} ref={ref}>
<div css={tw`flex justify-between`}>
<div>
<h2 css={tw`text-2xl mr-4`} ref={ref}>
{subuser ?
`${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}`
:
'Create new subuser'
'Create new subuser '
}
</h2>
<FlashMessageRender byKey={'user:edit'} css={tw`mt-4`}/>
</div>
<div>
<Button type={'submit'} css={tw`w-full sm:w-auto`}>
{subuser ? 'Save' : 'Invite User'}
</Button>
</div>
</div>
<FlashMessageRender byKey={'user:edit'} css={tw`mt-4`} />
{(!user.rootAdmin && 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`}>
@ -149,7 +158,7 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
</div>
}
{!subuser &&
<div css={tw`mt-6`}>
<div css={tw`mt-4`}>
<Field
name={'email'}
label={'User Email'}
@ -258,7 +267,7 @@ export default ({ subuser, ...props }: Props) => {
})}
>
<Form>
<EditSubuserModal ref={ref} subuser={subuser} {...props}/>
<EditSubuserModal ref={ref} subuser={subuser} {...props} />
</Form>
</Formik>
);