|
|
@ -11,6 +11,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
|
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
|
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
|
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
|
|
import { NgClass, NgOptimizedImage } from '@angular/common';
|
|
|
|
import { NgClass, NgOptimizedImage } from '@angular/common';
|
|
|
|
|
|
|
|
import { UserService } from 'src/app/services/user.service';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
selector: 'app-header',
|
|
|
|
selector: 'app-header',
|
|
|
@ -36,7 +37,10 @@ export class HeaderComponent {
|
|
|
|
@Input() themeService!: ThemeService;
|
|
|
|
@Input() themeService!: ThemeService;
|
|
|
|
|
|
|
|
|
|
|
|
// Instanciation du service pour les actions de traduction
|
|
|
|
// Instanciation du service pour les actions de traduction
|
|
|
|
constructor(private translationService: TranslationService) {}
|
|
|
|
constructor(
|
|
|
|
|
|
|
|
private translationService: TranslationService,
|
|
|
|
|
|
|
|
private userService: UserService
|
|
|
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
|
|
// Méthode pour changer la langue
|
|
|
|
// Méthode pour changer la langue
|
|
|
|
onLanguageChange(event: Event) {
|
|
|
|
onLanguageChange(event: Event) {
|
|
|
@ -63,4 +67,15 @@ export class HeaderComponent {
|
|
|
|
document.body.classList.remove('no-scroll');
|
|
|
|
document.body.classList.remove('no-scroll');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Logout
|
|
|
|
|
|
|
|
logout() {
|
|
|
|
|
|
|
|
this.userService.logoutUser().subscribe((response) => {
|
|
|
|
|
|
|
|
if (response.success) {
|
|
|
|
|
|
|
|
console.log('Logout success');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
console.log('Logout error');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|