diff --git a/src/components/PaymentConfirmModal.tsx b/src/components/PaymentConfirmModal.tsx index d5202ad4..9ada0716 100644 --- a/src/components/PaymentConfirmModal.tsx +++ b/src/components/PaymentConfirmModal.tsx @@ -24,7 +24,7 @@ const feeRange: (txFee: TxFee, txFeeFactor: number) => [number, number] = (txFee return [minFeeSatsPerVByte, maxFeeSatsPerVByte] } -const useMiningFeeText = ({ tx_fees, tx_fees_factor }: Pick) => { +export const useMiningFeeText = ({ tx_fees, tx_fees_factor }: Pick) => { const { t } = useTranslation() return useMemo(() => { diff --git a/src/components/fb2/CreateFidelityBond.tsx b/src/components/fb2/CreateFidelityBond.tsx index 5c430878..f5cd37e1 100644 --- a/src/components/fb2/CreateFidelityBond.tsx +++ b/src/components/fb2/CreateFidelityBond.tsx @@ -19,6 +19,7 @@ import { jarName } from '../jars/Jar' import { spendUtxosWithDirectSend, errorResolver } from './SpendFidelityBondModal' import Balance from '../Balance' import { useSettings } from '../../context/SettingsContext' +import { useFeeConfigValues } from '../../hooks/Fees' export const LockInfoAlert = ({ lockDate, className }: { lockDate: Api.Lockdate; className?: string }) => { const { t, i18n } = useTranslation() @@ -61,6 +62,8 @@ interface CreateFidelityBondProps { const CreateFidelityBond2 = ({ otherFidelityBondExists, wallet, walletInfo, onDone }: CreateFidelityBondProps) => { const { t } = useTranslation() const reloadCurrentWalletInfo = useReloadCurrentWalletInfo() + const feeConfigValues = useFeeConfigValues()[0] + const [showCreateFidelityBondModal, setShowCreateFidelityBondModal] = useState(false) const [creatingFidelityBond, setCreatingFidelityBond] = useState(false) const [isLoading, setIsLoading] = useState(false) @@ -528,6 +531,7 @@ const CreateFidelityBond2 = ({ otherFidelityBondExists, wallet, walletInfo, onDo jar={selectedJar!} selectedUtxos={selectedUtxos} timelockedAddress={timelockedAddress!} + feeConfigValues={feeConfigValues} /> diff --git a/src/components/fb2/FidelityBondSteps.tsx b/src/components/fb2/FidelityBondSteps.tsx index b28ce49a..7ac66267 100644 --- a/src/components/fb2/FidelityBondSteps.tsx +++ b/src/components/fb2/FidelityBondSteps.tsx @@ -13,6 +13,8 @@ import * as fb from './utils' import styles from './FidelityBondSteps.module.css' import { UtxoListDisplay } from '../Send/ShowUtxos' import Divider from '../Divider' +import { FeeValues } from '../../hooks/Fees' +import { useMiningFeeText } from '../PaymentConfirmModal' type SelectDateProps = { description: string @@ -41,6 +43,7 @@ interface ConfirmationProps { jar: JarIndex selectedUtxos: Utxo[] timelockedAddress: Api.BitcoinAddress + feeConfigValues?: FeeValues } const SelectDate = ({ description, yearsRange, lockdate, disabled, onChange }: SelectDateProps) => { @@ -150,7 +153,7 @@ const SelectUtxos = ({ selectedUtxos, utxos, onUtxoSelected, onUtxoDeselected }: return ( <>
- + {upperUtxos.length > 0 && lowerUtxos.length > 0 && ( )} - {showFrozenUtxos && ( - - )} + {showFrozenUtxos && }
) } -const Confirmation = ({ lockDate, jar, selectedUtxos, timelockedAddress }: ConfirmationProps) => { +const Confirmation = ({ lockDate, jar, selectedUtxos, timelockedAddress, feeConfigValues }: ConfirmationProps) => { useEffect(() => { console.log('lockDate', lockDate) console.log('jar', jar) console.log('selected', selectedUtxos) }, [jar, lockDate, selectedUtxos]) + const miningFeeText = useMiningFeeText({ ...feeConfigValues }) const settings = useSettings() const { t, i18n } = useTranslation() @@ -229,6 +231,14 @@ const Confirmation = ({ lockDate, jar, selectedUtxos, timelockedAddress }: Confi ))} + {miningFeeText && ( +
+
+ {t('send.confirm_send_modal.label_miner_fee')} +
+
{miningFeeText}
+
+ )}