Duplicate save/invite button at top
Adds the Save / Invite User button at the top also
This commit is contained in:
parent
c370e08f65
commit
e0bc9ac50f
|
@ -132,14 +132,23 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal {...props} top={false} showSpinnerOverlay={isSubmitting}>
|
<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 ?
|
{subuser ?
|
||||||
`${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}`
|
`${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}`
|
||||||
:
|
:
|
||||||
'Create new subuser'
|
'Create new subuser '
|
||||||
}
|
}
|
||||||
</h2>
|
</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] !== '*') &&
|
{(!user.rootAdmin && loggedInPermissions[0] !== '*') &&
|
||||||
<div css={tw`mt-4 pl-4 py-2 border-l-4 border-cyan-400`}>
|
<div css={tw`mt-4 pl-4 py-2 border-l-4 border-cyan-400`}>
|
||||||
<p css={tw`text-sm text-neutral-300`}>
|
<p css={tw`text-sm text-neutral-300`}>
|
||||||
|
@ -149,7 +158,7 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{!subuser &&
|
{!subuser &&
|
||||||
<div css={tw`mt-6`}>
|
<div css={tw`mt-4`}>
|
||||||
<Field
|
<Field
|
||||||
name={'email'}
|
name={'email'}
|
||||||
label={'User Email'}
|
label={'User Email'}
|
||||||
|
@ -258,7 +267,7 @@ export default ({ subuser, ...props }: Props) => {
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Form>
|
<Form>
|
||||||
<EditSubuserModal ref={ref} subuser={subuser} {...props}/>
|
<EditSubuserModal ref={ref} subuser={subuser} {...props} />
|
||||||
</Form>
|
</Form>
|
||||||
</Formik>
|
</Formik>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue