From 96690c02a5e7f570617351fb665eba2b81b5c175 Mon Sep 17 00:00:00 2001 From: Hung Doan <19758667+hungdoansy@users.noreply.github.com> Date: Fri, 23 Jun 2023 18:13:07 +0700 Subject: [PATCH] refactor: update url when remove add liquidity or swap on analytics page (#351) * chore: fix error overlay * feat: insert network route to pool/swap urls * chore: remove resolution --- package.json | 2 +- src/components/PoolList/ListItem.js | 7 +-- src/components/SideNav/index.js | 4 +- src/utils/index.js | 73 ++++++++++------------------- yarn.lock | 6 +-- 5 files changed, 32 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index d92aab55c..8f98960b1 100644 --- a/package.json +++ b/package.json @@ -97,4 +97,4 @@ "deepmerge": "^4.2.2", "swr": "^1.0.1" } -} \ No newline at end of file +} diff --git a/src/components/PoolList/ListItem.js b/src/components/PoolList/ListItem.js index b755d15ea..9e5ee1683 100644 --- a/src/components/PoolList/ListItem.js +++ b/src/components/PoolList/ListItem.js @@ -9,7 +9,7 @@ import Link, { CustomLink } from '../Link' import { MouseoverTooltip } from '../Tooltip' import CopyHelper from '../Copy' import { TYPE } from '../../Theme' -import { shortenAddress, formattedNum } from '../../utils' +import { shortenAddress, formattedNum, getPoolLink } from '../../utils' import { MAX_ALLOW_APY } from '../../constants' import useTheme from '../../hooks/useTheme' import { useNetworksInfo } from '../../contexts/NetworkInfo' @@ -235,10 +235,7 @@ const ListItem = ({ pool, oddRow }) => { { - + + Add } diff --git a/src/components/SideNav/index.js b/src/components/SideNav/index.js index f89a895a3..e024e8844 100644 --- a/src/components/SideNav/index.js +++ b/src/components/SideNav/index.js @@ -15,7 +15,7 @@ import { ApplicationModal, useModalOpen, useSessionStart } from '../../contexts/ import { useDarkModeManager } from '../../contexts/LocalStorage' import SocialLinks from '../SocialLinks' import ThemeToggle from '../ThemeToggle' -import { addNetworkIdQueryString } from '../../utils' +import { constructSwapURL } from '../../utils' import Wallet from '../Icons/Wallet' import { Flex, Text } from 'rebass' import { useNetworksInfo } from '../../contexts/NetworkInfo' @@ -181,7 +181,7 @@ function SideNav() { - +