From 2cb68db24a3272611fbc5527aa2bf89c9a54757f Mon Sep 17 00:00:00 2001 From: Milad Raeisi Date: Mon, 18 Nov 2024 11:18:38 +0400 Subject: [PATCH] Updated PostEventComponent: added click event to 'Zap' button, renamed parseContent to _parseContent, and imported ZapService --- .../components/post-event/post-event.component.html | 4 ++-- src/app/components/post-event/post-event.component.ts | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/components/post-event/post-event.component.html b/src/app/components/post-event/post-event.component.html index 9f3f0669..4d2275f1 100644 --- a/src/app/components/post-event/post-event.component.html +++ b/src/app/components/post-event/post-event.component.html @@ -36,7 +36,7 @@ Share - @@ -112,7 +112,7 @@
diff --git a/src/app/components/post-event/post-event.component.ts b/src/app/components/post-event/post-event.component.ts index ff5c5b71..60085c45 100644 --- a/src/app/components/post-event/post-event.component.ts +++ b/src/app/components/post-event/post-event.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; +import { ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { CommonModule } from '@angular/common'; import { Subscription, Subject } from 'rxjs'; @@ -29,6 +29,7 @@ import { PostComponent } from 'app/layout/common/post/post.component'; import { NewEvent } from 'app/types/NewEvent'; import { EventService } from 'app/services/event.service'; import { AngorConfirmationService } from '@angor/services/confirmation'; +import { ZapService } from 'app/services/zap.service'; export interface PostReaction { @@ -87,10 +88,11 @@ export class PostEventComponent implements OnInit, OnDestroy { private _storageService: StorageService, private _subscriptionService: SubscriptionService, private _changeDetectorRef: ChangeDetectorRef, - public parseContent: ParseContentService, + public _parseContent: ParseContentService, private _sanitizer: DomSanitizer, private _eventService: EventService, private _angorConfirmationService: AngorConfirmationService, + private _zapService: ZapService ) { } @@ -180,7 +182,6 @@ export class PostEventComponent implements OnInit, OnDestroy { } - private addReaction(postId: string, kind: number, reaction: PostReaction): void { switch (kind) { case 1: @@ -256,6 +257,10 @@ export class PostEventComponent implements OnInit, OnDestroy { } + openZapDialog() { + this._zapService.openZapDialog(this.postId, this.user); + } + ngOnDestroy(): void { if (this.subscriptionId) {