Skip to content

Commit

Permalink
removed useRedesign config (#2586)
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters authored Sep 13, 2024
1 parent 9206b97 commit 58883fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
28 changes: 3 additions & 25 deletions wormhole-connect/src/AppRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useMemo } from 'react';
import React, { useContext, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { makeStyles } from 'tss-react/mui';

Expand All @@ -11,12 +11,9 @@ import { WormholeConnectConfig } from './config/types';
import { setConfig } from './config';
import config from './config';

import Bridge from './views/Bridge/Bridge';
import FAQ from './views/FAQ';
import Redeem from './views/Redeem/Redeem';
import Terms from './views/Terms';
import TxSearch from './views/TxSearch';
import WalletModal from './views/WalletModal';
import { setRoute } from './store/router';
import { clearWallets } from './store/wallet';
import { clearPorticoBridge } from 'store/porticoBridge';
Expand Down Expand Up @@ -69,10 +66,6 @@ function AppRouter(props: Props) {
});
}, []);

const showWalletModal = useSelector(
(state: RootState) => state.router.showWalletModal,
);

const route = useSelector((state: RootState) => state.router.route);
const prevRoute = usePrevious(route);
const { hasExternalSearch } = useExternalSearch();
Expand Down Expand Up @@ -100,25 +93,10 @@ function AppRouter(props: Props) {
}
}, [hasExternalSearch, dispatch]);

const bridge = useMemo(() => {
return props.config?.useRedesign ? <BridgeV2 /> : <Bridge />;
}, [props.config?.useRedesign]);

const redeem = useMemo(() => {
return props.config?.useRedesign ? <RedeemV2 /> : <Redeem />;
}, [props.config?.useRedesign]);

const walletSelector = useMemo(() => {
return props.config?.useRedesign || !showWalletModal ? null : (
<WalletModal type={showWalletModal} />
);
}, [showWalletModal, props.config?.useRedesign]);

return (
<div className={classes.appContent}>
{walletSelector}
{route === 'bridge' && bridge}
{route === 'redeem' && redeem}
{route === 'bridge' && <BridgeV2 />}
{route === 'redeem' && <RedeemV2 />}
{route === 'search' && <TxSearch />}
{route === 'history' && <TxHistory />}
{route === 'terms' && <Terms />}
Expand Down
3 changes: 0 additions & 3 deletions wormhole-connect/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ export function buildConfig(

// Guardian Set
guardianSet: networkData.guardianSet,

// Render Redesign views
useRedesign: customConfig?.useRedesign ?? true,
};
}

Expand Down
6 changes: 0 additions & 6 deletions wormhole-connect/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ export interface WormholeConnectConfig {
// Route settings
ethBridgeMaxAmount?: number;
wstETHBridgeMaxAmount?: number;

// Override to load Redesign
useRedesign?: boolean;
}

// This is the exported config value used throughout the code base
Expand Down Expand Up @@ -211,9 +208,6 @@ export interface InternalConfig<N extends Network> {
wstETHBridgeMaxAmount: number;

guardianSet: GuardianSetData;

// Redesign flag
useRedesign?: boolean;
}

export type ExplorerConfig = {
Expand Down

0 comments on commit 58883fe

Please sign in to comment.