fix: remove /increase route (#7603)

* fix: remove /increase route

* fix: rename confusing components
This commit is contained in:
eddie 2023-11-16 13:36:57 -08:00 committed by GitHub
parent 90497dc08a
commit 0f4ca592f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 11 additions and 35 deletions

@ -72,12 +72,6 @@
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</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>
<loc>https://app.uniswap.org/migrate/v2</loc>
<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')))
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(
toSwap
? `/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('/pool') ||
pathname.startsWith('/add') ||
pathname.startsWith('/remove') ||
pathname.startsWith('/increase')
pathname.startsWith('/remove')
)
}

@ -4,7 +4,7 @@ import { Navigate, useParams } from 'react-router-dom'
import { WRAPPED_NATIVE_CURRENCY } from '../../constants/tokens'
import AddLiquidity from './index'
export default function RedirectDuplicateTokenIds() {
export default function AddLiquidityWithTokenRedirects() {
const { currencyIdA, currencyIdB } = useParams<{ currencyIdA: string; currencyIdB: string; feeAmount?: string }>()
const { chainId } = useWeb3React()

@ -2,7 +2,7 @@ import { Navigate, useParams } from 'react-router-dom'
import AddLiquidityV2 from './index'
export default function RedirectDuplicateTokenIdsV2() {
export default function AddLiquidityV2WithTokenRedirects() {
const { currencyIdA, currencyIdB } = useParams<{ currencyIdA: string; currencyIdB: string }>()
if (currencyIdA && currencyIdB && currencyIdA.toLowerCase() === currencyIdB.toLowerCase()) {

@ -706,7 +706,7 @@ function PositionPageContent() {
{currency0 && currency1 && feeAmount && tokenId ? (
<ButtonGray
as={Link}
to={`/increase/${currencyId(currency0)}/${currencyId(currency1)}/${feeAmount}/${tokenId}`}
to={`/add/${currencyId(currency0)}/${currencyId(currency1)}/${feeAmount}/${tokenId}`}
padding="6px 8px"
width="fit-content"
$borderRadius="12px"

@ -15,10 +15,9 @@ const NftExplore = lazy(() => import('nft/pages/explore'))
const Collection = lazy(() => import('nft/pages/collection'))
const Profile = lazy(() => import('nft/pages/profile'))
const Asset = lazy(() => import('nft/pages/asset/Asset'))
const AddLiquidity = lazy(() => import('pages/AddLiquidity'))
const Explore = lazy(() => import('pages/Explore'))
const RedirectDuplicateTokenIds = lazy(() => import('pages/AddLiquidity/redirects'))
const RedirectDuplicateTokenIdsV2 = lazy(() => import('pages/AddLiquidityV2/redirects'))
const AddLiquidityWithTokenRedirects = lazy(() => import('pages/AddLiquidity/redirects'))
const AddLiquidityV2WithTokenRedirects = lazy(() => import('pages/AddLiquidityV2/redirects'))
const RedirectExplore = lazy(() => import('pages/Explore/redirects'))
const MigrateV2 = lazy(() => import('pages/MigrateV2'))
const MigrateV2Pair = lazy(() => import('pages/MigrateV2/MigrateV2Pair'))
@ -174,23 +173,17 @@ export const routes: RouteDefinition[] = [
createRouteDefinition({
path: '/add/v2',
nestedPaths: [':currencyIdA', ':currencyIdA/:currencyIdB'],
getElement: () => <RedirectDuplicateTokenIdsV2 />,
getElement: () => <AddLiquidityV2WithTokenRedirects />,
}),
createRouteDefinition({
path: '/add',
nestedPaths: [':currencyIdA', ':currencyIdA/:currencyIdB', ':currencyIdA/:currencyIdB/:feeAmount'],
getElement: () => <RedirectDuplicateTokenIds />,
}),
createRouteDefinition({
path: '/increase',
nestedPaths: [
':currencyIdA',
':currencyIdA/:currencyIdB',
':currencyIdA/:currencyIdB/:feeAmount',
':currencyIdA/:currencyIdB/:feeAmount/:tokenId',
],
getElement: () => <AddLiquidity />,
getElement: () => <AddLiquidityWithTokenRedirects />,
}),
createRouteDefinition({ path: '/remove/v2/:currencyIdA/:currencyIdB', getElement: () => <RemoveLiquidity /> }),
createRouteDefinition({ path: '/remove/:tokenId', getElement: () => <RemoveLiquidityV3 /> }),

@ -136,16 +136,6 @@ Array [
],
"path": "/add/v2",
},
Object {
"enabled": [Function],
"getElement": [Function],
"nestedPaths": Array [
":currencyIdA",
":currencyIdA/:currencyIdB",
":currencyIdA/:currencyIdB/:feeAmount",
],
"path": "/add",
},
Object {
"enabled": [Function],
"getElement": [Function],
@ -155,7 +145,7 @@ Array [
":currencyIdA/:currencyIdB/:feeAmount",
":currencyIdA/:currencyIdB/:feeAmount/:tokenId",
],
"path": "/increase",
"path": "/add",
},
Object {
"enabled": [Function],