Skip to content

Commit

Permalink
Updated PostEventComponent: added click event to 'Zap' button, rename…
Browse files Browse the repository at this point in the history
…d parseContent to _parseContent, and imported ZapService
  • Loading branch information
miladsoft committed Nov 18, 2024
1 parent 6d83b4d commit 2cb68db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/components/post-event/post-event.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<mat-icon class="text-green-500 icon-size-5" [svgIcon]="'heroicons_solid:share'"></mat-icon>
<span class="ml-2">Share</span>
</button>
<button class="mr-1 px-3" mat-button>
<button class="mr-1 px-3" mat-button (click)="openZapDialog()">
<mat-icon class="text-orange-500 icon-size-5" [svgIcon]="'heroicons_solid:bolt'"></mat-icon>
<span class="ml-2">Zap</span>
</button>
Expand Down Expand Up @@ -112,7 +112,7 @@
<div class="mt-0.5 flex flex-col">
<span>
<div
*ngFor="let token of (parseContent.parseContent(reply?.content) || [])"
*ngFor="let token of (_parseContent.parseContent(reply?.content) || [])"
class="inline-block whitespace-pre-wrap break-words"
>
<!-- YouTube Embeds -->
Expand Down
11 changes: 8 additions & 3 deletions src/app/components/post-event/post-event.component.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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

) { }

Expand Down Expand Up @@ -180,7 +182,6 @@ export class PostEventComponent implements OnInit, OnDestroy {
}



private addReaction(postId: string, kind: number, reaction: PostReaction): void {
switch (kind) {
case 1:
Expand Down Expand Up @@ -256,6 +257,10 @@ export class PostEventComponent implements OnInit, OnDestroy {
}


openZapDialog() {
this._zapService.openZapDialog(this.postId, this.user);
}

ngOnDestroy(): void {

if (this.subscriptionId) {
Expand Down

0 comments on commit 2cb68db

Please sign in to comment.