Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

refactor(dashboard): consolidate action buttons into shared global classes (#803)

Yudhi Armyndharisd2b0aa130c35
diff --git a/dashboard/src/index.css b/dashboard/src/index.css
index 275ae8404..f0ad105a6 100644
--- a/dashboard/src/index.css
+++ b/dashboard/src/index.css
@@ -318,12 +318,68 @@ select:disabled {
transition: all 0.2s;
}
-.btn-secondary:hover {
+.btn-secondary:hover:not(:disabled) {
background: var(--bg-white, #fff);
border-color: var(--text-muted, #94a3b8);
color: var(--text-primary, #1e293b);
}
+.btn-secondary:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
+/* Primary Button — canonical definition; page-scoped copies were consolidated here so the
+ primary CTA looks identical on every page (padding/radius/disabled used to drift per page). */
+.btn-primary {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0.75rem 1.25rem;
+ background: var(--primary, #25d366);
+ color: #fff;
+ border: none;
+ border-radius: 8px;
+ font-size: 0.9375rem;
+ font-weight: 600;
+ cursor: pointer;
+ transition: all 0.2s;
+}
+
+.btn-primary:hover:not(:disabled) {
+ background: var(--primary-hover, #1da851);
+}
+
+.btn-primary:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
+/* Danger Button — canonical definition (page copies also used two different base reds). */
+.btn-danger {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0.75rem 1.25rem;
+ background: var(--error, #ef4444);
+ color: #fff;
+ border: none;
+ border-radius: 8px;
+ font-size: 0.9375rem;
+ font-weight: 600;
+ cursor: pointer;
+ transition: all 0.2s;
+}
+
+.btn-danger:hover:not(:disabled) {
+ background: #b91c1c;
+}
+
+.btn-danger:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
/* Spin Animation */
@keyframes spin {
from {
diff --git a/dashboard/src/pages/ApiKeys.css b/dashboard/src/pages/ApiKeys.css
index 957e33586..90d97a445 100644
--- a/dashboard/src/pages/ApiKeys.css
+++ b/dashboard/src/pages/ApiKeys.css
@@ -10,25 +10,6 @@
/* H1 inherited from global */
-.api-keys-page .btn-primary {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.25rem;
- background: var(--primary);
- color: white;
- border: none;
- border-radius: var(--radius);
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: background 0.2s;
-}
-
-.api-keys-page .btn-primary:hover {
- background: var(--primary-hover);
-}
-
.api-keys-page .api-keys-content {
display: flex;
flex-direction: column;
@@ -263,22 +244,6 @@
color: var(--text-primary);
}
-.api-keys-page .btn-danger {
- padding: 0.75rem 1.25rem;
- background: var(--error);
- color: white;
- border: none;
- border-radius: 8px;
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: background 0.2s;
-}
-
-.api-keys-page .btn-danger:hover {
- background: #b91c1c;
-}
-
/* Mobile Responsive */
/* Status badges — must apply on DESKTOP too (they were stranded inside the mobile media query,
leaving every Active/Revoked badge unstyled on wide screens). */
diff --git a/dashboard/src/pages/Infrastructure.css b/dashboard/src/pages/Infrastructure.css
index cab899b22..e4b4f967a 100644
--- a/dashboard/src/pages/Infrastructure.css
+++ b/dashboard/src/pages/Infrastructure.css
@@ -351,25 +351,6 @@
}
/* Buttons */
-.infrastructure-page .btn-primary {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.625rem 1rem;
- background: var(--primary);
- color: white;
- border: none;
- border-radius: var(--radius);
- font-size: 0.875rem;
- font-weight: 600;
- cursor: pointer;
- transition: background 0.2s;
-}
-
-.infrastructure-page .btn-primary:hover {
- background: var(--primary-hover);
-}
-
.infrastructure-page .btn-primary.large {
padding: 0.875rem 1.5rem;
font-size: 1rem;
diff --git a/dashboard/src/pages/Logs.css b/dashboard/src/pages/Logs.css
index 21995acde..72fe1319f 100644
--- a/dashboard/src/pages/Logs.css
+++ b/dashboard/src/pages/Logs.css
@@ -10,25 +10,6 @@
/* H1 inherited from global */
-.logs-page .btn-secondary {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.25rem;
- background: var(--bg-white);
- color: var(--text-primary);
- border: 1px solid var(--border);
- border-radius: var(--radius);
- font-size: 0.9375rem;
- font-weight: 500;
- cursor: pointer;
- transition: all 0.2s;
-}
-
-.logs-page .btn-secondary:hover {
- background: var(--bg-light);
-}
-
.logs-page .filters-bar {
display: flex;
gap: 1rem;
diff --git a/dashboard/src/pages/Plugins.css b/dashboard/src/pages/Plugins.css
index 83bb74175..60df8ed09 100644
--- a/dashboard/src/pages/Plugins.css
+++ b/dashboard/src/pages/Plugins.css
@@ -539,30 +539,6 @@
margin-top: 1rem;
}
-.plugins-page .btn-primary {
- padding: 0.75rem 1.5rem;
- background: var(--primary, #22c55e);
- color: white;
- border: none;
- border-radius: 8px;
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: all 0.2s;
- display: flex;
- align-items: center;
- gap: 0.5rem;
-}
-
-.plugins-page .btn-primary:hover {
- background: #16a34a;
-}
-
-.plugins-page .btn-primary:disabled {
- opacity: 0.6;
- cursor: not-allowed;
-}
-
/* Update action in the catalog — visually distinct from a fresh Install (which stays the primary
green). "Update available" means a newer version exists; differentiating it (amber) tells the
operator at a glance which rows need upgrading vs. which are fresh installs, instead of every
diff --git a/dashboard/src/pages/Sessions.css b/dashboard/src/pages/Sessions.css
index a3da32a9c..e76f89553 100644
--- a/dashboard/src/pages/Sessions.css
+++ b/dashboard/src/pages/Sessions.css
@@ -11,25 +11,6 @@
/* H1 inherited from global */
-.sessions-page .btn-primary {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.25rem;
- background: var(--primary);
- color: white;
- border: none;
- border-radius: var(--radius);
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: background 0.2s;
-}
-
-.sessions-page .btn-primary:hover {
- background: var(--primary-hover);
-}
-
.sessions-page .filters-bar {
display: flex;
gap: 1rem;
@@ -419,39 +400,6 @@
}
/* Secondary Button */
-.sessions-page .btn-secondary {
- padding: 0.75rem 1.25rem;
- background: var(--bg-light);
- color: var(--text-secondary);
- border: 1px solid var(--border);
- border-radius: var(--radius);
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: all 0.2s;
-}
-
-.sessions-page .btn-secondary:hover {
- background: var(--bg-white);
- border-color: var(--text-muted);
- color: var(--text-primary);
-}
-
-.sessions-page .btn-danger {
- padding: 0.75rem 1.25rem;
- background: #dc2626;
- color: white;
- border: none;
- border-radius: var(--radius);
- font-weight: 600;
- cursor: pointer;
- transition: all 0.2s;
-}
-
-.sessions-page .btn-danger:hover {
- background: #b91c1c;
-}
-
.sessions-page .confirm-modal {
max-width: 400px;
}
diff --git a/dashboard/src/pages/Templates.css b/dashboard/src/pages/Templates.css
index f7e1d5dac..4936bfa21 100644
--- a/dashboard/src/pages/Templates.css
+++ b/dashboard/src/pages/Templates.css
@@ -82,53 +82,8 @@
margin-bottom: 0;
}
-/* btn-primary/btn-secondary were undefined on this page — both action buttons fell back to
- near-browser-default styling. Mirrors the Plugins/Logs button styles for design-system parity.
- Placed BEFORE .templates-new-btn (equal specificity) so its smaller metrics still win on the
- header button. */
-.templates-page .btn-primary {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.5rem;
- background: var(--primary, #22c55e);
- color: #fff;
- border: none;
- border-radius: 8px;
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: all 0.2s;
-}
-
-.templates-page .btn-primary:hover:not(:disabled) {
- background: var(--primary-hover, #16a34a);
-}
-
-.templates-page .btn-primary:disabled {
- opacity: 0.45;
- cursor: not-allowed;
-}
-
-.templates-page .btn-secondary {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.25rem;
- background: var(--bg-white);
- color: var(--text-primary);
- border: 1px solid var(--border);
- border-radius: 8px;
- font-size: 0.9375rem;
- font-weight: 500;
- cursor: pointer;
- transition: all 0.2s;
-}
-
-.templates-page .btn-secondary:hover:not(:disabled) {
- background: var(--bg-light);
-}
-
+/* Primary/secondary/danger buttons on this page come from the shared global classes (index.css).
+ .templates-new-btn only overrides metrics for the compact header button. */
.templates-page .templates-new-btn {
min-height: 36px;
padding: 0.5rem 0.75rem;
@@ -436,23 +391,6 @@
color: var(--error);
}
-.templates-page .btn-danger {
- display: inline-flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.25rem;
- border: none;
- border-radius: var(--radius);
- background: var(--error);
- color: white;
- font-size: 0.9375rem;
- font-weight: 600;
-}
-
-.templates-page .btn-danger:hover {
- background: #b91c1c;
-}
-
.templates-page .toast {
position: fixed;
top: 1.5rem;
diff --git a/dashboard/src/pages/Webhooks.css b/dashboard/src/pages/Webhooks.css
index e29809dca..966bb622a 100644
--- a/dashboard/src/pages/Webhooks.css
+++ b/dashboard/src/pages/Webhooks.css
@@ -30,25 +30,6 @@
/* H1 inherited from global */
-.webhooks-page .btn-primary {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.25rem;
- background: var(--primary);
- color: white;
- border: none;
- border-radius: var(--radius);
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: background 0.2s;
-}
-
-.webhooks-page .btn-primary:hover {
- background: var(--primary-hover);
-}
-
.webhooks-page .webhooks-content {
display: grid;
grid-template-columns: 1fr 280px;
@@ -595,25 +576,6 @@
}
/* Danger Button */
-.webhooks-page .btn-danger {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.75rem 1.25rem;
- background: var(--error);
- color: white;
- border: none;
- border-radius: var(--radius);
- font-size: 0.9375rem;
- font-weight: 600;
- cursor: pointer;
- transition: background 0.2s;
-}
-
-.webhooks-page .btn-danger:hover {
- background: #b91c1c;
-}
-
/* Small Modal Variant */
.webhooks-page .modal.modal-sm {
max-width: 400px;