From c4b8309c78e7dfb1bb61b0c7b58ff1b47b9c54cf Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Fri, 3 Jan 2025 19:15:37 +0100 Subject: [PATCH] Fix tooltip --- src/pages/Settings.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index f81c905..32e163d 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -269,10 +269,13 @@ export default function SettingsPage() { type="button" onClick={() => { if (credentialSource !== "env") { - setShowPassword(!showPassword) + setShowPassword(!showPassword); } }} - className="absolute inset-y-0 right-0 pr-3 flex items-center text-muted-foreground hover:text-foreground transition-colors" + disabled={credentialSource === "env"} + className={`absolute inset-y-0 right-0 pr-3 flex items-center ${ + credentialSource === "env" ? "cursor-not-allowed text-muted-foreground" : "text-muted-foreground hover:text-foreground" + }`} > {showPassword ? ( @@ -282,7 +285,9 @@ export default function SettingsPage() { - {showPassword + {credentialSource === "env" + ? "Password visibility is locked by the environment" + : showPassword ? "Hide password" : "Show password"}