From 74d4bd9839b0f50d37ac9d4949aba4d2f1589fc5 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Wed, 11 Jun 2025 15:48:38 -0700 Subject: [PATCH 1/3] update style --- .../src/features/org/org-status-banner.ts | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/frontend/src/features/org/org-status-banner.ts b/frontend/src/features/org/org-status-banner.ts index d673470dc7..e0c5e84b37 100644 --- a/frontend/src/features/org/org-status-banner.ts +++ b/frontend/src/features/org/org-status-banner.ts @@ -1,5 +1,5 @@ import { localized, msg, str } from "@lit/localize"; -import type { SlAlert } from "@shoelace-style/shoelace"; +import type { SlAlert, SlIcon } from "@shoelace-style/shoelace"; import { differenceInHours } from "date-fns/fp"; import { html, type TemplateResult } from "lit"; import { customElement } from "lit/decorators.js"; @@ -18,6 +18,26 @@ type Alert = { }; }; +const iconForVariant = ( + variant: SlAlert["variant"], +): NonNullable => { + switch (variant) { + case "danger": + return "exclamation-triangle"; + case "success": + return "check2-circle"; + case "warning": + return "exclamation-diamond"; + default: + return "info-circle"; + } +}; + +// show banner if <= this many days of trial is left +const MAX_TRIAL_DAYS_SHOW_BANNER = 7; +// display banner as warning if <= +const MAX_TRIAL_DAYS_SHOW_WARNING = 4; + @customElement("btrix-org-status-banner") @localized() export class OrgStatusBanner extends BtrixElement { @@ -29,12 +49,13 @@ export class OrgStatusBanner extends BtrixElement { if (!alert) return; const content = alert.content(); + const variant = alert.variant || "danger"; return html`