fix: remove /increase route (#7603)
* fix: remove /increase route * fix: rename confusing components
This commit is contained in:
parent
90497dc08a
commit
0f4ca592f2
@ -72,12 +72,6 @@
|
|||||||
<changefreq>weekly</changefreq>
|
<changefreq>weekly</changefreq>
|
||||||
<priority>0.6</priority>
|
<priority>0.6</priority>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
|
||||||
<loc>https://app.uniswap.org/increase</loc>
|
|
||||||
<lastmod>2023-10-11T19:57:27.976Z</lastmod>
|
|
||||||
<changefreq>weekly</changefreq>
|
|
||||||
<priority>0.6</priority>
|
|
||||||
</url>
|
|
||||||
<url>
|
<url>
|
||||||
<loc>https://app.uniswap.org/migrate/v2</loc>
|
<loc>https://app.uniswap.org/migrate/v2</loc>
|
||||||
<lastmod>2023-10-11T19:57:27.976Z</lastmod>
|
<lastmod>2023-10-11T19:57:27.976Z</lastmod>
|
||||||
|
@ -88,7 +88,7 @@ describe('PoolDetailsStatsButton', () => {
|
|||||||
|
|
||||||
await act(() => userEvent.click(screen.getByTestId('pool-details-add-liquidity-button')))
|
await act(() => userEvent.click(screen.getByTestId('pool-details-add-liquidity-button')))
|
||||||
expect(global.window.location.href).toContain(
|
expect(global.window.location.href).toContain(
|
||||||
'/increase/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/500'
|
'/add/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/500'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -68,7 +68,7 @@ export function PoolDetailsStatsButtons({ chainId, token0, token1, feeTier, load
|
|||||||
navigate(
|
navigate(
|
||||||
toSwap
|
toSwap
|
||||||
? `/swap?inputCurrency=${currencyId(currency0)}&outputCurrency=${currencyId(currency1)}`
|
? `/swap?inputCurrency=${currencyId(currency0)}&outputCurrency=${currencyId(currency1)}`
|
||||||
: `/increase/${currencyId(currency0)}/${currencyId(currency1)}/${feeTier}${tokenId ? `/${tokenId}` : ''}`
|
: `/add/${currencyId(currency0)}/${currencyId(currency1)}/${feeTier}${tokenId ? `/${tokenId}` : ''}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ export function useIsPoolsPage() {
|
|||||||
pathname.startsWith('/pools') ||
|
pathname.startsWith('/pools') ||
|
||||||
pathname.startsWith('/pool') ||
|
pathname.startsWith('/pool') ||
|
||||||
pathname.startsWith('/add') ||
|
pathname.startsWith('/add') ||
|
||||||
pathname.startsWith('/remove') ||
|
pathname.startsWith('/remove')
|
||||||
pathname.startsWith('/increase')
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import { Navigate, useParams } from 'react-router-dom'
|
|||||||
import { WRAPPED_NATIVE_CURRENCY } from '../../constants/tokens'
|
import { WRAPPED_NATIVE_CURRENCY } from '../../constants/tokens'
|
||||||
import AddLiquidity from './index'
|
import AddLiquidity from './index'
|
||||||
|
|
||||||
export default function RedirectDuplicateTokenIds() {
|
export default function AddLiquidityWithTokenRedirects() {
|
||||||
const { currencyIdA, currencyIdB } = useParams<{ currencyIdA: string; currencyIdB: string; feeAmount?: string }>()
|
const { currencyIdA, currencyIdB } = useParams<{ currencyIdA: string; currencyIdB: string; feeAmount?: string }>()
|
||||||
|
|
||||||
const { chainId } = useWeb3React()
|
const { chainId } = useWeb3React()
|
||||||
|
@ -2,7 +2,7 @@ import { Navigate, useParams } from 'react-router-dom'
|
|||||||
|
|
||||||
import AddLiquidityV2 from './index'
|
import AddLiquidityV2 from './index'
|
||||||
|
|
||||||
export default function RedirectDuplicateTokenIdsV2() {
|
export default function AddLiquidityV2WithTokenRedirects() {
|
||||||
const { currencyIdA, currencyIdB } = useParams<{ currencyIdA: string; currencyIdB: string }>()
|
const { currencyIdA, currencyIdB } = useParams<{ currencyIdA: string; currencyIdB: string }>()
|
||||||
|
|
||||||
if (currencyIdA && currencyIdB && currencyIdA.toLowerCase() === currencyIdB.toLowerCase()) {
|
if (currencyIdA && currencyIdB && currencyIdA.toLowerCase() === currencyIdB.toLowerCase()) {
|
||||||
|
@ -706,7 +706,7 @@ function PositionPageContent() {
|
|||||||
{currency0 && currency1 && feeAmount && tokenId ? (
|
{currency0 && currency1 && feeAmount && tokenId ? (
|
||||||
<ButtonGray
|
<ButtonGray
|
||||||
as={Link}
|
as={Link}
|
||||||
to={`/increase/${currencyId(currency0)}/${currencyId(currency1)}/${feeAmount}/${tokenId}`}
|
to={`/add/${currencyId(currency0)}/${currencyId(currency1)}/${feeAmount}/${tokenId}`}
|
||||||
padding="6px 8px"
|
padding="6px 8px"
|
||||||
width="fit-content"
|
width="fit-content"
|
||||||
$borderRadius="12px"
|
$borderRadius="12px"
|
||||||
|
@ -15,10 +15,9 @@ const NftExplore = lazy(() => import('nft/pages/explore'))
|
|||||||
const Collection = lazy(() => import('nft/pages/collection'))
|
const Collection = lazy(() => import('nft/pages/collection'))
|
||||||
const Profile = lazy(() => import('nft/pages/profile'))
|
const Profile = lazy(() => import('nft/pages/profile'))
|
||||||
const Asset = lazy(() => import('nft/pages/asset/Asset'))
|
const Asset = lazy(() => import('nft/pages/asset/Asset'))
|
||||||
const AddLiquidity = lazy(() => import('pages/AddLiquidity'))
|
|
||||||
const Explore = lazy(() => import('pages/Explore'))
|
const Explore = lazy(() => import('pages/Explore'))
|
||||||
const RedirectDuplicateTokenIds = lazy(() => import('pages/AddLiquidity/redirects'))
|
const AddLiquidityWithTokenRedirects = lazy(() => import('pages/AddLiquidity/redirects'))
|
||||||
const RedirectDuplicateTokenIdsV2 = lazy(() => import('pages/AddLiquidityV2/redirects'))
|
const AddLiquidityV2WithTokenRedirects = lazy(() => import('pages/AddLiquidityV2/redirects'))
|
||||||
const RedirectExplore = lazy(() => import('pages/Explore/redirects'))
|
const RedirectExplore = lazy(() => import('pages/Explore/redirects'))
|
||||||
const MigrateV2 = lazy(() => import('pages/MigrateV2'))
|
const MigrateV2 = lazy(() => import('pages/MigrateV2'))
|
||||||
const MigrateV2Pair = lazy(() => import('pages/MigrateV2/MigrateV2Pair'))
|
const MigrateV2Pair = lazy(() => import('pages/MigrateV2/MigrateV2Pair'))
|
||||||
@ -174,23 +173,17 @@ export const routes: RouteDefinition[] = [
|
|||||||
createRouteDefinition({
|
createRouteDefinition({
|
||||||
path: '/add/v2',
|
path: '/add/v2',
|
||||||
nestedPaths: [':currencyIdA', ':currencyIdA/:currencyIdB'],
|
nestedPaths: [':currencyIdA', ':currencyIdA/:currencyIdB'],
|
||||||
getElement: () => <RedirectDuplicateTokenIdsV2 />,
|
getElement: () => <AddLiquidityV2WithTokenRedirects />,
|
||||||
}),
|
}),
|
||||||
createRouteDefinition({
|
createRouteDefinition({
|
||||||
path: '/add',
|
path: '/add',
|
||||||
nestedPaths: [':currencyIdA', ':currencyIdA/:currencyIdB', ':currencyIdA/:currencyIdB/:feeAmount'],
|
|
||||||
getElement: () => <RedirectDuplicateTokenIds />,
|
|
||||||
}),
|
|
||||||
|
|
||||||
createRouteDefinition({
|
|
||||||
path: '/increase',
|
|
||||||
nestedPaths: [
|
nestedPaths: [
|
||||||
':currencyIdA',
|
':currencyIdA',
|
||||||
':currencyIdA/:currencyIdB',
|
':currencyIdA/:currencyIdB',
|
||||||
':currencyIdA/:currencyIdB/:feeAmount',
|
':currencyIdA/:currencyIdB/:feeAmount',
|
||||||
':currencyIdA/:currencyIdB/:feeAmount/:tokenId',
|
':currencyIdA/:currencyIdB/:feeAmount/:tokenId',
|
||||||
],
|
],
|
||||||
getElement: () => <AddLiquidity />,
|
getElement: () => <AddLiquidityWithTokenRedirects />,
|
||||||
}),
|
}),
|
||||||
createRouteDefinition({ path: '/remove/v2/:currencyIdA/:currencyIdB', getElement: () => <RemoveLiquidity /> }),
|
createRouteDefinition({ path: '/remove/v2/:currencyIdA/:currencyIdB', getElement: () => <RemoveLiquidity /> }),
|
||||||
createRouteDefinition({ path: '/remove/:tokenId', getElement: () => <RemoveLiquidityV3 /> }),
|
createRouteDefinition({ path: '/remove/:tokenId', getElement: () => <RemoveLiquidityV3 /> }),
|
||||||
|
@ -136,16 +136,6 @@ Array [
|
|||||||
],
|
],
|
||||||
"path": "/add/v2",
|
"path": "/add/v2",
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"enabled": [Function],
|
|
||||||
"getElement": [Function],
|
|
||||||
"nestedPaths": Array [
|
|
||||||
":currencyIdA",
|
|
||||||
":currencyIdA/:currencyIdB",
|
|
||||||
":currencyIdA/:currencyIdB/:feeAmount",
|
|
||||||
],
|
|
||||||
"path": "/add",
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"enabled": [Function],
|
"enabled": [Function],
|
||||||
"getElement": [Function],
|
"getElement": [Function],
|
||||||
@ -155,7 +145,7 @@ Array [
|
|||||||
":currencyIdA/:currencyIdB/:feeAmount",
|
":currencyIdA/:currencyIdB/:feeAmount",
|
||||||
":currencyIdA/:currencyIdB/:feeAmount/:tokenId",
|
":currencyIdA/:currencyIdB/:feeAmount/:tokenId",
|
||||||
],
|
],
|
||||||
"path": "/increase",
|
"path": "/add",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
"enabled": [Function],
|
"enabled": [Function],
|
||||||
|
Loading…
Reference in New Issue
Block a user