Skip to content

Commit

Permalink
click function is using a callback (#214)
Browse files Browse the repository at this point in the history
* click function is using a callback

* requested changes for callback applied
  • Loading branch information
AdiMakkar authored Jan 17, 2024
1 parent 5f379a9 commit ef0c5b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
[tooltipDirection]="tooltipDirection.Above"
[disabled]="loading || model?.canceled == true || isPast()"
[theme]="model?.declined ? 'disabled' : 'secondary-2'"
(click)="confirmEvent()">
[clickFunc]="confirmEventCallback">
<i *ngIf="!loading"
class="fa-circle-check"
[ngClass]="model?.confirmed || model?.declined ? 'fa-solid' : 'fa-regular'">
Expand All @@ -52,7 +52,7 @@
[ariaLabel]="(model?.declined ? translations.eventCard.decline.aria_off : translations.eventCard.decline.aria_on) | translate"
[disabled]="loading || model?.canceled == true || isPast()"
[theme]="model?.confirmed ? 'disabled' : 'error'"
(click)="declineEvent()">
[clickFunc]="declineEventCallback">
<i *ngIf="!loading"
class="fa-circle-xmark"
[ngClass]="model?.declined || model?.confirmed ? 'fa-solid' : 'fa-regular'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export class EventCardComponent implements ICardComponent {
tooltipDirection = TooltipDirection;
routes = CoreRoutes;

confirmEventCallback: Function = this.confirmEvent.bind(this);
declineEventCallback: Function = this.declineEvent.bind(this);

constructor(public translations: Translations,
private router: Router)
{ }
Expand Down

0 comments on commit ef0c5b1

Please sign in to comment.