diff options
author | Sebastian <sebasjm@gmail.com> | 2024-02-05 14:58:05 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-02-05 14:58:05 -0300 |
commit | 58d45fc8aef174027b2855a3cd24b0eb73d6de2e (patch) | |
tree | 5d532a466685ffd450baa07c15df1a1875391f0c /packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx | |
parent | 285d287640c3e4b376978e12e70f46d03742855c (diff) | |
download | wallet-core-58d45fc8aef174027b2855a3cd24b0eb73d6de2e.tar.xz |
some fixes from the last QC meeting
Diffstat (limited to 'packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx index 2259929e7..ffcf9eb8b 100644 --- a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx +++ b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx @@ -87,19 +87,19 @@ export function PaytoWireTransferForm({ const errorsWire = undefinedIfEmpty({ iban: !iban - ? i18n.str`required` + ? i18n.str`Required` : !IBAN_REGEX.test(iban) ? i18n.str`IBAN should have just uppercased letters and numbers` : validateIBAN(iban, i18n), - subject: !subject ? i18n.str`required` : undefined, + subject: !subject ? i18n.str`Required` : undefined, amount: !trimmedAmountStr - ? i18n.str`required` + ? i18n.str`Required` : !parsedAmount - ? i18n.str`not valid` + ? i18n.str`Not valid` : Amounts.isZero(parsedAmount) - ? i18n.str`should be greater than 0` + ? i18n.str`Should be greater than 0` : Amounts.cmp(limit, parsedAmount) === -1 - ? i18n.str`balance is not enough` + ? i18n.str`Balance is not enough` : undefined, }); @@ -107,17 +107,17 @@ export function PaytoWireTransferForm({ const errorsPayto = undefinedIfEmpty({ rawPaytoInput: !rawPaytoInput - ? i18n.str`required` + ? i18n.str`Required` : !parsed - ? i18n.str`does not follow the pattern` + ? i18n.str`Does not follow the pattern` : !parsed.isKnown || parsed.targetType !== "iban" - ? i18n.str`only "IBAN" target are supported` + ? i18n.str`Only "IBAN" target are supported` : !parsed.params.amount - ? i18n.str`use the "amount" parameter to specify the amount to be transferred` + ? i18n.str`Use the "amount" parameter to specify the amount to be transferred` : Amounts.parse(parsed.params.amount) === undefined - ? i18n.str`the amount is not valid` + ? i18n.str`The amount is not valid` : !parsed.params.message - ? i18n.str`use the "message" parameter to specify a reference text for the transfer` + ? i18n.str`Use the "message" parameter to specify a reference text for the transfer` : !IBAN_REGEX.test(parsed.iban) ? i18n.str`IBAN should have just uppercased letters and numbers` : validateIBAN(parsed.iban, i18n), @@ -356,9 +356,7 @@ export function PaytoWireTransferForm({ /> </div> <p class="mt-2 text-sm text-gray-500"> - <i18n.Translate> - IBAN of the recipient's account - </i18n.Translate> + <i18n.Translate>IBAN of the recipient's account</i18n.Translate> </p> </div> @@ -374,7 +372,7 @@ export function PaytoWireTransferForm({ name="subject" id="subject" autocomplete="off" - placeholder={i18n.str`subject`} + placeholder={i18n.str`Subject`} value={subject ?? ""} required onInput={(e): void => { @@ -387,9 +385,7 @@ export function PaytoWireTransferForm({ /> </div> <p class="mt-2 text-sm text-gray-500"> - <i18n.Translate> - some text to identify the transfer - </i18n.Translate> + <i18n.Translate>Some text to identify the transfer</i18n.Translate> </p> </div> @@ -412,7 +408,7 @@ export function PaytoWireTransferForm({ isDirty={trimmedAmountStr !== undefined} /> <p class="mt-2 text-sm text-gray-500"> - <i18n.Translate>amount to transfer</i18n.Translate> + <i18n.Translate>Amount to transfer</i18n.Translate> </p> </div> </div> @@ -422,7 +418,7 @@ export function PaytoWireTransferForm({ <label for="address" class="block text-sm font-medium leading-6 text-gray-900" - >{i18n.str`payto URI:`}</label> + >{i18n.str`Payto URI:`}</label> <div class="mt-2"> <textarea ref={focus ? doAutoFocus : undefined} @@ -433,7 +429,7 @@ export function PaytoWireTransferForm({ class="block overflow-hidden w-44 sm:w-96 rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" value={rawPaytoInput ?? ""} required - title={i18n.str`uniform resource identifier of the target account`} + title={i18n.str`Uniform resource identifier of the target account`} placeholder={i18n.str`payto://iban/[receiver-iban]?message=[subject]&amount=[${limit.currency}:X.Y]`} onInput={(e): void => { rawPaytoInputSetter(e.currentTarget.value); @@ -538,13 +534,13 @@ export function InputAmount( if ( sep_pos !== -1 && l - sep_pos - 1 > - config.currency_specification.num_fractional_input_digits + config.currency_specification.num_fractional_input_digits ) { e.currentTarget.value = e.currentTarget.value.substring( 0, sep_pos + - config.currency_specification.num_fractional_input_digits + - 1, + config.currency_specification.num_fractional_input_digits + + 1, ); } onChange(e.currentTarget.value); |