feat(GUI): Add settings for theme, fiat currency and remote nodes (#128)

This commit is contained in:
Einliterflasche 2024-11-13 22:51:47 +01:00 committed by GitHub
parent 27d6e23b93
commit 3e79bb3712
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 1133 additions and 267 deletions

View file

@ -6,6 +6,7 @@ interface ValidatedTextFieldProps extends Omit<TextFieldProps, "onChange" | "val
isValid: (value: string) => boolean;
onValidatedChange: (value: string | null) => void;
allowEmpty?: boolean;
noErrorWhenEmpty?: boolean;
helperText?: string;
}
@ -17,6 +18,7 @@ export default function ValidatedTextField({
helperText = "Invalid input",
variant = "standard",
allowEmpty = false,
noErrorWhenEmpty = false,
...props
}: ValidatedTextFieldProps) {
const [inputValue, setInputValue] = useState(value || "");
@ -39,7 +41,7 @@ export default function ValidatedTextField({
setInputValue(value || "");
}, [value]);
const isError = allowEmpty && inputValue === "" ? false : !isValid(inputValue);
const isError = allowEmpty && inputValue === "" || inputValue === "" && noErrorWhenEmpty ? false : !isValid(inputValue);
return (
<TextField