diff options
3 files changed, 11 insertions, 2 deletions
diff --git a/src/DevHive.Angular/src/app/components/post/post.component.css b/src/DevHive.Angular/src/app/components/post/post.component.css index 5395eb2..c3e3caa 100644 --- a/src/DevHive.Angular/src/app/components/post/post.component.css +++ b/src/DevHive.Angular/src/app/components/post/post.component.css @@ -24,6 +24,10 @@ hr { margin-bottom: .2em; } +.author:hover { + cursor: pointer; +} + .author > img { width: 2.2em; height: 2.2em; diff --git a/src/DevHive.Angular/src/app/components/post/post.component.html b/src/DevHive.Angular/src/app/components/post/post.component.html index 36783e5..8fbda35 100644 --- a/src/DevHive.Angular/src/app/components/post/post.component.html +++ b/src/DevHive.Angular/src/app/components/post/post.component.html @@ -1,6 +1,6 @@ <div class="post rounded-border" *ngIf="loaded"> <div class="content"> - <div class="author"> + <div class="author" (click)="goToAuthorProfile()"> <img class="round-image" [src]="user.imageUrl"> <div class="author-info"> <div class="name"> diff --git a/src/DevHive.Angular/src/app/components/post/post.component.ts b/src/DevHive.Angular/src/app/components/post/post.component.ts index 2f5aa81..7a6b5c0 100644 --- a/src/DevHive.Angular/src/app/components/post/post.component.ts +++ b/src/DevHive.Angular/src/app/components/post/post.component.ts @@ -1,4 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; +import {Router} from '@angular/router'; import { Guid } from 'guid-typescript'; import {AppConstants} from 'src/app/app-constants.module'; import {FeedService} from 'src/app/services/feed.service'; @@ -20,7 +21,7 @@ export class PostComponent implements OnInit { public loaded = false; @Input() paramId: string; - constructor(private _postService: PostService, private _userService: UserService) + constructor(private _postService: PostService, private _userService: UserService, private _router: Router) {} ngOnInit(): void { @@ -45,4 +46,8 @@ export class PostComponent implements OnInit { } ); } + + goToAuthorProfile(): void { + this._router.navigate(['/profile/' + this.user.userName]); + } } |
