Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: put ict form errors in the tile footer #479

Merged
merged 5 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ import { TransitionView } from "@swan-io/lake/src/components/TransitionView";
import { animations, colors } from "@swan-io/lake/src/constants/design";
import { useDebounce } from "@swan-io/lake/src/hooks/useDebounce";
import { useUrqlQuery } from "@swan-io/lake/src/hooks/useUrqlQuery";
import { isNotNullishOrEmpty, isNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
import {
isNotNullish,
isNotNullishOrEmpty,
isNullishOrEmpty,
} from "@swan-io/lake/src/utils/nullish";
import { useEffect, useMemo, useRef, useState } from "react";
import { ActivityIndicator, View } from "react-native";
import { hasDefinedKeys, useForm } from "react-ux-form";

import { AsyncData, Result } from "@swan-io/boxed";
import { LakeAlert } from "@swan-io/lake/src/components/LakeAlert";
import { LakeText } from "@swan-io/lake/src/components/LakeText";
import { noop } from "@swan-io/lake/src/utils/function";
import { StyleSheet } from "react-native";
import { P, match } from "ts-pattern";
Expand Down Expand Up @@ -149,14 +154,25 @@ export const TransferInternationalWizardBeneficiary = ({

return (
<View>
<Tile>
{errors?.map((message, i) => (
<View key={`validation-alert-${i}`}>
<LakeAlert variant="error" title={message} />
<Space height={12} />
</View>
))}

<Tile
footer={
isNotNullish(errors) && errors.length ? (
ncomont marked this conversation as resolved.
Show resolved Hide resolved
ncomont marked this conversation as resolved.
Show resolved Hide resolved
<LakeAlert
anchored={true}
variant="error"
title={
errors.length > 1 ? t("transfer.new.internationalTransfer.errors.title") : errors[0]
}
>
{errors.length > 1
? errors?.map((message, i) => (
<LakeText key={`validation-alert-${i}`}>{message}</LakeText>
))
: null}
</LakeAlert>
) : null
}
>
<LakeLabel
label={t("transfer.new.internationalTransfer.beneficiary.name")}
render={id => (
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"transfer.new.internationalTransfer.beneficiary.title": "An wen senden Sie Geld?",
"transfer.new.internationalTransfer.details.form.field.customLabel": "Benutzerdefiniertes Label",
"transfer.new.internationalTransfer.details.title": "Überweisungsdetails",
"transfer.new.internationalTransfer.errors.title": "Es ist ein Fehler aufgetreten",
"transfer.new.internationalTransfer.fee": "Überweisungsgebühr <bold>{fee}</bold>",
"transfer.new.internationalTransfer.route.Aba": "Kontonummer und ACH-Routing-Nummer",
"transfer.new.internationalTransfer.route.Argentina": "Alias CBU (einziger Bankcode)",
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@
"transfer.new.internationalTransfer.amount.title": "Enter details about your transfer",
"transfer.new.internationalTransfer.amount.label": "Beneficiary gets",
"transfer.new.internationalTransfer.amount.description": "Total amount we'll convert <bold>{amount}</bold> (Exchange rate {rate})",
"transfer.new.internationalTransfer.errors.title": "Some error occured",
"transfer.new.internationalTransfer.fee": "Transfer fee <bold>{fee}</bold>",
"transfer.new.internationalTransfer.amount.converted": "You send exactly <colored>{amount}</colored>",
"transfer.new.internationalTransfer.beneficiary.title": "Who are you sending money to?",
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"transfer.new.internationalTransfer.beneficiary.title": "¿A quién le estás enviando dinero?",
"transfer.new.internationalTransfer.details.form.field.customLabel": "Etiqueta personalizada",
"transfer.new.internationalTransfer.details.title": "Detalles de la transferencia",
"transfer.new.internationalTransfer.errors.title": "Ha ocurrido un error",
"transfer.new.internationalTransfer.fee": "Comisión de transferencia <bold>{fee}</bold>",
"transfer.new.internationalTransfer.route.Aba": "Número de cuenta y número de ruta ACH",
"transfer.new.internationalTransfer.route.Argentina": "Alias CBU (código bancario único)",
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"transfer.new.internationalTransfer.beneficiary.title": "À qui envoyez-vous de l'argent ?",
"transfer.new.internationalTransfer.details.form.field.customLabel": "Libellé personnalisé",
"transfer.new.internationalTransfer.details.title": "Détails du virement",
"transfer.new.internationalTransfer.errors.title": "Une erreur s'est produite",
"transfer.new.internationalTransfer.fee": "Frais de transfert <bold>{fee}</bold>",
"transfer.new.internationalTransfer.route.Aba": "Numéro de compte et numéro de routage ACH",
"transfer.new.internationalTransfer.route.Argentina": "Alias CBU (code bancaire unique)",
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"transfer.new.internationalTransfer.beneficiary.title": "A chi stai inviando denaro?",
"transfer.new.internationalTransfer.details.form.field.customLabel": "Etichetta personalizzata",
"transfer.new.internationalTransfer.details.title": "Dettagli bonifico",
"transfer.new.internationalTransfer.errors.title": "Si è verificato un errore",
"transfer.new.internationalTransfer.fee": "Commissione di trasferimento <bold>{fee}</bold>",
"transfer.new.internationalTransfer.route.Aba": "Numero di conto e numero di routing ACH",
"transfer.new.internationalTransfer.route.Argentina": "Alias CBU (codice bancario unico)",
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"transfer.new.internationalTransfer.beneficiary.title": "Naar wie stuur je geld?",
"transfer.new.internationalTransfer.details.form.field.customLabel": "Aangepast label",
"transfer.new.internationalTransfer.details.title": "Overschrijvingsgegevens",
"transfer.new.internationalTransfer.errors.title": "Er is een fout opgetreden",
"transfer.new.internationalTransfer.fee": "Overboekingskosten: <bold>{fee}</bold>",
"transfer.new.internationalTransfer.route.Aba": "Rekeningnummer en ACH-routingnummer",
"transfer.new.internationalTransfer.route.Argentina": "Alias CBU (enkel bankcode)",
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"transfer.new.internationalTransfer.beneficiary.title": "Para quem você está enviando dinheiro?",
"transfer.new.internationalTransfer.details.form.field.customLabel": "Rótulo personalizado",
"transfer.new.internationalTransfer.details.title": "Detalhes da transferência",
"transfer.new.internationalTransfer.errors.title": "Ocorreu algum erro",
"transfer.new.internationalTransfer.fee": "Taxa de transferência <bold>{fee}</bold>",
"transfer.new.internationalTransfer.route.Aba": "Número da conta e número de roteamento ACH",
"transfer.new.internationalTransfer.route.Argentina": "Alias CBU (código bancário único)",
Expand Down
Loading