Skip to content
Snippets Groups Projects
Commit efd692db authored by HUSS THEOPHILE's avatar HUSS THEOPHILE
Browse files

fix: Show username when user is connected

parent a64dfeee
Branches
1 merge request!56style: fix css in profile
Pipeline #304149 failed with stages
in 9 seconds
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
src="https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png" src="https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png"
alt="profile picture" alt="profile picture"
/> />
<h3>User Name</h3> <h3>{{ username }}</h3>
</div> </div>
<hr /> <hr />
<div class="profile_stats"> <div class="profile_stats">
......
...@@ -11,6 +11,7 @@ import { UserService } from '../../../services/user.service'; ...@@ -11,6 +11,7 @@ import { UserService } from '../../../services/user.service';
export class ProfileInfoComponent implements OnInit { export class ProfileInfoComponent implements OnInit {
quizList: any[] = []; quizList: any[] = [];
isLogged: boolean = false; isLogged: boolean = false;
username: string = 'Anonymous';
constructor(private router: Router, private cookieService: CookieService, private userSerivce: UserService) {} constructor(private router: Router, private cookieService: CookieService, private userSerivce: UserService) {}
ngOnInit(): void { ngOnInit(): void {
...@@ -31,8 +32,9 @@ export class ProfileInfoComponent implements OnInit { ...@@ -31,8 +32,9 @@ export class ProfileInfoComponent implements OnInit {
{ title: 'Quiz 14', content: 'Quiz 14 Content' }, { title: 'Quiz 14', content: 'Quiz 14 Content' },
{ title: 'Quiz 15', content: 'Quiz 15 Content' }, { title: 'Quiz 15', content: 'Quiz 15 Content' },
]; ];
this.userSerivce.getMe().subscribe((data) => { this.userSerivce.getMe().subscribe((data: any) => {
this.isLogged = true; this.isLogged = true;
this.username = data.username;
}); });
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment