Skip to content

Commit

Permalink
fix wails currency, account name i18n and currency field (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
mazmassa authored Jun 15, 2023
1 parent 9498bdc commit 2d81a48
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions wails-frontend/src/pages/ImportPrivateKey/PromptNickname.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const t = (key: string): string => {
const errors: Record<string, string> = {
'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",
};

Expand Down Expand Up @@ -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;
}

Expand Down
10 changes: 6 additions & 4 deletions wails-frontend/src/pages/passwordPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion web-frontend/src/pages/CreateAccount/StepOne.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2d81a48

Please sign in to comment.