|
|
@ -26,6 +26,7 @@ import { ActivatedRoute } from '@angular/router'; |
|
|
export class UserComponent { |
|
|
export class UserComponent { |
|
|
|
|
|
|
|
|
public userId: string = ""; |
|
|
public userId: string = ""; |
|
|
|
|
|
public user: any = null; |
|
|
|
|
|
|
|
|
constructor( |
|
|
constructor( |
|
|
public usersService: UsersService, |
|
|
public usersService: UsersService, |
|
|
@ -33,6 +34,9 @@ export class UserComponent { |
|
|
private route: ActivatedRoute, |
|
|
private route: ActivatedRoute, |
|
|
) { |
|
|
) { |
|
|
this.userId = String(this.route.snapshot.paramMap.get('id')); |
|
|
this.userId = String(this.route.snapshot.paramMap.get('id')); |
|
|
|
|
|
this.usersService.getUserdetails(this.userId).subscribe(data => { |
|
|
|
|
|
this.user = data; |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
openClaimRacerDialog() |
|
|
openClaimRacerDialog() |
|
|
@ -40,5 +44,34 @@ export class UserComponent { |
|
|
this.dialog.open(ClaimRacerDialogComponent); |
|
|
this.dialog.open(ClaimRacerDialogComponent); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getUserName() : string { |
|
|
|
|
|
if(!this.user) {return ""} |
|
|
|
|
|
|
|
|
|
|
|
return this.user.nickname || ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getUserId() : string { |
|
|
|
|
|
if(!this.user) {return ""} |
|
|
|
|
|
|
|
|
|
|
|
return this.user.auth0id?.replace("auth0|", "") || ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getUserPicture() : string { |
|
|
|
|
|
if(!this.user) {return ""} |
|
|
|
|
|
|
|
|
|
|
|
return this.user.picture || ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getUserEmail() : string { |
|
|
|
|
|
if(!this.user) {return ""} |
|
|
|
|
|
|
|
|
|
|
|
return this.user.email || ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getUserRealName() : string { |
|
|
|
|
|
if(!this.user) {return "??? ???"} |
|
|
|
|
|
|
|
|
|
|
|
return "??? ???"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|