Initial
This commit is contained in:
22
listify-client/src/app/account/account.component.html
Normal file
22
listify-client/src/app/account/account.component.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<section class="account-page">
|
||||
<mat-card class="account-card" appearance="outlined">
|
||||
<mat-card-header>
|
||||
<mat-card-title>Willkommen, {{ auth.user()?.name || auth.user()?.email }}</mat-card-title>
|
||||
<mat-card-subtitle>{{ auth.user()?.email }}</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content>
|
||||
<div class="status-row">
|
||||
<mat-icon aria-hidden="true">verified_user</mat-icon>
|
||||
<span>{{ auth.user()?.verified ? 'E-Mail verifiziert' : 'E-Mail nicht verifiziert' }}</span>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions align="end">
|
||||
<button mat-stroked-button type="button" (click)="logout()">
|
||||
<mat-icon aria-hidden="true">logout</mat-icon>
|
||||
Logout
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</section>
|
||||
30
listify-client/src/app/account/account.component.scss
Normal file
30
listify-client/src/app/account/account.component.scss
Normal file
@@ -0,0 +1,30 @@
|
||||
.account-page {
|
||||
min-height: inherit;
|
||||
display: grid;
|
||||
align-items: start;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.account-card {
|
||||
width: min(100%, 520px);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.status-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin-top: 1rem;
|
||||
color: var(--mat-sys-on-surface-variant);
|
||||
}
|
||||
|
||||
.status-row mat-icon {
|
||||
color: var(--mat-sys-primary);
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.account-page {
|
||||
place-items: center;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
}
|
||||
22
listify-client/src/app/account/account.component.ts
Normal file
22
listify-client/src/app/account/account.component.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { AuthService } from '../auth/auth.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-account',
|
||||
imports: [MatButtonModule, MatCardModule, MatIconModule],
|
||||
templateUrl: './account.component.html',
|
||||
styleUrl: './account.component.scss',
|
||||
})
|
||||
export class AccountComponent {
|
||||
protected readonly auth = inject(AuthService);
|
||||
private readonly router = inject(Router);
|
||||
|
||||
logout(): void {
|
||||
this.auth.logout();
|
||||
void this.router.navigateByUrl('/login');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user