Skip to content

Commit

Permalink
fix: add class names to status
Browse files Browse the repository at this point in the history
  • Loading branch information
vapkse committed Jul 2, 2024
1 parent 986dc5f commit f5fa8e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions projects/status/src/status.component.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<snackbar *ngIf="status" alignment="bottom right" [class.hasInfo]="!!status.technicalText" class="snackbar snackbar-{{status.type}}">
<snackbar *ngIf="status" alignment="bottom right" [class.hasInfo]="!!status.technicalText" class="snackbar snackbar-{{status.type}} {{status.className}}">
<mat-icon *ngIf="statusIcon">{{statusIcon}}</mat-icon>
<span>
<b>{{status.title}}</b>
<p *ngIf="status.text" [innerHTML]="status.text"></p>
<div class="user-defined-actions" *ngIf="status.actions?.length">
<button type="button" *ngFor="let action of status.actions" mat-button (click)="executeAction(action)">{{action.label}}</button>
<button type="button" *ngFor="let action of status.actions" mat-button (click)="executeAction(action)" [class]="action.className">{{action.label}}</button>
</div>
<span class="action-container">
<mat-icon inline (click)="displayDetailedStatus$.next(status)" *ngIf="status.technicalText">info</mat-icon>
<mat-icon inline (click)="close.next()">close</mat-icon>
<mat-icon class="info" inline (click)="displayDetailedStatus$.next(status)" *ngIf="status.technicalText">info</mat-icon>
<mat-icon class="close" inline (click)="close.next()">close</mat-icon>
</span>
</span>
</snackbar>
2 changes: 2 additions & 0 deletions projects/status/src/status.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export type StatusType = 'info' | 'primary' | 'success' | 'warn' | 'danger';
export interface StatusAction {
label: string;
terminal?: boolean;
className?: string;
callback: () => void;
}

Expand All @@ -14,5 +15,6 @@ export interface Status {
date?: Date;
originalError?: unknown;
duration?: number;
className?: string;
actions?: readonly StatusAction[];
}

0 comments on commit f5fa8e1

Please sign in to comment.