-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f36946
commit db13d43
Showing
2 changed files
with
42 additions
and
15 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
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,15 @@ | ||
import { useMemo } from "react"; | ||
|
||
export function useQueryParams() { | ||
const query = new URLSearchParams(window.location.search); | ||
const txHash = useMemo(() => query.get("txHash"), [query]); | ||
const transactionId = useMemo(() => query.get("transactionId"), []); | ||
const sourceChain = useMemo(() => query.get("sourceChain"), []); | ||
const targetChain = useMemo(() => query.get("targetChain"), []); | ||
return { | ||
txHash, | ||
transactionId, | ||
sourceChain, | ||
targetChain | ||
} | ||
}; |