added events handling for profile/hashtag to report status selection
This commit is contained in:
parent
c968e65646
commit
8db9305701
|
@ -10,5 +10,6 @@
|
|||
[streamElement]="hashtagElement"
|
||||
[goToTop]="goToTopSubject.asObservable()"
|
||||
(browseAccountEvent)="browseAccount($event)"
|
||||
(browseHashtagEvent)="browseHashtag($event)"></app-stream-statuses>
|
||||
(browseHashtagEvent)="browseHashtag($event)"
|
||||
(browseThreadEvent)="browseThread($event)"></app-stream-statuses>
|
||||
</div>
|
|
@ -12,6 +12,7 @@ import { StreamElement, StreamTypeEnum, AddStream } from '../../../states/stream
|
|||
export class HashtagComponent implements OnInit {
|
||||
@Output() browseAccountEvent = new EventEmitter<string>();
|
||||
@Output() browseHashtagEvent = new EventEmitter<string>();
|
||||
@Output() browseThreadEvent = new EventEmitter<string>();
|
||||
|
||||
@Input() hashtagElement: StreamElement;
|
||||
|
||||
|
@ -45,4 +46,8 @@ export class HashtagComponent implements OnInit {
|
|||
browseHashtag(hashtag: string) {
|
||||
this.browseHashtagEvent.next(hashtag);
|
||||
}
|
||||
|
||||
browseThread(statusUri: string): void {
|
||||
this.browseThreadEvent.next(statusUri);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,9 +8,14 @@
|
|||
|
||||
<app-user-profile *ngIf="accountName" [currentAccount]="accountName"
|
||||
(browseAccountEvent)="browseAccount($event)"
|
||||
(browseHashtagEvent)="browseHashtag($event)"></app-user-profile>
|
||||
(browseHashtagEvent)="browseHashtag($event)"
|
||||
(browseThreadEvent)="browseThread($event)"></app-user-profile>
|
||||
<app-hashtag *ngIf="hashtagElement" [hashtagElement]="hashtagElement"
|
||||
(browseAccountEvent)="browseAccount($event)"
|
||||
(browseHashtagEvent)="browseHashtag($event)"></app-hashtag>
|
||||
<app-thread *ngIf="browseThread" [currentThread]="thread"></app-thread>
|
||||
(browseHashtagEvent)="browseHashtag($event)"
|
||||
(browseThreadEvent)="browseThread($event)"></app-hashtag>
|
||||
<app-thread *ngIf="browseThread" [currentThread]="thread"
|
||||
(browseAccountEvent)="browseAccount($event)"
|
||||
(browseHashtagEvent)="browseHashtag($event)"
|
||||
(browseThreadEvent)="browseThread($event)"></app-thread>
|
||||
</div>
|
|
@ -56,4 +56,16 @@ export class ThreadComponent implements OnInit {
|
|||
onScroll(){
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
browseAccount(accountName: string): void {
|
||||
this.browseAccountEvent.next(accountName);
|
||||
}
|
||||
|
||||
browseHashtag(hashtag: string): void {
|
||||
this.browseHashtagEvent.next(hashtag);
|
||||
}
|
||||
|
||||
browseThread(statusUri: string): void {
|
||||
this.browseThreadEvent.next(statusUri);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
<div *ngFor="let statusWrapper of statuses">
|
||||
<app-status [statusWrapper]="statusWrapper"
|
||||
(browseHashtagEvent)="browseHashtag($event)"
|
||||
(browseAccountEvent)="browseAccount($event)"></app-status>
|
||||
(browseAccountEvent)="browseAccount($event)"
|
||||
(browseThreadEvent)="browseThread($event)"></app-status>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -23,6 +23,7 @@ export class UserProfileComponent implements OnInit {
|
|||
|
||||
@Output() browseAccountEvent = new EventEmitter<string>();
|
||||
@Output() browseHashtagEvent = new EventEmitter<string>();
|
||||
@Output() browseThreadEvent = new EventEmitter<string>();
|
||||
|
||||
@Input('currentAccount')
|
||||
//set currentAccount(account: Account) {
|
||||
|
@ -59,6 +60,10 @@ export class UserProfileComponent implements OnInit {
|
|||
this.browseHashtagEvent.next(hashtag);
|
||||
}
|
||||
|
||||
browseThread(statusUri: string): void {
|
||||
this.browseThreadEvent.next(statusUri);
|
||||
}
|
||||
|
||||
private loadAccount(accountName: string): Promise<Account> {
|
||||
this.account = null;
|
||||
this.accountName = accountName;
|
||||
|
|
Loading…
Reference in New Issue