diff --git a/frontend/src/app/components/auth/auth.component.ts b/frontend/src/app/components/auth/auth.component.ts
index 9153ea3..e73bb62 100644
--- a/frontend/src/app/components/auth/auth.component.ts
+++ b/frontend/src/app/components/auth/auth.component.ts
@@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { FormsModule, NgForm } from '@angular/forms';
import { BtnLargeComponent } from '../../shared/components/btn-large/btn-large.component';
+import { Router } from '@angular/router';
@Component({
selector: 'app-auth',
@@ -14,6 +15,8 @@ export class AuthComponent {
mail: '',
};
+ constructor(private router: Router) {}
+
isUserEmailValid(emailValue: string) {
const emailRegex = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/;
return emailRegex.test(emailValue);
@@ -21,8 +24,9 @@ export class AuthComponent {
onSubmit(ngForm: NgForm) {
if (ngForm.submitted && ngForm.form.valid) {
- console.log(this.authData.mail);
- this.authData.mail = '';
+ const queryParams = { mail: this.authData.mail };
+ this.router.navigate(['/register'], { queryParams });
+ ngForm.form.reset();
}
}
}
diff --git a/frontend/src/app/components/auth/register/register.component.html b/frontend/src/app/components/auth/register/register.component.html
index 2e4fe85..e8f165c 100644
--- a/frontend/src/app/components/auth/register/register.component.html
+++ b/frontend/src/app/components/auth/register/register.component.html
@@ -16,13 +16,21 @@
placeholder="Email Address"
autocomplete="email"
[(ngModel)]="authData.mail"
- disabled
+ [class.error-border]="
+ (!mail.valid && mail.touched) ||
+ (mail.touched &&
+ !isUserEmailValid(authData.mail.toLowerCase()) &&
+ authData.mail.length > 0)
+ "
required
/>
- @if (!authData.params) {
-
Click here to resend the registration email.
- }
+ @if (!mail.valid && mail.touched) {
+
Please enter your email
+ } @else { @if (mail.touched && authData.mail.length > 0 &&
+ !isUserEmailValid(authData.mail.toLowerCase())) {
+
This is not a valid email format
+ }}
@@ -63,7 +70,6 @@
authData.password !== authData.passwordConfirm &&
passwordConfirm.touched
"
- [disabled]="!authData.params"
required
/>
@@ -75,8 +81,9 @@
0) ||
- !authData.params ||
+ (!isUserEmailValid(authData.mail) &&
+ authData.mail &&
+ authData.mail.length > 0) ||
authData.password !== authData.passwordConfirm ||
!authData.password ||
!authData.passwordConfirm
diff --git a/frontend/src/app/components/auth/register/register.component.ts b/frontend/src/app/components/auth/register/register.component.ts
index f7faadf..8bff774 100644
--- a/frontend/src/app/components/auth/register/register.component.ts
+++ b/frontend/src/app/components/auth/register/register.component.ts
@@ -13,7 +13,6 @@ import { ActivatedRoute, RouterLink } from '@angular/router';
export class RegisterComponent {
authData = {
mail: '',
- params: false,
password: '',
passwordConfirm: '',
};
@@ -23,9 +22,6 @@ export class RegisterComponent {
ngOnInit(): void {
this.route.queryParams.subscribe((params) => {
this.authData.mail = params['mail'] || '';
- this.authData.mail
- ? (this.authData.params = true)
- : (this.authData.params = false);
});
}
@@ -36,10 +32,8 @@ export class RegisterComponent {
onSubmit(ngForm: NgForm) {
if (ngForm.submitted && ngForm.form.valid) {
- let mail = this.authData.mail;
console.log(this.authData);
ngForm.form.reset();
- ngForm.form.patchValue({ mail: mail });
}
}
}
diff --git a/frontend/src/app/components/home/header/header.component.html b/frontend/src/app/components/home/header/header.component.html
index beb762f..a6d7912 100644
--- a/frontend/src/app/components/home/header/header.component.html
+++ b/frontend/src/app/components/home/header/header.component.html
@@ -1,8 +1,8 @@
-
+
diff --git a/frontend/src/app/components/home/header/header.component.scss b/frontend/src/app/components/home/header/header.component.scss
index 9379cbf..4349d67 100644
--- a/frontend/src/app/components/home/header/header.component.scss
+++ b/frontend/src/app/components/home/header/header.component.scss
@@ -14,6 +14,7 @@ header {
}
.logo {
+ cursor: pointer;
img {
filter: drop-shadow(1px 1px 3px $black);
width: 200px;
diff --git a/frontend/src/app/components/home/header/header.component.ts b/frontend/src/app/components/home/header/header.component.ts
index 5b7db74..e1ffec8 100644
--- a/frontend/src/app/components/home/header/header.component.ts
+++ b/frontend/src/app/components/home/header/header.component.ts
@@ -1,10 +1,11 @@
import { Component } from '@angular/core';
import { BtnLargeComponent } from '../../../shared/components/btn-large/btn-large.component';
+import { RouterLink } from '@angular/router';
@Component({
selector: 'app-header',
standalone: true,
- imports: [BtnLargeComponent],
+ imports: [BtnLargeComponent, RouterLink],
templateUrl: './header.component.html',
styleUrl: './header.component.scss',
})