New login page design
This commit is contained in:
parent
212773d63c
commit
d1880af18d
8 changed files with 33 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,7 +12,7 @@ node_modules
|
||||||
_ide_helper.php
|
_ide_helper.php
|
||||||
.phpstorm.meta.php
|
.phpstorm.meta.php
|
||||||
.php_cs.cache
|
.php_cs.cache
|
||||||
public/assets/*
|
public/assets/manifest.json
|
||||||
|
|
||||||
# For local development with docker
|
# For local development with docker
|
||||||
# Remove if we ever put the Dockerfile in the repo
|
# Remove if we ever put the Dockerfile in the repo
|
||||||
|
|
1
public/assets/pterodactyl.svg
Executable file
1
public/assets/pterodactyl.svg
Executable file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 12 KiB |
|
@ -4,6 +4,7 @@ import requestPasswordResetEmail from '@/api/auth/requestPasswordResetEmail';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { pushFlashMessage, clearAllFlashMessages } from '@/redux/actions/flash';
|
import { pushFlashMessage, clearAllFlashMessages } from '@/redux/actions/flash';
|
||||||
import { httpErrorToHuman } from '@/api/http';
|
import { httpErrorToHuman } from '@/api/http';
|
||||||
|
import LoginFormContainer from '@/components/auth/LoginFormContainer';
|
||||||
|
|
||||||
type Props = Readonly<{
|
type Props = Readonly<{
|
||||||
pushFlashMessage: typeof pushFlashMessage;
|
pushFlashMessage: typeof pushFlashMessage;
|
||||||
|
@ -60,7 +61,7 @@ class ForgotPasswordContainer extends React.PureComponent<Props, State> {
|
||||||
<h2 className={'text-center text-neutral-100 font-medium py-4'}>
|
<h2 className={'text-center text-neutral-100 font-medium py-4'}>
|
||||||
Request Password Reset
|
Request Password Reset
|
||||||
</h2>
|
</h2>
|
||||||
<form className={'login-box'} onSubmit={this.handleSubmission}>
|
<LoginFormContainer onSubmit={this.handleSubmission}>
|
||||||
<label htmlFor={'email'}>Email</label>
|
<label htmlFor={'email'}>Email</label>
|
||||||
<input
|
<input
|
||||||
ref={this.emailField}
|
ref={this.emailField}
|
||||||
|
@ -94,7 +95,7 @@ class ForgotPasswordContainer extends React.PureComponent<Props, State> {
|
||||||
Return to Login
|
Return to Login
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</LoginFormContainer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import MessageBox from '@/components/MessageBox';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import loginCheckpoint from '@/api/auth/loginCheckpoint';
|
import loginCheckpoint from '@/api/auth/loginCheckpoint';
|
||||||
import { httpErrorToHuman } from '@/api/http';
|
import { httpErrorToHuman } from '@/api/http';
|
||||||
|
import LoginFormContainer from '@/components/auth/LoginFormContainer';
|
||||||
|
|
||||||
type State = Readonly<{
|
type State = Readonly<{
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
|
@ -61,7 +62,7 @@ class LoginCheckpointContainer extends React.PureComponent<RouteComponentProps<{
|
||||||
Device Checkpoint
|
Device Checkpoint
|
||||||
</h2>
|
</h2>
|
||||||
<NetworkErrorMessage message={this.state.errorMessage}/>
|
<NetworkErrorMessage message={this.state.errorMessage}/>
|
||||||
<form className={'login-box'} onSubmit={this.submit}>
|
<LoginFormContainer onSubmit={this.submit}>
|
||||||
<MessageBox type={'warning'}>
|
<MessageBox type={'warning'}>
|
||||||
This account is protected with two-factor authentication. A valid authentication token must
|
This account is protected with two-factor authentication. A valid authentication token must
|
||||||
be provided in order to continue.
|
be provided in order to continue.
|
||||||
|
@ -97,7 +98,7 @@ class LoginCheckpointContainer extends React.PureComponent<RouteComponentProps<{
|
||||||
Return to Login
|
Return to Login
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</LoginFormContainer>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { Link, RouteComponentProps } from 'react-router-dom';
|
||||||
import login from '@/api/auth/login';
|
import login from '@/api/auth/login';
|
||||||
import { httpErrorToHuman } from '@/api/http';
|
import { httpErrorToHuman } from '@/api/http';
|
||||||
import NetworkErrorMessage from '@/components/NetworkErrorMessage';
|
import NetworkErrorMessage from '@/components/NetworkErrorMessage';
|
||||||
|
import LoginFormContainer from '@/components/auth/LoginFormContainer';
|
||||||
|
|
||||||
type State = Readonly<{
|
type State = Readonly<{
|
||||||
errorMessage?: string;
|
errorMessage?: string;
|
||||||
|
@ -61,7 +62,7 @@ export default class LoginContainer extends React.PureComponent<RouteComponentPr
|
||||||
Login to Continue
|
Login to Continue
|
||||||
</h2>
|
</h2>
|
||||||
<NetworkErrorMessage message={this.state.errorMessage}/>
|
<NetworkErrorMessage message={this.state.errorMessage}/>
|
||||||
<form className={'login-box'} onSubmit={this.submit}>
|
<LoginFormContainer onSubmit={this.submit}>
|
||||||
<label htmlFor={'username'}>Username or Email</label>
|
<label htmlFor={'username'}>Username or Email</label>
|
||||||
<input
|
<input
|
||||||
id={'username'}
|
id={'username'}
|
||||||
|
@ -103,7 +104,7 @@ export default class LoginContainer extends React.PureComponent<RouteComponentPr
|
||||||
Forgot password?
|
Forgot password?
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</LoginFormContainer>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
18
resources/scripts/components/auth/LoginFormContainer.tsx
Normal file
18
resources/scripts/components/auth/LoginFormContainer.tsx
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
export default ({ className, ...props }: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>) => (
|
||||||
|
<form
|
||||||
|
className={'flex items-center justify-center login-box'}
|
||||||
|
{...props}
|
||||||
|
style={{
|
||||||
|
paddingLeft: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className={'flex-none'}>
|
||||||
|
<img src={'/assets/pterodactyl.svg'} className={'w-64'}/>
|
||||||
|
</div>
|
||||||
|
<div className={'flex-1'}>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
);
|
|
@ -7,6 +7,7 @@ import performPasswordReset from '@/api/auth/performPasswordReset';
|
||||||
import { httpErrorToHuman } from '@/api/http';
|
import { httpErrorToHuman } from '@/api/http';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { pushFlashMessage, clearAllFlashMessages } from '@/redux/actions/flash';
|
import { pushFlashMessage, clearAllFlashMessages } from '@/redux/actions/flash';
|
||||||
|
import LoginFormContainer from '@/components/auth/LoginFormContainer';
|
||||||
|
|
||||||
type State = Readonly<{
|
type State = Readonly<{
|
||||||
email?: string;
|
email?: string;
|
||||||
|
@ -91,7 +92,7 @@ class ResetPasswordContainer extends React.PureComponent<Props, State> {
|
||||||
Reset Password
|
Reset Password
|
||||||
</h2>
|
</h2>
|
||||||
<NetworkErrorMessage message={this.state.errorMessage}/>
|
<NetworkErrorMessage message={this.state.errorMessage}/>
|
||||||
<form className={'login-box'} onSubmit={this.onSubmit}>
|
<LoginFormContainer onSubmit={this.onSubmit}>
|
||||||
<label>Email</label>
|
<label>Email</label>
|
||||||
<input value={this.state.email || ''} disabled={true}/>
|
<input value={this.state.email || ''} disabled={true}/>
|
||||||
<div className={'mt-6'}>
|
<div className={'mt-6'}>
|
||||||
|
@ -136,7 +137,7 @@ class ResetPasswordContainer extends React.PureComponent<Props, State> {
|
||||||
Return to Login
|
Return to Login
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</LoginFormContainer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('container')
|
@section('container')
|
||||||
<div class="w-full max-w-xs sm:max-w-sm m-auto mt-8">
|
<div class="w-full max-w-xs sm:max-w-md m-auto mt-8">
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
Loading…
Reference in a new issue