From 0805bbaeeebafb21a3b651b7b31409452172d487 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sun, 22 Mar 2026 13:40:26 +0100 Subject: [PATCH] fix: improve password protection UX with status badge and remove option - Shows green "Password set" badge when a password is active - Simplified placeholder to "Enter new password" - Added helper text explaining current password persists - Added "Remove password protection" link for easy removal - Cleaned up dark-mode toggle styling --- app/sites/[id]/settings/page.tsx | 65 +++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/app/sites/[id]/settings/page.tsx b/app/sites/[id]/settings/page.tsx index 22c1f01..6795db4 100644 --- a/app/sites/[id]/settings/page.tsx +++ b/app/sites/[id]/settings/page.tsx @@ -947,22 +947,30 @@ export default function SiteSettingsPage() {
-
-
-

Password Protection

-

Restrict access to this dashboard.

+
+
+
+

Password Protection

+

Restrict access to this dashboard.

+
+ {isPasswordEnabled && site?.has_password && !formData.password && ( + + + Password set + + )}
@@ -974,15 +982,36 @@ export default function SiteSettingsPage() { exit={{ opacity: 0, height: 0 }} className="overflow-hidden" > - setFormData({ ...formData, password: e.target.value })} - placeholder={site.has_password ? "Change password (leave empty to keep current)" : "Set a password"} - /> -

- Visitors will need to enter this password to view the dashboard. -

+
+ setFormData({ ...formData, password: e.target.value })} + placeholder="Enter new password" + /> + {site?.has_password && ( +

+ Current password will remain unchanged unless you enter a new one. +

+ )} + {site?.has_password && ( + + )} + {!site?.has_password && ( +

+ Visitors will need to enter this password to view the dashboard. +

+ )} +
)}