From 2d6283d1cd148a94873fd0f97bfd5f748a3e6a68 Mon Sep 17 00:00:00 2001 From: Chen Yu Date: Mon, 11 Nov 2019 10:49:23 +0800 Subject: [PATCH] feat(neuron-ui): remove input truncation on importing keystore. (#1068) * feat(neuron-ui): remove input truncation on importing keystore. * refactor(neuron-ui): hide the password in error message --- .../neuron-ui/src/components/ImportKeystore/index.tsx | 8 +++++++- packages/neuron-ui/src/locales/en.json | 1 + packages/neuron-ui/src/locales/zh.json | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/neuron-ui/src/components/ImportKeystore/index.tsx b/packages/neuron-ui/src/components/ImportKeystore/index.tsx index 3217bb9a17..e1c908c4a0 100644 --- a/packages/neuron-ui/src/components/ImportKeystore/index.tsx +++ b/packages/neuron-ui/src/components/ImportKeystore/index.tsx @@ -98,7 +98,6 @@ const ImportKeystore = (props: React.PropsWithoutRef { @@ -108,6 +107,13 @@ const ImportKeystore = (props: React.PropsWithoutRef maxLength) { + return t(`messages.codes.${ErrorCode.FieldTooLong}`, { + fieldName: key, + fieldValue: key === 'password' ? '' : text, + length: maxLength, + }) + } return '' }} onChange={(_e: React.FormEvent, newValue?: string) => { diff --git a/packages/neuron-ui/src/locales/en.json b/packages/neuron-ui/src/locales/en.json index 679aaad4de..ca5d51d297 100644 --- a/packages/neuron-ui/src/locales/en.json +++ b/packages/neuron-ui/src/locales/en.json @@ -259,6 +259,7 @@ "fields": { "wallet": "Wallet", "name": "Name", + "password": "Password", "remote": "RPC URL", "network": "Network", "address": "Address", diff --git a/packages/neuron-ui/src/locales/zh.json b/packages/neuron-ui/src/locales/zh.json index 2046f8c097..fd69af80e9 100644 --- a/packages/neuron-ui/src/locales/zh.json +++ b/packages/neuron-ui/src/locales/zh.json @@ -259,6 +259,7 @@ "fields": { "wallet": "钱包", "name": "名称", + "password": "密码", "remote": "RPC URL", "network": "网络", "address": "地址",