-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use-explorer-link got separated into bitcoin and stacks functio…
…n variant
- Loading branch information
1 parent
4b158d2
commit 89bd3c5
Showing
17 changed files
with
101 additions
and
77 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,25 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import { makeBitcoinTxExplorerLink } from '@app/common/utils'; | ||
import { useCurrentNetworkState } from '@app/store/networks/networks.hooks'; | ||
|
||
import { openInNewTab } from '../utils/open-in-new-tab'; | ||
|
||
interface HandleOpenBitcoinTxLinkArgs { | ||
txid: string; | ||
} | ||
|
||
export function useBitcoinExplorerLink() { | ||
const { chain } = useCurrentNetworkState(); | ||
const { bitcoin } = chain; | ||
const handleOpenBitcoinTxLink = useCallback( | ||
({ txid }: HandleOpenBitcoinTxLinkArgs) => { | ||
openInNewTab(makeBitcoinTxExplorerLink({ txid, bitcoin })); | ||
}, | ||
[bitcoin] | ||
); | ||
|
||
return { | ||
handleOpenBitcoinTxLink, | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import { makeStacksTxExplorerLink } from '@app/common/utils'; | ||
import { useCurrentNetworkState } from '@app/store/networks/networks.hooks'; | ||
|
||
import { openInNewTab } from '../utils/open-in-new-tab'; | ||
|
||
export interface HandleOpenStacksTxLinkArgs { | ||
suffix?: string; | ||
txid: string; | ||
} | ||
export function useStacksExplorerLink() { | ||
const { mode } = useCurrentNetworkState(); | ||
|
||
const handleOpenStacksTxLink = useCallback( | ||
({ suffix, txid }: HandleOpenStacksTxLinkArgs) => { | ||
openInNewTab(makeStacksTxExplorerLink({ mode, suffix, txid })); | ||
}, | ||
[mode] | ||
); | ||
|
||
return { | ||
handleOpenStacksTxLink, | ||
}; | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.