diff options
Diffstat (limited to 'packages/bank-ui/src/pages/regional/CreateCashout.tsx')
-rw-r--r-- | packages/bank-ui/src/pages/regional/CreateCashout.tsx | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/packages/bank-ui/src/pages/regional/CreateCashout.tsx b/packages/bank-ui/src/pages/regional/CreateCashout.tsx index 393240dee..8e54bbd4e 100644 --- a/packages/bank-ui/src/pages/regional/CreateCashout.tsx +++ b/packages/bank-ui/src/pages/regional/CreateCashout.tsx @@ -90,7 +90,11 @@ export function CreateCashout({ const creds = credentials.status !== "loggedIn" ? undefined : credentials; const [, updateBankState] = useBankState(); - const { lib: { bank: api }, config, hints } = useBankCoreApiContext(); + const { + lib: { bank: api }, + config, + hints, + } = useBankCoreApiContext(); const [form, setForm] = useState<Partial<FormType>>({ isDebit: true }); const [notification, notify, handleError] = useLocalNotification(); const info = useConversionInfo(); @@ -196,7 +200,8 @@ export function CreateCashout({ * depending on the isDebit flag */ const inputAmount = Amounts.parseOrThrow( - `${form.isDebit ? regional_currency : fiat_currency}:${!form.amount ? "0" : form.amount + `${form.isDebit ? regional_currency : fiat_currency}:${ + !form.amount ? "0" : form.amount }`, ); @@ -237,11 +242,12 @@ export function CreateCashout({ : Amounts.cmp(limit, calc.debit) === -1 ? i18n.str`Balance is not enough` : form.isDebit && - Amounts.cmp(inputAmount, conversionInfo.cashout_min_amount) < 1 - ? i18n.str`Needs to be higher than ${Amounts.stringifyValueWithSpec( - Amounts.parseOrThrow(conversionInfo.cashout_min_amount), - regional_currency_specification, - ).normal + Amounts.cmp(inputAmount, conversionInfo.cashout_min_amount) < 1 + ? i18n.str`Needs to be higher than ${ + Amounts.stringifyValueWithSpec( + Amounts.parseOrThrow(conversionInfo.cashout_min_amount), + regional_currency_specification, + ).normal }` : calculationResult === "amount-is-too-small" ? i18n.str`Amount needs to be higher` @@ -255,8 +261,8 @@ export function CreateCashout({ const request_uid = encodeCrock(getRandomBytes(32)); await handleError(async () => { // new cashout api doesn't require channel - const validChannel = config.supported_tan_channels.length === 0 || - form.channel; + const validChannel = + config.supported_tan_channels.length === 0 || form.channel; if (!creds || !form.subject || !validChannel) return; const request = { @@ -606,9 +612,9 @@ export function CreateCashout({ cashoutDisabled ? undefined : (value) => { - form.amount = value; - updateForm(structuredClone(form)); - } + form.amount = value; + updateForm(structuredClone(form)); + } } /> <ShowInputErrorLabel @@ -649,7 +655,7 @@ export function CreateCashout({ </dd> </div> {Amounts.isZero(sellFee) || - Amounts.isZero(calc.beforeFee) ? undefined : ( + Amounts.isZero(calc.beforeFee) ? undefined : ( <div class="flex items-center justify-between border-t-2 afu pt-4"> <dt class="flex items-center text-sm text-gray-600"> <span> @@ -679,7 +685,6 @@ export function CreateCashout({ </dl> </div> )} - </div> </div> |