forked from Uniswap/widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add chainId (network) as url parameter (#3057)
* read from query param and change networks if necessary * dont open network selector menu on url param change * prompt network change when url changes * keep url, network in sync * use chain name instead of id in url param * only prompt network switch if url chain doesnt match
- Loading branch information
1 parent
bbdb5f3
commit 3153db9
Showing
3 changed files
with
92 additions
and
11 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
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,5 @@ | ||
export const replaceURLParam = (search: string, param: string, newValue: string) => { | ||
const searchParams = new URLSearchParams(search) | ||
searchParams.set(param, newValue) | ||
return searchParams.toString() | ||
} |