Skip to content

Commit

Permalink
Update routing and UI for login and registration pages
Browse files Browse the repository at this point in the history
  • Loading branch information
McNaBry committed Sep 23, 2024
1 parent 8b51880 commit 1728ef6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 25 deletions.
13 changes: 7 additions & 6 deletions frontend/src/app/account/account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import { LayoutComponent } from './layout.component';

const routes: Routes = [
{
path: '', component: LayoutComponent,
path: '',
component: LayoutComponent,
children: [
{ path: 'login', component: LoginComponent },
{ path: 'register', component: RegisterComponent }
]
}
{ path: 'register', component: RegisterComponent },
],
},
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
exports: [RouterModule],
})
export class AccountRoutingModule { }
export class AccountRoutingModule {}
4 changes: 2 additions & 2 deletions frontend/src/app/account/account.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AccountRoutingModule } from './account.component';
AccountRoutingModule,
LayoutComponent,
LoginComponent,
RegisterComponent
RegisterComponent,
],
})
export class AccountModule { }
export class AccountModule {}
17 changes: 6 additions & 11 deletions frontend/src/app/account/layout.component.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { Component } from '@angular/core';
import { Router, RouterModule } from '@angular/router';

@Component({
standalone: true,
imports: [RouterModule],
templateUrl: './layout.component.html'
@Component({
standalone: true,
imports: [RouterModule],
templateUrl: './layout.component.html',
})

export class LayoutComponent {
constructor(
private router: Router,
) {

}
}
constructor(private router: Router) {}
}
4 changes: 2 additions & 2 deletions frontend/src/app/account/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class LoginComponent {
isProcessingLogin = false;

showError() {
this.messageService.add({ severity: 'error', summary: 'Log In Error', detail: 'Missing Details' })
this.messageService.add({ severity: 'error', summary: 'Log In Error', detail: 'Missing Details' });
}

onSubmit() {
Expand All @@ -38,7 +38,7 @@ export class LoginComponent {
setTimeout(() => {
this.isProcessingLogin = false;
console.log('Form Submitted', this.user);
}, 3000);
}, 3000);
} else {
console.log('Invalid form');
}
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/app/account/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ import { MessageService } from 'primeng/api';
@Component({
selector: 'app-register',
standalone: true,
imports: [RouterLink, FormsModule, InputTextModule, ButtonModule, SelectButtonModule, PasswordModule, DividerModule, ToastModule],
imports: [
RouterLink,
FormsModule,
InputTextModule,
ButtonModule,
SelectButtonModule,
PasswordModule,
DividerModule,
ToastModule,
],
providers: [MessageService],
templateUrl: './register.component.html',
styleUrl: './login.component.css',
Expand All @@ -30,7 +39,7 @@ export class RegisterComponent {
isProcessingRegistration = false;

showError() {
this.messageService.add({ severity: 'error', summary: 'Registration Error', detail: 'Missing Details' })
this.messageService.add({ severity: 'error', summary: 'Registration Error', detail: 'Missing Details' });
}

onSubmit() {
Expand All @@ -40,7 +49,7 @@ export class RegisterComponent {
setTimeout(() => {
this.isProcessingRegistration = false;
console.log('Form Submitted', this.user);
}, 3000);
}, 3000);
} else {
console.log('Invalid form');
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ const accountModule = () => import('./account/account.module').then(x => x.Accou
export const routes: Routes = [
{
path: 'account',
loadChildren: accountModule
loadChildren: accountModule,
},
];

0 comments on commit 1728ef6

Please sign in to comment.