Skip to content

Commit

Permalink
chore(default-page): change default page to /markets (dydxprotocol#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredvu authored and DavideSegullo committed Jun 26, 2024
1 parent b17ea87 commit 66c804d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Navigate, Route, Routes, useLocation } from 'react-router-dom';
import styled, { css } from 'styled-components';
import { WagmiConfig } from 'wagmi';

import { AppRoute, DEFAULT_TRADE_ROUTE, MarketsRoute } from '@/constants/routes';
import { AppRoute, MarketsRoute } from '@/constants/routes';

import { AccountsProvider } from '@/hooks/useAccounts';
import { AppThemeAndColorModeProvider } from '@/hooks/useAppThemeAndColorMode';
Expand Down Expand Up @@ -107,7 +107,7 @@ const Content = () => {

<Route
path={`/${chainTokenLabel}/*`}
element={showChainTokenPage ? <TokenPage /> : <Navigate to={DEFAULT_TRADE_ROUTE} />}
element={showChainTokenPage ? <TokenPage /> : <Navigate to={AppRoute.Markets} />}
/>

{isTablet && (
Expand All @@ -126,7 +126,7 @@ const Content = () => {
<Route path={AppRoute.Privacy} element={<PrivacyPolicyPage />} />
<Route
path="*"
element={<Navigate to={pathFromHash || DEFAULT_TRADE_ROUTE} replace />}
element={<Navigate to={pathFromHash || AppRoute.Markets} replace />}
/>
</Routes>
</Suspense>
Expand Down
3 changes: 0 additions & 3 deletions src/constants/routes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { DEFAULT_MARKETID } from './markets';

export enum AppRoute {
Markets = '/markets',
Portfolio = '/portfolio',
Expand Down Expand Up @@ -45,5 +43,4 @@ export enum MobileSettingsRoute {

export const BASE_ROUTE = import.meta.env.VITE_ROUTER_TYPE === 'hash' ? '/#' : '';
export const TRADE_ROUTE = `${AppRoute.Trade}/:market`;
export const DEFAULT_TRADE_ROUTE = `${AppRoute.Trade}/${DEFAULT_MARKETID}`;
export const DEFAULT_DOCUMENT_TITLE = 'dYdX';

0 comments on commit 66c804d

Please sign in to comment.