From 2f8981e379a9c6aab50821d391b3dd64e35dab28 Mon Sep 17 00:00:00 2001 From: Vishnu Sreekumaran Nair <200557136@student.georgianc.on.ca> Date: Mon, 5 May 2025 15:10:32 -0400 Subject: [PATCH] import and use adorment in textinput to toggle visibility --- client/src/Pages/Settings/index.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/Pages/Settings/index.jsx b/client/src/Pages/Settings/index.jsx index 7e04d6390..c43ebf69e 100644 --- a/client/src/Pages/Settings/index.jsx +++ b/client/src/Pages/Settings/index.jsx @@ -6,6 +6,7 @@ import Select from "../../Components/Inputs/Select"; import { useIsAdmin } from "../../Hooks/useIsAdmin"; import Dialog from "../../Components/Dialog"; import ConfigBox from "../../Components/ConfigBox"; +import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; import { WalletMultiButton, WalletDisconnectButton, @@ -57,6 +58,7 @@ const Settings = () => { pagespeedApiKey: "", }); const [version, setVersion] = useState("unknown"); + const [apiKeyFieldType, setApiKeyFieldType] = useState("password"); const [errors, setErrors] = useState({}); const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false }; const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState); @@ -290,11 +292,17 @@ const Settings = () => { id="pagespeedApiKey" label="PageSpeed API Key" value={form.pagespeedApiKey} + type={apiKeyFieldType} onChange={handleChange} - type="password" optionalLabel="(Optional)" - helperText={errors.pagespeedApiKey} error={!!errors.pagespeedApiKey} + helperText={errors.pagespeedApiKey} + endAdornment={ + + } />