1
0
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:
Will Martin
2024-04-18 13:23:35 -04:00
committed by GitHub
parent 9277465951
commit d5f503a0d6
32 changed files with 440 additions and 534 deletions

View File

@@ -0,0 +1,39 @@
import { CommonModule } from "@angular/common";
import { ModuleWithProviders, NgModule } from "@angular/core";
import { DefaultNoComponentGlobalConfig, GlobalConfig, TOAST_CONFIG } from "ngx-toastr";
import { ToastComponent } from "./toast.component";
import { BitwardenToastrComponent } from "./toastr.component";
@NgModule({
imports: [CommonModule, ToastComponent],
declarations: [BitwardenToastrComponent],
exports: [BitwardenToastrComponent],
})
export class ToastModule {
static forRoot(config: Partial<GlobalConfig> = {}): ModuleWithProviders<ToastModule> {
return {
ngModule: ToastModule,
providers: [
{
provide: TOAST_CONFIG,
useValue: {
default: BitwardenToastrGlobalConfig,
config: config,
},
},
],
};
}
}
export const BitwardenToastrGlobalConfig: GlobalConfig = {
...DefaultNoComponentGlobalConfig,
toastComponent: BitwardenToastrComponent,
tapToDismiss: false,
timeOut: 5000,
extendedTimeOut: 2000,
maxOpened: 5,
autoDismiss: true,
progressBar: true,
};