Skip to content

Commit a605b30

Browse files
committed
Using icon for logout button
1 parent 1092d09 commit a605b30

5 files changed

Lines changed: 89 additions & 1 deletion

File tree

package-lock.json

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"@angular/platform-browser-dynamic": "^14.1.0",
3636
"@angular/router": "^14.1.0",
3737
"@popperjs/core": "~2.11.0",
38+
"@fortawesome/angular-fontawesome": "^0.11.1",
39+
"@fortawesome/fontawesome-svg-core": "^6.1.1",
40+
"@fortawesome/free-solid-svg-icons": "^6.1.1",
3841
"bootstrap": "~5.2.0",
3942
"rxjs": "~7.5.0",
4043
"tslib": "^2.3.0",
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<button (click)="onLogout()" [disabled]="!isAbleToLogout()">Logout</button>
1+
<button (click)="onLogout()" [disabled]="!isAbleToLogout()" type="button" class="btn btn-default" aria-label="Logout">
2+
<fa-icon [icon]="logoutIcon"></fa-icon>
3+
</button>

src/app/login/containers/logout-button/logout-button.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Component } from '@angular/core';
22
import { Router } from '@angular/router';
33
import { AuthenticationService } from '@app/authentication/service/authentication.service';
4+
import { faRightFromBracket } from '@fortawesome/free-solid-svg-icons';
45

56
@Component({
67
selector: 'logout-button',
@@ -11,6 +12,8 @@ export class LogoutButtonComponent {
1112

1213
private loginUrl = '/login';
1314

15+
public logoutIcon = faRightFromBracket;
16+
1417
constructor(
1518
private authenticationService: AuthenticationService,
1619
private router: Router

src/app/login/login.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common';
22
import { NgModule } from '@angular/core';
33
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
44
import { AuthenticationModule } from '@app/authentication/authentication.module';
5+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
56
import { LoginFormComponent } from './components/login-form/login-form.component';
67
import { LogoutButtonComponent } from './containers/logout-button/logout-button.component';
78
import { LoginRoutingModule } from './login-routing.module';
@@ -17,6 +18,7 @@ import { LoginViewComponent } from './view/login-view/login-view.component';
1718
],
1819
imports: [
1920
LoginRoutingModule,
21+
FontAwesomeModule,
2022
AuthenticationModule,
2123
CommonModule,
2224
FormsModule,

0 commit comments

Comments
 (0)