mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
[CL-18] toast component and service (#6490)
Update toast styles and new service to CL.
This commit is contained in:
26
libs/components/src/toast/toastr.component.ts
Normal file
26
libs/components/src/toast/toastr.component.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { animate, state, style, transition, trigger } from "@angular/animations";
|
||||
import { Component } from "@angular/core";
|
||||
import { Toast as BaseToastrComponent } from "ngx-toastr";
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<bit-toast
|
||||
[title]="options?.payload?.title"
|
||||
[variant]="options?.payload?.variant"
|
||||
[message]="options?.payload?.message"
|
||||
[progressWidth]="width"
|
||||
(onClose)="remove()"
|
||||
></bit-toast>
|
||||
`,
|
||||
animations: [
|
||||
trigger("flyInOut", [
|
||||
state("inactive", style({ opacity: 0 })),
|
||||
state("active", style({ opacity: 1 })),
|
||||
state("removed", style({ opacity: 0 })),
|
||||
transition("inactive => active", animate("{{ easeTime }}ms {{ easing }}")),
|
||||
transition("active => removed", animate("{{ easeTime }}ms {{ easing }}")),
|
||||
]),
|
||||
],
|
||||
preserveWhitespaces: false,
|
||||
})
|
||||
export class BitwardenToastrComponent extends BaseToastrComponent {}
|
||||
Reference in New Issue
Block a user