This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Gnosis Safe claiming Workflow (#2277)
* Fix explorer link * Create new tx link component
- Loading branch information
Showing
2 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ExplorerDataType } from 'utils/getExplorerLink' | ||
|
||
import { ExplorerLink } from 'components/ExplorerLink' | ||
import { GnosisSafeLink } from 'components/AccountDetails/Transaction/StatusDetails' | ||
|
||
import { EnhancedTransactionDetails, HashType } from 'state/enhancedTransactions/reducer' | ||
import { useWalletInfo } from 'hooks/useWalletInfo' | ||
|
||
interface Props { | ||
tx: EnhancedTransactionDetails | ||
} | ||
|
||
/** | ||
* Creates a link to the relevant explorer: Etherscan, GP Explorer or Blockscout, or Gnosis Safe web if its a Gnosis Safe Transaction | ||
* @param props | ||
*/ | ||
export function EnhancedTransactionLink(props: Props) { | ||
const { tx } = props | ||
const { chainId, gnosisSafeInfo } = useWalletInfo() | ||
|
||
if (tx.hashType === HashType.GNOSIS_SAFE_TX) { | ||
const safeTx = tx.safeTransaction | ||
|
||
if (!chainId || !safeTx || !gnosisSafeInfo) { | ||
return null | ||
} | ||
|
||
return <GnosisSafeLink chainId={chainId} safeTransaction={safeTx} gnosisSafeThreshold={gnosisSafeInfo.threshold} /> | ||
} else { | ||
return <ExplorerLink id={tx.hash} type={ExplorerDataType.TRANSACTION} /> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters