import and use adorment in textinput to toggle visibility
This commit is contained in:
1 parent
d58dee6983
commit
2f8981e379
1 file changed
+10
-2
@@ -6,6 +6,7 @@ import Select from "../../Components/Inputs/Select";
|
|||||||
import { useIsAdmin } from "../../Hooks/useIsAdmin";
|
import { useIsAdmin } from "../../Hooks/useIsAdmin";
|
||||||
import Dialog from "../../Components/Dialog";
|
import Dialog from "../../Components/Dialog";
|
||||||
import ConfigBox from "../../Components/ConfigBox";
|
import ConfigBox from "../../Components/ConfigBox";
|
||||||
|
import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments";
|
||||||
import {
|
import {
|
||||||
WalletMultiButton,
|
WalletMultiButton,
|
||||||
WalletDisconnectButton,
|
WalletDisconnectButton,
|
||||||
@@ -57,6 +58,7 @@ const Settings = () => {
|
|||||||
pagespeedApiKey: "",
|
pagespeedApiKey: "",
|
||||||
});
|
});
|
||||||
const [version, setVersion] = useState("unknown");
|
const [version, setVersion] = useState("unknown");
|
||||||
|
const [apiKeyFieldType, setApiKeyFieldType] = useState("password");
|
||||||
const [errors, setErrors] = useState({});
|
const [errors, setErrors] = useState({});
|
||||||
const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false };
|
const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false };
|
||||||
const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState);
|
const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState);
|
||||||
@@ -290,11 +292,17 @@ const Settings = () => {
|
|||||||
id="pagespeedApiKey"
|
id="pagespeedApiKey"
|
||||||
label="PageSpeed API Key"
|
label="PageSpeed API Key"
|
||||||
value={form.pagespeedApiKey}
|
value={form.pagespeedApiKey}
|
||||||
|
type={apiKeyFieldType}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
type="password"
|
|
||||||
optionalLabel="(Optional)"
|
optionalLabel="(Optional)"
|
||||||
helperText={errors.pagespeedApiKey}
|
|
||||||
error={!!errors.pagespeedApiKey}
|
error={!!errors.pagespeedApiKey}
|
||||||
|
helperText={errors.pagespeedApiKey}
|
||||||
|
endAdornment={
|
||||||
|
<PasswordEndAdornment
|
||||||
|
fieldType={apiKeyFieldType}
|
||||||
|
setFieldType={setApiKeyFieldType}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
|
|||||||
Reference in new issue
Block a user