1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

[EC-694] Verify Email - Replace Bootstrap with Tailwind (#4211)

* [EC-694] Replace Boostrap with Tailwind

* [EC-694] Simplify tailwind classes

* [EC-694] Update bitAction handler method to remove Promise wrapper

* [EC-694] Coerce bitButton block boolean

* [EC-694] Remove unnecessary try/catch and logging

* [EC-694] Coersce block boolean

* [EC-694] Update boolean coercion

* [EC-694] Apply default value for block boolean and simplify attr class conditional

* [EC-694] Fix block class application / test
This commit is contained in:
Vincent Salucci
2023-01-10 08:59:13 -06:00
committed by GitHub
parent f4219bada9
commit 4eab97272f
3 changed files with 21 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
import { coerceBooleanProperty } from "@angular/cdk/coercion";
import { Input, HostBinding, Component } from "@angular/core";
import { ButtonLikeAbstraction, ButtonType } from "../shared/button-like.abstraction";
@@ -68,9 +69,7 @@ export class ButtonComponent implements ButtonLikeAbstraction {
"hover:tw-no-underline",
"focus:tw-outline-none",
]
.concat(
this.block == null || this.block === false ? ["tw-inline-block"] : ["tw-w-full", "tw-block"]
)
.concat(this.block ? ["tw-w-full", "tw-block"] : ["tw-inline-block"])
.concat(buttonStyles[this.buttonType ?? "secondary"]);
}
@@ -81,7 +80,17 @@ export class ButtonComponent implements ButtonLikeAbstraction {
}
@Input() buttonType: ButtonType;
@Input() block?: boolean;
private _block = false;
@Input()
get block(): boolean {
return this._block;
}
set block(value: boolean | "") {
this._block = coerceBooleanProperty(value);
}
@Input() loading = false;