diff --git a/src/components/RefundButton.tsx b/src/components/RefundButton.tsx index 996455f0..173933d1 100644 --- a/src/components/RefundButton.tsx +++ b/src/components/RefundButton.tsx @@ -109,7 +109,7 @@ export const RefundEvm = (props: { ); }; -const RefundButton = (props: { +export const RefundBtc = (props: { swap: Accessor; setRefundTxId?: Setter; buttonOverride?: string; @@ -123,6 +123,7 @@ const RefundButton = (props: { t, } = useGlobalContext(); const { setSwap } = usePayContext(); + const [timeoutEta, setTimeoutEta] = createSignal(null); const [timeoutBlockheight, setTimeoutBlockheight] = createSignal< number | null @@ -234,6 +235,70 @@ const RefundButton = (props: { return transactionToRefund; }); + return ( + + + 0 || timeoutBlockheight() > 0}> + + +

+ {props.swap() + ? t("refund_address_header", { + asset: props.swap()?.assetSend, + }) + : t("refund_address_header_no_asset")} +

+ + setValid( + refundAddressChange(e, props.swap()?.assetSend), + ) + } + type="text" + name="refundAddress" + placeholder={ + props.swap() + ? t("onchain_address", { + asset: props.swap()?.assetSend, + }) + : t("onchain_address_no_asset") + } + /> + +
+ + + + + + +
+ ); +}; + +const RefundButton = (props: { + swap: Accessor; + setRefundTxId?: Setter; + buttonOverride?: string; +}) => { const [preimageHash] = createResource(async () => { return (await decodeInvoice((props.swap() as SubmarineSwap).invoice)) .preimageHash; @@ -295,61 +360,7 @@ const RefundButton = (props: { }> - - - 0 || timeoutBlockheight() > 0}> - - -

- {props.swap() - ? t("refund_address_header", { - asset: props.swap()?.assetSend, - }) - : t("refund_address_header_no_asset")} -

- - setValid( - refundAddressChange(e, props.swap()?.assetSend), - ) - } - type="text" - name="refundAddress" - placeholder={ - props.swap() - ? t("onchain_address", { - asset: props.swap()?.assetSend, - }) - : t("onchain_address_no_asset") - } - /> - -
- - - - - - -
+ ); };