diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index dfc4b56..b4fc496 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -123,6 +123,9 @@ "walletLabel": "Wallet label", "walletLabelPlaceholder": "Wallet label (optional)", + "walletLabelMaxLengthError": "No longer than 32 characters", + "walletLabelWhitespaceError": "Must not be only spaces", + "walletCategory": "Wallet category", "walletCategoryDropdownNone": "No category", "walletCategoryDropdownNew": "New", diff --git a/src/pages/wallets/AddWalletModal.tsx b/src/pages/wallets/AddWalletModal.tsx index cd7ae0c..581856c 100644 --- a/src/pages/wallets/AddWalletModal.tsx +++ b/src/pages/wallets/AddWalletModal.tsx @@ -36,6 +36,7 @@ const [form] = Form.useForm(); const passwordInput = useRef(null); const [calculatedAddress, setCalculatedAddress] = useState(); + const [formatState, setFormatState] = useState("kristwallet"); async function onSubmit() { const values = await form.validateFields(); @@ -46,6 +47,8 @@ } function onValuesChange(changed: Partial, values: Partial) { + if (changed.format) setFormatState(changed.format); + if ((changed.format || changed.password) && values.password) updateCalculatedAddress(values.format, values.password); } @@ -100,6 +103,10 @@ @@ -107,10 +114,7 @@ {/* Wallet category */} - + {getWalletCategoryDropdown({ onNewCategory: category => form.setFieldsValue({ category })})} @@ -121,7 +125,12 @@ {/* Wallet password */} - +