35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { Component, OnDestroy, OnInit } from "@angular/core";
|
|
import { ActivatedRoute, RouterModule } from "@angular/router";
|
|
|
|
import { AnonLayoutComponent } from "@bitwarden/auth/angular";
|
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
|
import { Icon } from "@bitwarden/components";
|
|
|
|
@Component({
|
|
standalone: true,
|
|
templateUrl: "anon-layout-wrapper.component.html",
|
|
imports: [AnonLayoutComponent, RouterModule],
|
|
})
|
|
export class AnonLayoutWrapperComponent implements OnInit, OnDestroy {
|
|
protected pageTitle: string;
|
|
protected pageSubtitle: string;
|
|
protected pageIcon: Icon;
|
|
|
|
constructor(
|
|
private route: ActivatedRoute,
|
|
private i18nService: I18nService,
|
|
) {
|
|
this.pageTitle = this.i18nService.t(this.route.snapshot.firstChild.data["pageTitle"]);
|
|
this.pageSubtitle = this.i18nService.t(this.route.snapshot.firstChild.data["pageSubtitle"]);
|
|
this.pageIcon = this.route.snapshot.firstChild.data["pageIcon"]; // don't translate
|
|
}
|
|
|
|
ngOnInit() {
|
|
document.body.classList.add("layout_frontend");
|
|
}
|
|
|
|
ngOnDestroy() {
|
|
document.body.classList.remove("layout_frontend");
|
|
}
|
|
}
|