diff --git a/dapp/src/components/TransactionModal/ActiveStakingStep/DepositBTCModal.tsx b/dapp/src/components/TransactionModal/ActiveStakingStep/DepositBTCModal.tsx
index 005acea43..e51d8056f 100644
--- a/dapp/src/components/TransactionModal/ActiveStakingStep/DepositBTCModal.tsx
+++ b/dapp/src/components/TransactionModal/ActiveStakingStep/DepositBTCModal.tsx
@@ -1,4 +1,4 @@
-import React, { useCallback } from "react"
+import React, { useCallback, useEffect } from "react"
import {
useActionFlowTokenAmount,
useAppDispatch,
@@ -18,7 +18,7 @@ import Spinner from "#/components/shared/Spinner"
import { TextMd } from "#/components/shared/Typography"
import { CardAlert } from "#/components/shared/alerts"
import { ONE_SEC_IN_MILLISECONDS } from "#/constants"
-import { setStatus } from "#/store/action-flow"
+import { setStatus, setTxHash } from "#/store/action-flow"
const DELAY = ONE_SEC_IN_MILLISECONDS
const TOAST_ID = TOAST_IDS.DEPOSIT_TRANSACTION_ERROR
@@ -64,11 +64,17 @@ export default function DepositBTCModal() {
const onDepositBTCError = useCallback(() => showError(), [showError])
- const { sendBitcoinTransaction } = useDepositBTCTransaction(
+ const { sendBitcoinTransaction, transactionHash } = useDepositBTCTransaction(
onDepositBTCSuccess,
onDepositBTCError,
)
+ useEffect(() => {
+ if (transactionHash) {
+ dispatch(setTxHash(transactionHash))
+ }
+ }, [dispatch, transactionHash])
+
const handledDepositBTC = useCallback(async () => {
if (!tokenAmount?.amount || !btcAddress || !depositReceipt || !ethAccount)
return
diff --git a/dapp/src/components/TransactionModal/ModalContentWrapper.tsx b/dapp/src/components/TransactionModal/ModalContentWrapper.tsx
index cfe99aea7..c9e78a3a5 100644
--- a/dapp/src/components/TransactionModal/ModalContentWrapper.tsx
+++ b/dapp/src/components/TransactionModal/ModalContentWrapper.tsx
@@ -2,6 +2,7 @@ import React from "react"
import {
useActionFlowStatus,
useActionFlowTokenAmount,
+ useActionFlowTxHash,
useActionFlowType,
useRequestBitcoinAccount,
useRequestEthereumAccount,
@@ -27,6 +28,7 @@ export default function ModalContentWrapper({
const status = useActionFlowStatus()
const type = useActionFlowType()
const tokenAmount = useActionFlowTokenAmount()
+ const txHash = useActionFlowTxHash()
if (!btcAccount || !isSupportedBTCAddressType(btcAccount.address))
return (
@@ -50,8 +52,10 @@ export default function ModalContentWrapper({
if (status === PROCESS_STATUSES.LOADING) return
- if (status === PROCESS_STATUSES.SUCCEEDED)
- return
+ if (status === PROCESS_STATUSES.SUCCEEDED && txHash)
+ return (
+
+ )
if (status === PROCESS_STATUSES.FAILED) return
diff --git a/dapp/src/components/TransactionModal/SuccessModal.tsx b/dapp/src/components/TransactionModal/SuccessModal.tsx
index 0a2d84b6d..6a666a575 100644
--- a/dapp/src/components/TransactionModal/SuccessModal.tsx
+++ b/dapp/src/components/TransactionModal/SuccessModal.tsx
@@ -2,6 +2,7 @@ import React from "react"
import {
Button,
HStack,
+ Icon,
ModalBody,
ModalFooter,
ModalHeader,
@@ -11,6 +12,9 @@ import { LoadingSpinnerSuccessIcon } from "#/assets/icons"
import { useModal } from "#/hooks"
import { CurrencyBalanceWithConversion } from "#/components/shared/CurrencyBalanceWithConversion"
import { ACTION_FLOW_TYPES, ActionFlowType, TokenAmount } from "#/types"
+import { useNavigate } from "react-router-dom"
+import { routerPath } from "#/router/path"
+import { IconArrowUpRight } from "@tabler/icons-react"
import { TextMd } from "../shared/Typography"
import Spinner from "../shared/Spinner"
import BlockExplorerLink from "../shared/BlockExplorerLink"
@@ -19,13 +23,13 @@ const CONTENT: Record<
ActionFlowType,
{
header: string
- renderBody: (tokenAmount: TokenAmount) => React.ReactNode
+ renderBody: (tokenAmount: TokenAmount, txHash: string) => React.ReactNode
footer: string
}
> = {
[ACTION_FLOW_TYPES.STAKE]: {
header: "Deposit received",
- renderBody: (tokenAmount) => (
+ renderBody: (tokenAmount, txHash) => (
<>
- {/* TODO: Use correct tx hash and update styles */}
-
+ {/* TODO: Update styles */}
+
+
+ View on Mempool
+
+
+
>
),
footer: "The staking will continue in the background",
@@ -63,10 +77,16 @@ const CONTENT: Record<
type SuccessModalProps = {
type: ActionFlowType
tokenAmount: TokenAmount
+ txHash: string
}
-export default function SuccessModal({ type, tokenAmount }: SuccessModalProps) {
+export default function SuccessModal({
+ type,
+ tokenAmount,
+ txHash,
+}: SuccessModalProps) {
const { closeModal } = useModal()
+ const navigate = useNavigate()
const { header, footer, renderBody } = CONTENT[type]
@@ -76,11 +96,19 @@ export default function SuccessModal({ type, tokenAmount }: SuccessModalProps) {
- {renderBody(tokenAmount)}
+ {renderBody(tokenAmount, txHash)}
-