@@ -5,43 +5,47 @@ import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
55import Time from "../../components/Time" ;
66import Version from "../../components/Version" ;
77
8- interface IProps {
9- }
8+ export default class Locked extends React . Component < any , LockedScreenTypes > {
109
11- export default class Locked extends React . Component < IProps , ForgotPasswordTypes > {
12-
13- private loginValues : ForgotPasswordValuesTypes = {
14- email : null ,
10+ private loginValues : LockedScreenValuesTypes = {
11+ password : null ,
1512 } ;
1613
17- public state : ForgotPasswordTypes = {
18- loginText : "Forgot Password" ,
19- loginBarColor : "gray" ,
20- emptyEmail : false ,
21- loginHidden : false ,
14+ public state : LockedScreenTypes = {
15+ emptyPassword : false ,
2216 } ;
2317
2418 unlock = ( ) : void => {
2519 const emptyString = / ^ $ / ;
26- this . setState ( { emptyEmail : false } ) ;
20+ this . setState ( { emptyPassword : false } ) ;
2721 let valueEmpty : boolean = false ;
28- if ( this . loginValues . email == null || emptyString . test ( this . loginValues . email ) ) {
29- this . setState ( { emptyEmail : true } ) ;
22+ if ( this . loginValues . password == null || emptyString . test ( this . loginValues . password ) ) {
23+ this . setState ( { emptyPassword : true } ) ;
3024 valueEmpty = true ;
3125 }
3226 if ( valueEmpty ) return ;
27+
3328 }
3429
35- handleChange = ( name : "email" ) => ( event : any ) => {
30+ handleChange = ( name : "password" ) => ( event : any ) => {
31+
32+ // const emptyString = /^$/;
33+ // this.setState({emptyPassword: false});
34+ // if (this.loginValues.password == null || emptyString.test(this.loginValues.password)) {
35+ // this.setState({emptyPassword: true});
36+ // }
3637 this . loginValues [ name ] = event . target . value ;
3738 } ;
3839
3940 render ( ) {
4041
4142 return (
4243 < div
43- className = " min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8" >
44- < div className = "max-w-md w-full" >
44+ className = { `min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8` } >
45+ { /*<div className={"absolute top-0 text-white py-3 px-4"}><h1 className={"text-6xl"}>1 SERVER OFFLINE</h1></div>*/ }
46+ < div className = { "absolute top-0 bg-gray-800 rounded left-0 text-gray-600 py-3 px-4" } > < p className = { "" } > 1
47+ SERVER OFFLINE</ p > </ div >
48+ < div className = "bg-gray-800 rounded-lg p-4 max-w-md w-full" >
4549 < div >
4650 < img className = "mx-auto h-32 rounded-full w-32"
4751 src = "https://genericdevelopment.nl/static/media/profilepicture.66f5dc0f.png"
@@ -53,29 +57,32 @@ export default class Locked extends React.Component<IProps, ForgotPasswordTypes>
5357 </ div >
5458 < div className = { "mt-8" } >
5559 < input type = "hidden" name = "remember" value = "true" />
56- < div className = "rounded-md shadow-sm" >
60+ < div className = "rounded-md border-red-700 shadow-sm" >
5761 < div >
58- < input aria-label = "Password" name = "password" type = "password" required
62+ < input onChange = { this . handleChange ( "password" ) }
63+ aria-label = "Password" name = "password" type = "password" required
5964 className = "appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm sm:leading-5"
6065 placeholder = "Password" />
6166 </ div >
62- </ div >
6367
68+ </ div >
69+ < p className = { `${ this . state . emptyPassword ? "block" : "hidden" } text-xs text-red-700` } > You can
70+ not have any empty password field</ p >
6471 < div className = "mt-6 flex" >
65- < Link to = { "/dashboard/overview" } type = "submit"
72+ < button onClick = { this . unlock . bind ( this ) } type = "submit"
6673 className = "group text-center relative flex-1 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-l-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:shadow-outline-indigo active:bg-indigo-700 transition duration-150 ease-in-out" >
6774 Unlock
68- </ Link >
75+ </ button >
6976 < Link to = { "/login" } type = "submit"
70- className = "group relative flex justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-r-md text-white bg-red-600 hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-700 transition duration-150 ease-in-out" >
77+ className = "group relative flex justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-r-md text-white bg-red-600 hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-700 transition duration-150 ease-in-out" >
7178 < FontAwesomeIcon className = { "self-center text-2xl md:text-xl hover:text-red-700" }
7279 icon = { faSignOutAlt } />
7380 </ Link >
7481 </ div >
7582 </ div >
7683 </ div >
7784 < div className = { "absolute bottom-0 left-0 text-gray-600 py-3 px-4" } >
78- < Time /> < Version />
85+ < Time /> < Version />
7986 </ div >
8087 </ div >
8188 ) ;
0 commit comments