Skip to content

Commit

Permalink
fix(wallet): Transaction Details Modal Outside Click
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglashdaniel committed Jan 16, 2025
1 parent 77774b8 commit 74590b5
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
// Hooks
import { useExplorer } from '../../../../common/hooks/explorer'
import { useSwapTransactionParser } from '../../../../common/hooks/use-swap-tx-parser'
import { useOnClickOutside } from '../../../../common/hooks/useOnClickOutside'

// Types
import {
Expand Down Expand Up @@ -177,6 +178,9 @@ export const TransactionDetailsModal = ({ onClose, transaction }: Props) => {
const recipient = getTransactionToAddress(transaction)
const approvalTarget = getTransactionApprovalTargetAddress(transaction)

// Refs
const transactionDetailsModalRef = React.useRef<HTMLDivElement>(null)

// Queries
const { data: defaultFiatCurrency = '' } =
useGetDefaultFiatCurrencyQuery(undefined)
Expand Down Expand Up @@ -246,6 +250,7 @@ export const TransactionDetailsModal = ({ onClose, transaction }: Props) => {
const [speedupTx] = useSpeedupTransactionMutation()
const [retryTx] = useRetryTransactionMutation()
const [cancelTx] = useCancelTransactionMutation()
useOnClickOutside(transactionDetailsModalRef, () => onClose(), true)

// Methods
const onClickRetryTransaction = () => {
Expand Down Expand Up @@ -413,6 +418,7 @@ export const TransactionDetailsModal = ({ onClose, transaction }: Props) => {
onClose={onClose}
title='Transaction Details'
width='630px'
ref={transactionDetailsModalRef}
>
<ContentWrapper
fullWidth={true}
Expand Down

0 comments on commit 74590b5

Please sign in to comment.