chore: remove /swap/:outputCurrency redirect (#5442)
This commit is contained in:
parent
ce9f4525a3
commit
416212be3b
@ -40,7 +40,7 @@ import PoolFinder from './PoolFinder'
|
||||
import RemoveLiquidity from './RemoveLiquidity'
|
||||
import RemoveLiquidityV3 from './RemoveLiquidity/V3'
|
||||
import Swap from './Swap'
|
||||
import { OpenClaimAddressModalAndRedirectToSwap, RedirectPathToSwapOnly, RedirectToSwap } from './Swap/redirects'
|
||||
import { OpenClaimAddressModalAndRedirectToSwap, RedirectPathToSwapOnly } from './Swap/redirects'
|
||||
import Tokens from './Tokens'
|
||||
|
||||
const TokenDetails = lazy(() => import('./TokenDetails'))
|
||||
@ -214,7 +214,6 @@ export default function App() {
|
||||
<Route path="uni/:currencyIdA/:currencyIdB" element={<Manage />} />
|
||||
|
||||
<Route path="send" element={<RedirectPathToSwapOnly />} />
|
||||
<Route path="swap/:outputCurrency" element={<RedirectToSwap />} />
|
||||
<Route path="swap" element={<Swap />} />
|
||||
|
||||
<Route path="pool/v2/find" element={<PoolFinder />} />
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react'
|
||||
import { Navigate, useLocation, useParams } from 'react-router-dom'
|
||||
import { Navigate, useLocation } from 'react-router-dom'
|
||||
import { useAppDispatch } from 'state/hooks'
|
||||
|
||||
import { ApplicationModal, setOpenModal } from '../../state/application/reducer'
|
||||
@ -10,27 +10,6 @@ export function RedirectPathToSwapOnly() {
|
||||
return <Navigate to={{ ...location, pathname: '/swap' }} replace />
|
||||
}
|
||||
|
||||
// Redirects from the /swap/:outputCurrency path to the /swap?outputCurrency=:outputCurrency format
|
||||
export function RedirectToSwap() {
|
||||
const location = useLocation()
|
||||
const { search } = location
|
||||
const { outputCurrency } = useParams<{ outputCurrency: string }>()
|
||||
|
||||
return (
|
||||
<Navigate
|
||||
to={{
|
||||
...location,
|
||||
pathname: '/swap',
|
||||
search:
|
||||
search && search.length > 1
|
||||
? `${search}&outputCurrency=${outputCurrency}`
|
||||
: `?outputCurrency=${outputCurrency}`,
|
||||
}}
|
||||
replace
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export function OpenClaimAddressModalAndRedirectToSwap() {
|
||||
const dispatch = useAppDispatch()
|
||||
useEffect(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user