From bf7847809c2159be8841ef41bd7cba89718d21b6 Mon Sep 17 00:00:00 2001 From: viet-nv Date: Mon, 24 Jun 2024 14:36:09 +0700 Subject: [PATCH] Elastic UI --- src/components/ClassicElasticTab.tsx | 21 +-------------------- src/pages/App.tsx | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/components/ClassicElasticTab.tsx b/src/components/ClassicElasticTab.tsx index 3f0546fe29..247ac19301 100644 --- a/src/components/ClassicElasticTab.tsx +++ b/src/components/ClassicElasticTab.tsx @@ -3,12 +3,11 @@ import { Trans } from '@lingui/macro' import { rgba } from 'polished' import { useEffect } from 'react' import { isMobile } from 'react-device-detect' -import { useLocation, useNavigate, useSearchParams } from 'react-router-dom' +import { useLocation, useSearchParams } from 'react-router-dom' import { useMedia } from 'react-use' import { Flex, Text } from 'rebass' import { ReactComponent as DropdownSVG } from 'assets/svg/down.svg' -import ElasticHackedModal from 'components/ElasticHackedModal' import { APP_PATHS } from 'constants/index' import { CLASSIC_NOT_SUPPORTED, ELASTIC_NOT_SUPPORTED } from 'constants/networks' import { VERSION } from 'constants/v2' @@ -23,12 +22,10 @@ import { PoolClassicIcon, PoolElasticIcon } from './Icons' import { MouseoverTooltip } from './Tooltip' function ClassicElasticTab() { - const navigate = useNavigate() const theme = useTheme() const location = useLocation() const [searchParams, setSearchParams] = useSearchParams() const isFarmPage = location.pathname.startsWith(APP_PATHS.FARMS) - const isMyPoolPage = location.pathname.startsWith(APP_PATHS.MY_POOLS) const { positions, farmPositions } = useElasticLegacy(false) const { claimInfo } = useElasticCompensationData(false) @@ -43,8 +40,6 @@ function ClassicElasticTab() { const notSupportedElasticMsg = ELASTIC_NOT_SUPPORTED()[chainId] const notSupportedClassicMsg = CLASSIC_NOT_SUPPORTED()[chainId] - const isOpenElasticHacked = !isMyPoolPage && tab === VERSION.ELASTIC - const upToMedium = useMedia(`(max-width: ${MEDIA_WIDTHS.upToMedium}px)`) const dontShowLegacy = [ @@ -272,20 +267,6 @@ function ClassicElasticTab() { - - { - if (notSupportedClassicMsg) { - navigate({ pathname: APP_PATHS.MY_POOLS }) - } else { - handleSwitchTab(VERSION.CLASSIC) - } - }} - onConfirm={() => { - navigate({ pathname: APP_PATHS.MY_POOLS }) - }} - /> ) } diff --git a/src/pages/App.tsx b/src/pages/App.tsx index 51d2c8ffe5..3468cefa7e 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -43,11 +43,17 @@ const SwapV3 = lazy(() => import('./SwapV3')) const PartnerSwap = lazy(() => import('./PartnerSwap')) // const Bridge = lazy(() => import('./Bridge')) const MyPool = lazy(() => import('./MyPool')) +const Pools = lazy(() => import('./Pools')) const Farm = lazy(() => import('./Farm')) const PoolFinder = lazy(() => import('./PoolFinder')) const ElasticRemoveLiquidity = lazy(() => import('pages/RemoveLiquidityProAmm')) +// const RedirectCreatePool = lazy(() => import('pages/CreatePool/RedirectCreatePool')) + +const RedirectElasticCreatePool = lazy(() => import('pages/AddLiquidityV2/RedirectElasticCreatePool')) + +const ElasticIncreaseLiquidity = lazy(() => import('pages/IncreaseLiquidity')) const RemoveLiquidity = lazy(() => import('pages/RemoveLiquidity')) @@ -160,7 +166,6 @@ const RoutesWithNetworkPrefix = () => { {!ELASTIC_NOT_SUPPORTED()[chainId] && ( <> - {/* } @@ -169,7 +174,6 @@ const RoutesWithNetworkPrefix = () => { path={`${APP_PATHS.ELASTIC_INCREASE_LIQ}/:currencyIdA?/:currencyIdB?/:feeAmount?/:tokenId?`} element={} /> - */} } /> )} @@ -257,6 +261,11 @@ export default function App() { )} } /> + <> + {/* Pools Routes */} + } /> + } /> + <> {/* Farms Routes */} } /> @@ -271,10 +280,8 @@ export default function App() { <> {/* These are old routes and will soon be deprecated - Check: RoutesWithNetworkParam */} - {/* - } /> - } /> - */} + } /> + } /> } />