mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 03:03:26 +00:00
Remove toggle component
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { NavigationModule } from "@bitwarden/components";
|
||||
|
||||
@Component({
|
||||
selector: "app-toggle-width",
|
||||
template: `<bit-nav-item
|
||||
text="Toggle Width"
|
||||
icon="bwi-bug"
|
||||
*ngIf="isDev"
|
||||
(click)="toggleWidth()"
|
||||
></bit-nav-item>`,
|
||||
imports: [CommonModule, NavigationModule],
|
||||
})
|
||||
export class ToggleWidthComponent {
|
||||
protected isDev: boolean;
|
||||
|
||||
constructor(platformUtilsService: PlatformUtilsService) {
|
||||
this.isDev = platformUtilsService.isDev();
|
||||
}
|
||||
|
||||
protected toggleWidth() {
|
||||
if (document.body.style.minWidth === "unset") {
|
||||
document.body.style.minWidth = "";
|
||||
} else {
|
||||
document.body.style.minWidth = "unset";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,11 @@ import { Component, Input } from "@angular/core";
|
||||
import { SideNavVariant, NavigationModule } from "@bitwarden/components";
|
||||
|
||||
import { ProductSwitcherModule } from "./product-switcher/product-switcher.module";
|
||||
import { ToggleWidthComponent } from "./toggle-width.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-side-nav",
|
||||
templateUrl: "web-side-nav.component.html",
|
||||
imports: [CommonModule, NavigationModule, ProductSwitcherModule, ToggleWidthComponent],
|
||||
imports: [CommonModule, NavigationModule, ProductSwitcherModule],
|
||||
})
|
||||
export class WebSideNavComponent {
|
||||
@Input() variant: SideNavVariant = "primary";
|
||||
|
||||
Reference in New Issue
Block a user