diff --git a/frontend/src/components/TradeBox/Dialogs/ConfirmFiatReceived.tsx b/frontend/src/components/TradeBox/Dialogs/ConfirmFiatReceived.tsx index d44b7745..f6c57851 100644 --- a/frontend/src/components/TradeBox/Dialogs/ConfirmFiatReceived.tsx +++ b/frontend/src/components/TradeBox/Dialogs/ConfirmFiatReceived.tsx @@ -9,7 +9,7 @@ import { Button, } from '@mui/material'; import { Order } from '../../../models'; -import currencyDict from '../../../../static/assets/currencies.json'; +import currencies from '../../../../static/assets/currencies.json'; import { pn } from '../../../utils'; import { LoadingButton } from '@mui/lab'; @@ -29,7 +29,7 @@ export const ConfirmFiatReceivedDialog = ({ onConfirmClick, }: ConfirmFiatReceivedDialogProps): JSX.Element => { const { t } = useTranslation(); - const currencyCode = currencyDict[order.currency.toString()]; + const currencyCode = currencies[order.currency.toString()]; const amount = pn(parseFloat(parseFloat(order.amount).toFixed(order.currency == 1000 ? 8 : 4))); return ( diff --git a/frontend/src/components/TradeBox/LockInvoiceBox.tsx b/frontend/src/components/TradeBox/Prompts/LockInvoice.tsx similarity index 68% rename from frontend/src/components/TradeBox/LockInvoiceBox.tsx rename to frontend/src/components/TradeBox/Prompts/LockInvoice.tsx index a7ff7ac0..aca7d667 100644 --- a/frontend/src/components/TradeBox/LockInvoiceBox.tsx +++ b/frontend/src/components/TradeBox/Prompts/LockInvoice.tsx @@ -1,36 +1,24 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import { - Button, - Grid, - Link, - Typography, - TextField, - Tooltip, - useTheme, - Divider, -} from '@mui/material'; +import { Button, Grid, Link, Typography, TextField, Tooltip, useTheme } from '@mui/material'; import { AccountBalanceWallet, ContentCopy } from '@mui/icons-material'; -import { NewTabIcon } from '../Icons'; +import { NewTabIcon } from '../../Icons'; import QRCode from 'react-qr-code'; -import { Order } from '../../models'; -import { systemClient } from '../../services/System'; -import currencyDict from '../../../static/assets/currencies.json'; -import stepXofY from './stepXofY'; -import { pn } from '../../utils'; +import { Order } from '../../../models'; +import { systemClient } from '../../../services/System'; +import currencies from '../../../../static/assets/currencies.json'; -interface LockInvoiceBoxProps { +interface LockInvoicePromptProps { order: Order; concept: 'bond' | 'escrow'; } -export const LockInvoiceBox = ({ order, concept }: LockInvoiceBoxProps): JSX.Element => { +export const LockInvoicePrompt = ({ order, concept }: LockInvoicePromptProps): JSX.Element => { const { t } = useTranslation(); const theme = useTheme(); - const currencyCode = currencyDict[order.currency.toString()]; + const currencyCode: string = currencies[`${order.currency}`]; const invoice = concept === 'bond' ? order.bond_invoice : order.escrow_invoice; - const amountSats = concept === 'bond' ? order.bond_satoshis : order.escrow_satoshis; const helperText = concept === 'bond' ? t( @@ -41,22 +29,6 @@ export const LockInvoiceBox = ({ order, concept }: LockInvoiceBoxProps): JSX.Ele { currencyCode }, ); - const Title = function () { - let text = `Lock {{amountSats}} Sats to ${order.is_maker ? 'PUBLISH' : 'TAKE'} order`; - if (concept === 'escrow') { - text = 'Lock {{amountSats}} Sats as collateral'; - } - return ( - - - {t(text, { - amountSats: pn(amountSats), - })} - - {` ${stepXofY(order)}`} - - ); - }; const CompatibleWalletsButton = function () { return (