added profile section in sidenav and changed auth
parent
f3982dd79d
commit
58a3f76a3c
@ -0,0 +1,3 @@
|
|||||||
|
<img class="navbar-photo" src={{profileURL}}>
|
||||||
|
<p>{{name}}</p>
|
||||||
|
<p>{{email}}</p>
|
@ -0,0 +1,8 @@
|
|||||||
|
@import '../../../theme';
|
||||||
|
|
||||||
|
.navbar-photo {
|
||||||
|
width:100px;
|
||||||
|
height:100px;
|
||||||
|
border-radius:50%;
|
||||||
|
margin-top:10px;
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { AuthService } from '../../services/auth.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'sidenav-profile',
|
||||||
|
templateUrl: './sidenav-profile.component.html',
|
||||||
|
styleUrls: ['./sidenav-profile.component.scss']
|
||||||
|
})
|
||||||
|
export class SidenavProfileComponent implements OnInit {
|
||||||
|
name: String;
|
||||||
|
email: String;
|
||||||
|
profileURL: String;
|
||||||
|
|
||||||
|
constructor( private auth: AuthService) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.auth.currentUser.subscribe(user => {
|
||||||
|
this.name = user.user.name;
|
||||||
|
this.email = user.user.email;
|
||||||
|
this.profileURL = user.user.attributes.profile_url;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,13 @@
|
|||||||
export class User {
|
export class User {
|
||||||
email: string;
|
request_token: string;
|
||||||
requestToken: string;
|
refresh_token: string;
|
||||||
refreshToken: string;
|
user: {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
email: string;
|
||||||
|
attributes : {
|
||||||
|
profile_url: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue