Skip to content

Commit f8dccd4

Browse files
committed
feat(ui): add login loader
1 parent 30d3e00 commit f8dccd4

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

ui/src/app/components/login/login.component.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,14 @@ <h2>
5151
<mat-icon matSuffix>123</mat-icon>
5252
</mat-form-field>
5353

54-
<fle-button class="button" mode="primary" appearance="flat" label="Speichern" leftIconName="heroLockClosed"
55-
type="button" (handleClick)="save()"></fle-button>
54+
<div class="login-buttons" [hidden]="loading">
55+
<fle-button class="button" mode="primary" appearance="flat" label="Speichern"
56+
leftIconName="heroLockClosed" type="button" (handleClick)="save()"></fle-button>
57+
</div>
58+
59+
<div class="login-loader" *ngIf="loading">
60+
<mat-spinner color="accent" diameter="48"></mat-spinner>
61+
</div>
5662
</div>
5763
</div>
5864
</div>

ui/src/app/components/login/login.component.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,15 @@ a {
3939

4040
mat-form-field {
4141
width: 100%;
42+
}
43+
44+
.login-loader {
45+
display: flex;
46+
justify-content: center;
47+
align-items: center;
48+
}
49+
50+
.login-buttons,
51+
.login-loader {
52+
height: 48;
4253
}

ui/src/app/components/login/login.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export class LoginComponent implements OnInit {
1414

1515
credentials!: Credentials;
1616

17+
loading: boolean = false;
18+
1719
constructor(
1820
private snackbar: MatSnackBar,
1921
private router: Router,
@@ -26,6 +28,8 @@ export class LoginComponent implements OnInit {
2628
}
2729

2830
save() {
31+
this.loading = true;
32+
2933
this.atossService
3034
.getBalance({
3135
personal_number: this.credentials.personal_number,
@@ -44,6 +48,8 @@ export class LoginComponent implements OnInit {
4448
);
4549

4650
this.router.navigate(['/']);
51+
52+
this.loading = false;
4753
},
4854
error: () => {
4955
this.snackbar.open(
@@ -53,6 +59,8 @@ export class LoginComponent implements OnInit {
5359
duration: 4000,
5460
}
5561
);
62+
63+
this.loading = false;
5664
}
5765
});
5866
}

0 commit comments

Comments
 (0)