diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7ded354..7dca7ae 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -42,6 +42,7 @@ import { DayPilot, DayPilotModule } from "@daypilot/daypilot-lite-angular"; import { registerLocaleData } from '@angular/common'; import localeFr from '@angular/common/locales/fr'; import { CardAvatarComponent } from './components/card-avatar/card-avatar.component'; +import { DeconnexionComponent } from './components/deconnexion/deconnexion.component'; registerLocaleData(localeFr) @NgModule({ @@ -82,6 +83,7 @@ registerLocaleData(localeFr) PageDeleteAccountComponent, PageUpdateAccountComponent, CardAvatarComponent, + DeconnexionComponent, ], imports: [ diff --git a/src/app/components/deconnexion/deconnexion.component.html b/src/app/components/deconnexion/deconnexion.component.html new file mode 100644 index 0000000..a6d16bd --- /dev/null +++ b/src/app/components/deconnexion/deconnexion.component.html @@ -0,0 +1,7 @@ + diff --git a/src/app/components/deconnexion/deconnexion.component.scss b/src/app/components/deconnexion/deconnexion.component.scss new file mode 100644 index 0000000..58c6ef8 --- /dev/null +++ b/src/app/components/deconnexion/deconnexion.component.scss @@ -0,0 +1,10 @@ +.btn-circle.btn-xl { + width: 80px; + height: 80px; + padding: 10px 16px; + border-radius: 40px; + font-size: 10px; + text-align: center; + float: right; + margin-right: 20px; +} diff --git a/src/app/components/deconnexion/deconnexion.component.spec.ts b/src/app/components/deconnexion/deconnexion.component.spec.ts new file mode 100644 index 0000000..a27c036 --- /dev/null +++ b/src/app/components/deconnexion/deconnexion.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DeconnexionComponent } from './deconnexion.component'; + +describe('DeconnexionComponent', () => { + let component: DeconnexionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DeconnexionComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DeconnexionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/deconnexion/deconnexion.component.ts b/src/app/components/deconnexion/deconnexion.component.ts new file mode 100644 index 0000000..aebfebf --- /dev/null +++ b/src/app/components/deconnexion/deconnexion.component.ts @@ -0,0 +1,26 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { TokenService } from 'src/app/services/token.service'; + +@Component({ + selector: 'app-deconnexion', + templateUrl: './deconnexion.component.html', + styleUrls: ['./deconnexion.component.scss'] +}) +export class DeconnexionComponent implements OnInit { + + constructor(private tokenService: TokenService, + private router: Router, + private route: ActivatedRoute) { } + + ngOnInit(): void { + } + + + onClickDeco(){ + this.tokenService.eraseToken(); + this.router.navigate(['accueil']); + + } + +} diff --git a/src/app/components/header/header.component.html b/src/app/components/header/header.component.html index 7e79e47..09c2a30 100644 --- a/src/app/components/header/header.component.html +++ b/src/app/components/header/header.component.html @@ -1,10 +1,17 @@ -