From 8505bd9d859a69378f59de2c95afbe9d37d97b5e Mon Sep 17 00:00:00 2001 From: Milad Raeisi Date: Fri, 1 Nov 2024 06:37:24 +0400 Subject: [PATCH] Add link to chat page --- .../components/bookmark/bookmark.component.ts | 58 +++++++++++-------- .../components/explore/explore.component.ts | 5 +- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/src/app/components/bookmark/bookmark.component.ts b/src/app/components/bookmark/bookmark.component.ts index 536308e..d69c52d 100644 --- a/src/app/components/bookmark/bookmark.component.ts +++ b/src/app/components/bookmark/bookmark.component.ts @@ -12,36 +12,36 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { RouterLink } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { BookmarkService } from 'app/services/bookmark.service'; import { Project } from 'app/interface/project.interface'; import { StorageService } from 'app/services/storage.service'; import { Observable, Subject, takeUntil } from 'rxjs'; @Component({ - selector: 'app-bookmark', - standalone: true, - imports: [ - MatButtonModule, - RouterLink, - MatIconModule, - AngorCardComponent, - CdkScrollable, - MatFormFieldModule, - MatSelectModule, - MatOptionModule, - MatInputModule, - MatSlideToggleModule, - NgClass, - MatTooltipModule, - MatProgressBarModule, - AngorFindByKeyPipe, - PercentPipe, - I18nPluralPipe, - CommonModule, - ], - templateUrl: './bookmark.component.html', - styleUrls: ['./bookmark.component.scss'] + selector: 'app-bookmark', + standalone: true, + imports: [ + MatButtonModule, + RouterLink, + MatIconModule, + AngorCardComponent, + CdkScrollable, + MatFormFieldModule, + MatSelectModule, + MatOptionModule, + MatInputModule, + MatSlideToggleModule, + NgClass, + MatTooltipModule, + MatProgressBarModule, + AngorFindByKeyPipe, + PercentPipe, + I18nPluralPipe, + CommonModule, + ], + templateUrl: './bookmark.component.html', + styleUrls: ['./bookmark.component.scss'] }) export class BookmarkComponent implements OnInit, OnDestroy { savedProjects: Project[] = []; @@ -51,6 +51,7 @@ export class BookmarkComponent implements OnInit, OnDestroy { constructor( private _bookmarkService: BookmarkService, private _storageService: StorageService, + private _router: Router, ) { this.bookmarks$ = this._bookmarkService.bookmarks$; } @@ -110,4 +111,13 @@ export class BookmarkComponent implements OnInit, OnDestroy { this._unsubscribeAll.next(null); this._unsubscribeAll.complete(); } + + goToProjectDetails(project: Project): void { + this._router.navigate(['/profile', project.nostrPubKey]); + } + openChat(pubKey : string): void + { + this._router.navigate(['/chat', pubKey]); + } + } diff --git a/src/app/components/explore/explore.component.ts b/src/app/components/explore/explore.component.ts index 3176b05..4295552 100644 --- a/src/app/components/explore/explore.component.ts +++ b/src/app/components/explore/explore.component.ts @@ -215,8 +215,9 @@ export class ExploreComponent implements OnInit, OnDestroy { } - openChat(pubKey: string): void { - + openChat(pubKey : string): void + { + this._router.navigate(['/chat', pubKey]); }