Skip to content

Commit 9ff691b

Browse files
authored
Merge pull request pterodactyl#2554 from AreYouRlyScared/subusers
Duplicate save/invite button at top
2 parents fda50bb + aad3019 commit 9ff691b

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

resources/scripts/components/server/users/EditSubuserModal.tsx

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,33 @@ const EditSubuserModal = ({ subuser }: Props) => {
9595
})}
9696
>
9797
<Form>
98-
<h2 css={tw`text-2xl`} ref={ref}>
99-
{subuser ? `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` : 'Create new subuser'}
100-
</h2>
101-
<FlashMessageRender byKey={'user:edit'} css={tw`mt-4`}/>
102-
{(!isRootAdmin && loggedInPermissions[0] !== '*') &&
103-
<div css={tw`mt-4 pl-4 py-2 border-l-4 border-cyan-400`}>
104-
<p css={tw`text-sm text-neutral-300`}>
105-
Only permissions which your account is currently assigned may be selected when creating or
106-
modifying other users.
107-
</p>
98+
<div css={tw`flex justify-between`}>
99+
<h2 css={tw`text-2xl`} ref={ref}>
100+
{subuser ? `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` : 'Create new subuser'}
101+
</h2>
102+
<div>
103+
<Button type={'submit'} css={tw`w-full sm:w-auto`}>
104+
{subuser ? 'Save' : 'Invite User'}
105+
</Button>
106+
</div>
108107
</div>
108+
<FlashMessageRender byKey={'user:edit'} css={tw`mt-4`} />
109+
{(!isRootAdmin && loggedInPermissions[0] !== '*') &&
110+
<div css={tw`mt-4 pl-4 py-2 border-l-4 border-cyan-400`}>
111+
<p css={tw`text-sm text-neutral-300`}>
112+
Only permissions which your account is currently assigned may be selected when creating or
113+
modifying other users.
114+
</p>
115+
</div>
109116
}
110117
{!subuser &&
111-
<div css={tw`mt-6`}>
112-
<Field
113-
name={'email'}
114-
label={'User Email'}
115-
description={'Enter the email address of the user you wish to invite as a subuser for this server.'}
116-
/>
117-
</div>
118+
<div css={tw`mt-6`}>
119+
<Field
120+
name={'email'}
121+
label={'User Email'}
122+
description={'Enter the email address of the user you wish to invite as a subuser for this server.'}
123+
/>
124+
</div>
118125
}
119126
<div css={tw`my-6`}>
120127
{Object.keys(permissions).filter(key => key !== 'websocket').map((key, index) => (

0 commit comments

Comments
 (0)