fixed profile link bug on chrome mobile

master
Max 5 years ago
parent 51ae0a81af
commit 7643227cb1

@ -24,7 +24,8 @@
<!-- <div mat-card-avatar class="example-header-image"></div> --> <!-- <div mat-card-avatar class="example-header-image"></div> -->
<mat-card-title> <mat-card-title>
{{post.author.name}} {{post.author.name}}
<a class="mat-card-subtitle" routerLink="/profile/{{post.author.id}}">@{{post.author.handle}}</a> <!--<a class="mat-card-subtitle" routerLink="/profile/{{post.author.id}}">@{{post.author.handle}}</a>-->
<a class="mat-card-subtitle" (click)="showUserProfile(this.post)">@{{post.author.handle}}</a>
<p class="mat-card-subtitle">&nbsp; {{post.date}}</p> <p class="mat-card-subtitle">&nbsp; {{post.date}}</p>
</mat-card-title> </mat-card-title>
<mat-card-subtitle> <mat-card-subtitle>

@ -11,5 +11,7 @@
.mat-card-subtitle .mat-card-subtitle
display: contents display: contents
a:hover
cursor: pointer

@ -1,6 +1,8 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Post } from 'src/app/models/post'; import { Post } from 'src/app/models/post';
import { FeedService } from 'src/app/services/feed/feed.service'; import { FeedService } from 'src/app/services/feed/feed.service';
import { Router } from '@angular/router';
import { User } from 'src/app/models/user';
@Component({ @Component({
selector: 'feed-postlist', selector: 'feed-postlist',
@ -13,7 +15,7 @@ export class PostlistComponent implements OnInit {
@Output() voteEvent = new EventEmitter<boolean>(); @Output() voteEvent = new EventEmitter<boolean>();
selectedPost: Post; selectedPost: Post;
constructor(private feedService: FeedService) { } constructor(private feedService: FeedService, private router: Router) { }
ngOnInit() { ngOnInit() {
} }
@ -28,4 +30,7 @@ export class PostlistComponent implements OnInit {
this.voteEvent.emit(true); }); this.voteEvent.emit(true); });
} }
public showUserProfile(post: any) {
this.router.navigate(['profile/' + post.author.id]);
}
} }

@ -3,7 +3,7 @@
<mat-form-field id="input" <mat-form-field id="input"
floatLabel="never" > floatLabel="never" >
<input matInput #searchWord <input matInput #searchWord
placeholder="search something" placeholder="search"
[ngModel]="searchWord.value" [ngModel]="searchWord.value"
(ngModelChange)="search(searchWord.value)"> (ngModelChange)="search(searchWord.value)">
<button mat-button matSuffix mat-icon-button> <button mat-button matSuffix mat-icon-button>

Loading…
Cancel
Save