From 011b0a9fa856e4a43ce62113a3c33d6763580de3 Mon Sep 17 00:00:00 2001 From: Sebastian Scatularo Date: Thu, 2 Nov 2023 09:18:52 -0300 Subject: [PATCH] #483 - setup sample settings --- apps/connect/src/routes/token.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/connect/src/routes/token.tsx b/apps/connect/src/routes/token.tsx index 71b26e695..b773d5963 100644 --- a/apps/connect/src/routes/token.tsx +++ b/apps/connect/src/routes/token.tsx @@ -3,12 +3,13 @@ import ConnectLoader from "../components/ConnectLoader"; import customTheme from "../theme/connect"; import mui from '../theme/portal'; -const config: WormholeConnectConfig = { +const defaultConfig: WormholeConnectConfig = { mode: mui.palette.mode, customTheme, env: import.meta.env.VITE_APP_CLUSTER || "mainnet", pageHeader: "Token Bridge", pageSubHeader: "Portal is a bridge that offers unlimited transfers across chains for tokens and NFTs wrapped by Wormhole. Unlike many other bridges, you avoid double wrapping and never have to retrace your steps.", + showHamburgerMenu: false, moreTokens: { href: `${import.meta.env.VITE_APP_ADVANCE_PATH}/#/transfer?sourceChain={:sourceChain}&targetChain={:targetChain}`, label: 'More tokens ...', @@ -35,5 +36,16 @@ const config: WormholeConnectConfig = { }; export default function TokenBridge() { + // TODO improve parsing and coalesce ChainName/ChainId + const query = new URLSearchParams(window.location.search); + const txHash = query.get("txHash"); + const sourceChain = query.get("sourceChain"); + const config = { + ...defaultConfig, + searchTx: { + txHash, + chainName: sourceChain, + }, + } return ; }