Add logout

This commit is contained in:
Peter Maquiran
2021-05-28 16:24:37 +01:00
parent 5267caaf80
commit a4e3d431fa
2 changed files with 30 additions and 16 deletions
@@ -1,16 +1,14 @@
<ion-content class=" bg-blue">
<div class="profile-content">
<div class="d-flex justify-space-between align-center">
<div class="go-back d-flex align-center" (click)="close()">
<ion-icon class="icon" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon> <div>Perfil</div>
<ion-icon class="icon" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon> <div>Perfil</div>
</div>
<div class="d-flex " (click)="close()">
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
</div>
</div>
@@ -55,18 +53,28 @@
<ion-footer class=" footer-container ion-no-border bg-blue">
<div class="d-flex justify-space-between">
<ion-buttons slot="start" (click)="close()">
<ion-button class="btn-cancel" fill="clear" color="#061b52" >
<ion-label>Cancelar</ion-label>
</ion-button>
</ion-buttons>
<ion-buttons slot="end" (click)="close()">
<ion-button class="btn-ok" fill="clear" color="#fff" >
<ion-label>Gravar</ion-label>
</ion-button>
</ion-buttons>
<div class="d-flex justify-center mb-10">
<ion-buttons slot="start" (click)="logout()">
<ion-button class="btn-cancel" fill="clear"style="background:#ffe0e0;" >
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
</ion-button>
</ion-buttons>
</div>
<div class="d-flex justify-space-between">
<ion-buttons slot="start" (click)="close()">
<ion-button class="btn-cancel" fill="clear" color="#061b52" >
<ion-label>Cancelar</ion-label>
</ion-button>
</ion-buttons>
<ion-buttons slot="end" (click)="close()">
<ion-button class="btn-ok" fill="clear" color="#fff" >
<ion-label>Gravar</ion-label>
</ion-button>
</ion-buttons>
</div>
</ion-footer>
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AnimationController, ModalController } from '@ionic/angular';
import { User } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
@@ -16,7 +17,8 @@ export class ProfileComponent implements OnInit {
constructor(private modalController:ModalController,
private authService: AuthService,
private animationController: AnimationController) {
private animationController: AnimationController,
private router: Router) {
this.loggeduser = authService.ValidatedUser;
@@ -104,5 +106,9 @@ export class ProfileComponent implements OnInit {
modal.present();
}
logout() {
this.router.navigate(['/']);
}
}