From 8e9f45681f223d4a08d8d32645b1153f8b6c3747 Mon Sep 17 00:00:00 2001 From: reallybeard <89934888+reallybeard@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:42:17 -0500 Subject: [PATCH] fix: change default route (#5534) --- src/Routes/PrivateRoute.tsx | 2 +- src/Routes/Routes.tsx | 2 +- src/pages/ConnectWallet/ConnectWallet.tsx | 2 +- src/pages/Dashboard/DashboardSidebar.tsx | 5 ----- src/pages/Trade/Trade.tsx | 4 ---- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Routes/PrivateRoute.tsx b/src/Routes/PrivateRoute.tsx index 51e096a6b18..77d7052f525 100644 --- a/src/Routes/PrivateRoute.tsx +++ b/src/Routes/PrivateRoute.tsx @@ -12,7 +12,7 @@ export const PrivateRoute = ({ hasWallet, ...rest }: PrivateRouteProps) => { const to = useMemo( () => ({ pathname: '/connect-wallet', - search: `returnUrl=${location?.pathname ?? '/dashboard'}`, + search: `returnUrl=${location?.pathname ?? '/trade'}`, }), [location], ) diff --git a/src/Routes/Routes.tsx b/src/Routes/Routes.tsx index 0048a84b70c..354eb22ff27 100644 --- a/src/Routes/Routes.tsx +++ b/src/Routes/Routes.tsx @@ -125,7 +125,7 @@ export const Routes = memo(() => { {privateRoutesList} - + diff --git a/src/pages/ConnectWallet/ConnectWallet.tsx b/src/pages/ConnectWallet/ConnectWallet.tsx index e1bec6308f0..332e1ad9334 100644 --- a/src/pages/ConnectWallet/ConnectWallet.tsx +++ b/src/pages/ConnectWallet/ConnectWallet.tsx @@ -105,7 +105,7 @@ export const ConnectWallet = () => { assetId: `${match?.params?.chainId ?? ''}/${match?.params?.assetSubId ?? ''}`, }) : query?.returnUrl - hasWallet && history.push(path ?? '/dashboard') + hasWallet && history.push(path ?? '/trade') }, [history, hasWallet, query, state, dispatch]) const handleMetaMaskConnect = useCallback(() => { diff --git a/src/pages/Dashboard/DashboardSidebar.tsx b/src/pages/Dashboard/DashboardSidebar.tsx index 73d6e5b4b77..f4833dc176e 100644 --- a/src/pages/Dashboard/DashboardSidebar.tsx +++ b/src/pages/Dashboard/DashboardSidebar.tsx @@ -4,11 +4,9 @@ import { memo } from 'react' import OnRamperLogo from 'assets/on-ramper.png' import SaversVaultTop from 'assets/savers-vault-top.png' import { AssetIcon } from 'components/AssetIcon' -import { MultiHopTrade } from 'components/MultiHopTrade/MultiHopTrade' import { PromoCard } from 'components/Promo/PromoCard' import type { PromoItem } from 'components/Promo/types' import { useWallet } from 'hooks/useWallet/useWallet' -import { isMobile } from 'lib/globals' import { EligibleCarousel } from 'pages/Defi/components/EligibleCarousel' import { MissionSidebar } from 'pages/Missions/Missions' @@ -55,8 +53,6 @@ const promoData: PromoItem[] = [ }, ] -const display = { base: 'none', xl: 'block' } - export const DashboardSidebar = memo(() => { const { state: { isConnected, isDemoWallet }, @@ -66,7 +62,6 @@ export const DashboardSidebar = memo(() => { return ( - {!isMobile && } diff --git a/src/pages/Trade/Trade.tsx b/src/pages/Trade/Trade.tsx index a872b1fff10..269c52b770a 100644 --- a/src/pages/Trade/Trade.tsx +++ b/src/pages/Trade/Trade.tsx @@ -4,7 +4,6 @@ import { FeeExplainer } from 'components/FeeExplainer/FeeExplainer' import { Main } from 'components/Layout/Main' import { MultiHopTrade } from 'components/MultiHopTrade/MultiHopTrade' import { useFeatureFlag } from 'hooks/useFeatureFlag/useFeatureFlag' -import { RecentTransactions } from 'pages/Dashboard/RecentTransactions' const maxWidth = { base: '100%', lg: 'container.sm' } const padding = { base: 0, md: 8 } @@ -18,9 +17,6 @@ export const Trade = memo(() => { {foxDiscountsEnabled && } - - - )