Skip to content

Commit

Permalink
#483 - setup sample settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Nov 2, 2023
1 parent 62da78d commit 011b0a9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion apps/connect/src/routes/token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...',
Expand All @@ -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 <ConnectLoader config={config} />;
}

0 comments on commit 011b0a9

Please sign in to comment.