From 2d81a48e9769d52eda8ac53a9419679d1f9bcfc5 Mon Sep 17 00:00:00 2001 From: MaZ <126461030+mazmassa@users.noreply.github.com> Date: Fri, 16 Jun 2023 01:33:18 +0200 Subject: [PATCH] fix wails currency, account name i18n and currency field (#419) --- .../src/pages/ImportPrivateKey/PromptNickname.tsx | 4 ++-- wails-frontend/src/pages/passwordPrompt.tsx | 10 ++++++---- web-frontend/src/pages/CreateAccount/StepOne.tsx | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wails-frontend/src/pages/ImportPrivateKey/PromptNickname.tsx b/wails-frontend/src/pages/ImportPrivateKey/PromptNickname.tsx index abae32e82..98d074b7a 100644 --- a/wails-frontend/src/pages/ImportPrivateKey/PromptNickname.tsx +++ b/wails-frontend/src/pages/ImportPrivateKey/PromptNickname.tsx @@ -18,7 +18,7 @@ const t = (key: string): string => { const errors: Record = { 'nickname-required': 'The account name is required', 'nickname-already-exists': 'This account name already exists', - 'nickname-invalid-format': + 'account-invalid-format': "The account name can't contain any special characters", }; @@ -50,7 +50,7 @@ function PromptNickname() { const nicknameIsValid = await IsNicknameValid(nickname); if (!nicknameIsValid) { - setError({ nickname: t('nickname-invalid-format') }); + setError({ nickname: t('account-invalid-format') }); return false; } diff --git a/wails-frontend/src/pages/passwordPrompt.tsx b/wails-frontend/src/pages/passwordPrompt.tsx index 888287edf..3bf3ff6b5 100644 --- a/wails-frontend/src/pages/passwordPrompt.tsx +++ b/wails-frontend/src/pages/passwordPrompt.tsx @@ -16,7 +16,7 @@ import { Password, Button } from '@massalabs/react-ui-kit'; import { ErrorCode, IErrorObject } from '../utils'; import { Layout } from '../layouts/Layout/Layout'; import Intl from '../i18n/i18n'; -import { formatStandard } from '../utils/massaFormat'; +import { formatStandard, Unit } from '../utils/massaFormat'; import { toMAS } from '@massalabs/massa-web3'; interface PromptRequestDeleteData { @@ -76,9 +76,11 @@ function PasswordPrompt() { const transferData = req.Data as PromptRequestTransferData; return `Transfer ${formatStandard( toMAS(transferData.Amount).toString(), - )} Massa from ${transferData.NicknameFrom} to - ${transferData.RecipientAddress}, - with fee(s) ${transferData.Fee} nonaMassa`; + Unit.MAS, + 9, + )} Massa from ${transferData.NicknameFrom} to ${ + transferData.RecipientAddress + }, with fee(s) of ${transferData.Fee} nanoMassa`; } default: return Intl.t('password-prompt.subtitle.default'); diff --git a/web-frontend/src/pages/CreateAccount/StepOne.tsx b/web-frontend/src/pages/CreateAccount/StepOne.tsx index 0d22fb597..da2f6db63 100644 --- a/web-frontend/src/pages/CreateAccount/StepOne.tsx +++ b/web-frontend/src/pages/CreateAccount/StepOne.tsx @@ -39,7 +39,7 @@ export default function StepOne() { } if (!isNicknameValid(nickname)) { - setError({ nickname: Intl.t('errors.nickname-invalid-format') }); + setError({ nickname: Intl.t('errors.account-invalid-format') }); return false; }