From 4eab97272f0f21fdad096d1a4f9814b0134115ab Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Tue, 10 Jan 2023 08:59:13 -0600 Subject: [PATCH] [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 --- .../app/settings/verify-email.component.html | 20 +++++-------------- .../app/settings/verify-email.component.ts | 16 +++------------ .../components/src/button/button.component.ts | 17 ++++++++++++---- 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/apps/web/src/app/settings/verify-email.component.html b/apps/web/src/app/settings/verify-email.component.html index d1ec7aed2f..6fd2128651 100644 --- a/apps/web/src/app/settings/verify-email.component.html +++ b/apps/web/src/app/settings/verify-email.component.html @@ -1,21 +1,11 @@ -
-
+
+
{{ "verifyEmail" | i18n }}
-
+

{{ "verifyEmailDesc" | i18n }}

-
diff --git a/apps/web/src/app/settings/verify-email.component.ts b/apps/web/src/app/settings/verify-email.component.ts index c49b377968..9580a71e22 100644 --- a/apps/web/src/app/settings/verify-email.component.ts +++ b/apps/web/src/app/settings/verify-email.component.ts @@ -39,17 +39,7 @@ export class VerifyEmailComponent { ); } - async send() { - if (this.actionPromise != null) { - return; - } - - try { - this.actionPromise = this.verifyEmail(); - await this.actionPromise; - } catch (e) { - this.logService.error(e); - } - this.actionPromise = null; - } + send = async () => { + await this.verifyEmail(); + }; } diff --git a/libs/components/src/button/button.component.ts b/libs/components/src/button/button.component.ts index 0f3589ebf7..aa26143dc0 100644 --- a/libs/components/src/button/button.component.ts +++ b/libs/components/src/button/button.component.ts @@ -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;