summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-03-08 23:48:14 -0300
committerSebastian <sebasjm@gmail.com>2024-03-10 16:53:10 -0300
commit5a193a0575af3358627dba56055ebc98580c18bb (patch)
tree2357821e5de6db9e1e78e61b5f1c0c79ae87b151
parent9a464cf0c7597c36a9ca0b10bc3cdd04190e709d (diff)
downloadwallet-core-5a193a0575af3358627dba56055ebc98580c18bb.tar.gz
wallet-core-5a193a0575af3358627dba56055ebc98580c18bb.tar.bz2
wallet-core-5a193a0575af3358627dba56055ebc98580c18bb.zip
some red start missing
-rw-r--r--packages/bank-ui/src/pages/PaytoWireTransferForm.tsx35
-rw-r--r--packages/bank-ui/src/pages/account/UpdateAccountPassword.tsx3
2 files changed, 33 insertions, 5 deletions
diff --git a/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx
index a522102a7..8d9df1151 100644
--- a/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx
+++ b/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx
@@ -132,6 +132,7 @@ export function PaytoWireTransferForm({
let sendingAmount: AmountString | undefined;
if (credentials.status !== "loggedIn") return;
+ let acName: string | undefined;
if (isRawPayto) {
const p = parsePaytoUri(rawPaytoInput!);
if (!p) return;
@@ -139,12 +140,19 @@ export function PaytoWireTransferForm({
delete p.params.amount;
// if this payto is valid then it already have message
payto_uri = stringifyPaytoUri(p);
+ acName = !p.isKnown ? undefined :
+ p.targetType === "iban" ? p.iban :
+ p.targetType === "bitcoin" ? p.targetPath :
+ p.targetType === "x-taler-bank" ? p.account :
+ assertUnreachable(p);
} else {
if (!account || !subject) return;
let payto;
+ acName = account;
switch (paytoType) {
case "x-taler-bank": {
payto = buildPayto("x-taler-bank", url.host, account);
+
break;
}
case "iban": {
@@ -187,7 +195,7 @@ export function PaytoWireTransferForm({
case TalerErrorCode.BANK_UNKNOWN_CREDITOR:
return notify({
type: "error",
- title: i18n.str`The destination account "${puri}" was not found.`,
+ title: i18n.str`The destination account "${acName ?? puri}" was not found.`,
description: resp.detail.hint as TranslatedString,
debug: resp.detail,
});
@@ -388,6 +396,7 @@ export function PaytoWireTransferForm({
case "x-taler-bank": {
return <TextField
id="x-taler-bank"
+ required
label={i18n.str`Recipient`}
help={i18n.str`Id of the recipient's account`}
error={errorsWire?.account}
@@ -401,6 +410,7 @@ export function PaytoWireTransferForm({
case "iban": {
return <TextField
id="iban"
+ required
label={i18n.str`Recipient`}
help={i18n.str`IBAN of the recipient's account`}
placeholder={"CC0123456789" as TranslatedString}
@@ -419,7 +429,10 @@ export function PaytoWireTransferForm({
<label
for="subject"
class="block text-sm font-medium leading-6 text-gray-900"
- >{i18n.str`Transfer subject`}</label>
+ >
+ {i18n.str`Transfer subject`}
+ <b style={{ color: "red" }}> *</b>
+ </label>
<div class="mt-2">
<input
type="text"
@@ -450,7 +463,10 @@ export function PaytoWireTransferForm({
<label
for="amount"
class="block text-sm font-medium leading-6 text-gray-900"
- >{i18n.str`Amount`}</label>
+ >
+ {i18n.str`Amount`}
+ <b style={{ color: "red" }}> *</b>
+ </label>
<InputAmount
name="amount"
left
@@ -475,7 +491,10 @@ 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:`}
+ <b style={{ color: "red" }}> *</b>
+ </label>
<div class="mt-2">
<textarea
ref={focus ? doAutoFocus : undefined}
@@ -725,6 +744,7 @@ function validateSubject(text: string, i18n: InternationalizationAPI): Translate
interface PaytoFieldProps {
id: string,
label: TranslatedString;
+ required?: boolean;
help?: TranslatedString;
placeholder?: TranslatedString;
error: string | undefined;
@@ -753,6 +773,7 @@ export function TextField({
onChange,
placeholder,
rightIcons,
+ required,
value,
error,
}: PaytoFieldProps): VNode {
@@ -760,7 +781,11 @@ export function TextField({
<label
for={id}
class="block text-sm font-medium leading-6 text-gray-900"
- >{label}</label>
+ >{label}
+ {required &&
+ <b style={{ color: "red" }}> *</b>
+ }
+ </label>
<div class="mt-2">
<Wrapper withIcon={rightIcons !== undefined}>
<input
diff --git a/packages/bank-ui/src/pages/account/UpdateAccountPassword.tsx b/packages/bank-ui/src/pages/account/UpdateAccountPassword.tsx
index e21ac2464..c33aeb09e 100644
--- a/packages/bank-ui/src/pages/account/UpdateAccountPassword.tsx
+++ b/packages/bank-ui/src/pages/account/UpdateAccountPassword.tsx
@@ -185,6 +185,7 @@ export function UpdateAccountPassword({
for="password"
>
{i18n.str`Current password`}
+ <b style={{ color: "red" }}> *</b>
</label>
<div class="mt-2">
<input
@@ -218,6 +219,7 @@ export function UpdateAccountPassword({
for="password"
>
{i18n.str`New password`}
+ <b style={{ color: "red" }}> *</b>
</label>
<div class="mt-2">
<input
@@ -246,6 +248,7 @@ export function UpdateAccountPassword({
for="repeat"
>
{i18n.str`Type it again`}
+ <b style={{ color: "red" }}> *</b>
</label>
<div class="mt-2">
<input