Skip to content

Commit

Permalink
fix: change default route (#5534)
Browse files Browse the repository at this point in the history
  • Loading branch information
reallybeard authored Oct 25, 2023
1 parent 1f97efc commit 8e9f456
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Routes/PrivateRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
)
Expand Down
2 changes: 1 addition & 1 deletion src/Routes/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const Routes = memo(() => {
<Layout>
<Switch>
{privateRoutesList}
<Redirect from='/' to='/dashboard' />
<Redirect from='/' to='/trade' />
<Route>
<NotFound />
</Route>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ConnectWallet/ConnectWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
5 changes: 0 additions & 5 deletions src/pages/Dashboard/DashboardSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -55,8 +53,6 @@ const promoData: PromoItem[] = [
},
]

const display = { base: 'none', xl: 'block' }

export const DashboardSidebar = memo(() => {
const {
state: { isConnected, isDemoWallet },
Expand All @@ -66,7 +62,6 @@ export const DashboardSidebar = memo(() => {
return (
<Flex width='full' flexDir='column' gap={6}>
<PromoCard data={promoData} />
{!isMobile && <MultiHopTrade display={display} />}
<MissionSidebar />
<EligibleCarousel />
<RecentTransactions limit={8} viewMoreLink />
Expand Down
4 changes: 0 additions & 4 deletions src/pages/Trade/Trade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -18,9 +17,6 @@ export const Trade = memo(() => {
<MultiHopTrade />
</Container>
{foxDiscountsEnabled && <FeeExplainer />}
<Stack flexGrow={1}>
<RecentTransactions />
</Stack>
</Stack>
</Main>
)
Expand Down

0 comments on commit 8e9f456

Please sign in to comment.