diff --git a/kibicara-frontend/src/app/auth/login/login.component.html b/kibicara-frontend/src/app/auth/login/login.component.html index 9d44072..c39f19b 100644 --- a/kibicara-frontend/src/app/auth/login/login.component.html +++ b/kibicara-frontend/src/app/auth/login/login.component.html @@ -1,47 +1,49 @@ -
{{ error }}
-
{{ info }}
-

Login

-
-
- - -
-
- Email is required -
-
-
-
- - -
-
- Password is required -
-
-
-
- - Register -
-
+
+ + +

Log in as hood admin!

+
+ +
+
+ + E-Mail + + + Email is required + + + + Password + + + Password is required + + +
+
+ + Register +
+
+
+
+ +
diff --git a/kibicara-frontend/src/app/auth/login/login.component.scss b/kibicara-frontend/src/app/auth/login/login.component.scss index e69de29..b761b1b 100644 --- a/kibicara-frontend/src/app/auth/login/login.component.scss +++ b/kibicara-frontend/src/app/auth/login/login.component.scss @@ -0,0 +1,43 @@ +.input-container { + display: grid; + grid-template-rows: 1fr 1fr; + margin-left: 5%; + margin-right: 5%; + margin-bottom: 5%; + margin-top: 3%; +} + +.mat-card:not([class*="mat-elevation-z"]) { + box-shadow: none; +} + +.container { + display: grid; + grid-template-columns: 1fr 1fr; + margin-left: 10%; + margin-right: 10%; + margin-top: 5%; + @media (max-width: 600px) { + grid-template-columns: 1fr; + margin-top: 10%; + margin-left: 5%; + margin-right: 5%; + } +} + +.banner { + background: url("../../../assets/hoods1.jpg"); + background-size: 100%; + display: block; + width: 100%; + height: 100%; +} + +.buttons { + margin-left: 20px; +} + +.login-form { + margin-top: 10%; + margin-bottom: 10%; +} diff --git a/kibicara-frontend/src/app/auth/login/login.component.ts b/kibicara-frontend/src/app/auth/login/login.component.ts index 82f3072..ce98403 100644 --- a/kibicara-frontend/src/app/auth/login/login.component.ts +++ b/kibicara-frontend/src/app/auth/login/login.component.ts @@ -3,6 +3,7 @@ import { LoginService } from '../../core/auth/login.service'; import { Router, ActivatedRoute } from '@angular/router'; import { Validators, FormGroup, FormBuilder } from '@angular/forms'; import { first } from 'rxjs/operators'; +import { MatSnackBar } from '@angular/material/snack-bar'; @Component({ selector: 'app-login', @@ -12,16 +13,16 @@ import { first } from 'rxjs/operators'; export class LoginComponent implements OnInit { loginForm: FormGroup; returnUrl: string; - error: string; loading = false; submitted = false; - info: string; + hide = true; constructor( private loginService: LoginService, private router: Router, private route: ActivatedRoute, - private formBuilder: FormBuilder + private formBuilder: FormBuilder, + private snackBar: MatSnackBar ) { if (this.loginService.currentHoodAdminValue) { this.router.navigate(['/dashboard']); @@ -37,7 +38,9 @@ export class LoginComponent implements OnInit { this.route.snapshot.queryParams['returnUrl'] || '/dashboard'; if (this.route.snapshot.queryParams['registered'] === true) { - this.info = 'Registration successful'; + this.snackBar.open('Registration successful', 'Close', { + duration: 2000, + }); } } @@ -59,7 +62,9 @@ export class LoginComponent implements OnInit { this.router.navigate([this.returnUrl]); }, (error) => { - this.error = 'Wrong credentials! Try again.'; + this.snackBar.open('Wrong credentials! Try again.', 'Close', { + duration: 2000, + }); this.loading = false; } ); diff --git a/kibicara-frontend/src/app/shared/material/material.module.ts b/kibicara-frontend/src/app/shared/material/material.module.ts index ae9bb58..1864ac5 100644 --- a/kibicara-frontend/src/app/shared/material/material.module.ts +++ b/kibicara-frontend/src/app/shared/material/material.module.ts @@ -8,6 +8,8 @@ import { MatCardModule } from '@angular/material/card'; import { MatExpansionModule } from '@angular/material/expansion'; import { MatListModule } from '@angular/material/list'; import { MatInputModule } from '@angular/material/input'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; @NgModule({ declarations: [], @@ -21,6 +23,8 @@ import { MatInputModule } from '@angular/material/input'; MatExpansionModule, MatListModule, MatInputModule, + MatDialogModule, + MatSnackBarModule, ], exports: [ MatButtonModule, @@ -32,6 +36,8 @@ import { MatInputModule } from '@angular/material/input'; MatExpansionModule, MatListModule, MatInputModule, + MatDialogModule, + MatSnackBarModule, ], }) export class MaterialModule {} diff --git a/kibicara-frontend/src/assets/hoods1.jpg b/kibicara-frontend/src/assets/hoods1.jpg new file mode 100644 index 0000000..d291a61 Binary files /dev/null and b/kibicara-frontend/src/assets/hoods1.jpg differ