Skip to content

Commit d1880af

Browse files
committed
New login page design
1 parent 212773d commit d1880af

File tree

8 files changed

+33
-10
lines changed

8 files changed

+33
-10
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ node_modules
1212
_ide_helper.php
1313
.phpstorm.meta.php
1414
.php_cs.cache
15-
public/assets/*
15+
public/assets/manifest.json
1616

1717
# For local development with docker
1818
# Remove if we ever put the Dockerfile in the repo

public/assets/pterodactyl.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/scripts/components/auth/ForgotPasswordContainer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import requestPasswordResetEmail from '@/api/auth/requestPasswordResetEmail';
44
import { connect } from 'react-redux';
55
import { pushFlashMessage, clearAllFlashMessages } from '@/redux/actions/flash';
66
import { httpErrorToHuman } from '@/api/http';
7+
import LoginFormContainer from '@/components/auth/LoginFormContainer';
78

89
type Props = Readonly<{
910
pushFlashMessage: typeof pushFlashMessage;
@@ -60,7 +61,7 @@ class ForgotPasswordContainer extends React.PureComponent<Props, State> {
6061
<h2 className={'text-center text-neutral-100 font-medium py-4'}>
6162
Request Password Reset
6263
</h2>
63-
<form className={'login-box'} onSubmit={this.handleSubmission}>
64+
<LoginFormContainer onSubmit={this.handleSubmission}>
6465
<label htmlFor={'email'}>Email</label>
6566
<input
6667
ref={this.emailField}
@@ -94,7 +95,7 @@ class ForgotPasswordContainer extends React.PureComponent<Props, State> {
9495
Return to Login
9596
</Link>
9697
</div>
97-
</form>
98+
</LoginFormContainer>
9899
</div>
99100
);
100101
}

resources/scripts/components/auth/LoginCheckpointContainer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import MessageBox from '@/components/MessageBox';
77
import { Link } from 'react-router-dom';
88
import loginCheckpoint from '@/api/auth/loginCheckpoint';
99
import { httpErrorToHuman } from '@/api/http';
10+
import LoginFormContainer from '@/components/auth/LoginFormContainer';
1011

1112
type State = Readonly<{
1213
isLoading: boolean;
@@ -61,7 +62,7 @@ class LoginCheckpointContainer extends React.PureComponent<RouteComponentProps<{
6162
Device Checkpoint
6263
</h2>
6364
<NetworkErrorMessage message={this.state.errorMessage}/>
64-
<form className={'login-box'} onSubmit={this.submit}>
65+
<LoginFormContainer onSubmit={this.submit}>
6566
<MessageBox type={'warning'}>
6667
This account is protected with two-factor authentication. A valid authentication token must
6768
be provided in order to continue.
@@ -97,7 +98,7 @@ class LoginCheckpointContainer extends React.PureComponent<RouteComponentProps<{
9798
Return to Login
9899
</Link>
99100
</div>
100-
</form>
101+
</LoginFormContainer>
101102
</React.Fragment>
102103
);
103104
}

resources/scripts/components/auth/LoginContainer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Link, RouteComponentProps } from 'react-router-dom';
33
import login from '@/api/auth/login';
44
import { httpErrorToHuman } from '@/api/http';
55
import NetworkErrorMessage from '@/components/NetworkErrorMessage';
6+
import LoginFormContainer from '@/components/auth/LoginFormContainer';
67

78
type State = Readonly<{
89
errorMessage?: string;
@@ -61,7 +62,7 @@ export default class LoginContainer extends React.PureComponent<RouteComponentPr
6162
Login to Continue
6263
</h2>
6364
<NetworkErrorMessage message={this.state.errorMessage}/>
64-
<form className={'login-box'} onSubmit={this.submit}>
65+
<LoginFormContainer onSubmit={this.submit}>
6566
<label htmlFor={'username'}>Username or Email</label>
6667
<input
6768
id={'username'}
@@ -103,7 +104,7 @@ export default class LoginContainer extends React.PureComponent<RouteComponentPr
103104
Forgot password?
104105
</Link>
105106
</div>
106-
</form>
107+
</LoginFormContainer>
107108
</React.Fragment>
108109
);
109110
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as React from 'react';
2+
3+
export default ({ className, ...props }: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>) => (
4+
<form
5+
className={'flex items-center justify-center login-box'}
6+
{...props}
7+
style={{
8+
paddingLeft: 0,
9+
}}
10+
>
11+
<div className={'flex-none'}>
12+
<img src={'/assets/pterodactyl.svg'} className={'w-64'}/>
13+
</div>
14+
<div className={'flex-1'}>
15+
{props.children}
16+
</div>
17+
</form>
18+
);

resources/scripts/components/auth/ResetPasswordContainer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import performPasswordReset from '@/api/auth/performPasswordReset';
77
import { httpErrorToHuman } from '@/api/http';
88
import { connect } from 'react-redux';
99
import { pushFlashMessage, clearAllFlashMessages } from '@/redux/actions/flash';
10+
import LoginFormContainer from '@/components/auth/LoginFormContainer';
1011

1112
type State = Readonly<{
1213
email?: string;
@@ -91,7 +92,7 @@ class ResetPasswordContainer extends React.PureComponent<Props, State> {
9192
Reset Password
9293
</h2>
9394
<NetworkErrorMessage message={this.state.errorMessage}/>
94-
<form className={'login-box'} onSubmit={this.onSubmit}>
95+
<LoginFormContainer onSubmit={this.onSubmit}>
9596
<label>Email</label>
9697
<input value={this.state.email || ''} disabled={true}/>
9798
<div className={'mt-6'}>
@@ -136,7 +137,7 @@ class ResetPasswordContainer extends React.PureComponent<Props, State> {
136137
Return to Login
137138
</Link>
138139
</div>
139-
</form>
140+
</LoginFormContainer>
140141
</div>
141142
);
142143
}

resources/themes/pterodactyl/templates/auth/core.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
])
44

55
@section('container')
6-
<div class="w-full max-w-xs sm:max-w-sm m-auto mt-8">
6+
<div class="w-full max-w-xs sm:max-w-md m-auto mt-8">
77
<div id="app"></div>
88
</div>
99
@endsection

0 commit comments

Comments
 (0)