mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-19 18:42:26 -05:00
feat(GUI): Add settings for theme, fiat currency and remote nodes (#128)
This commit is contained in:
parent
27d6e23b93
commit
3e79bb3712
37 changed files with 1133 additions and 267 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue