Commit c42aeae9 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

fix: update `useIsPoolsPage` hook (#6179)

* fix: update `useIsPoolsPage` hook

* rename file
parent 80ab000d
...@@ -3,7 +3,7 @@ import { useWeb3React } from '@web3-react/core' ...@@ -3,7 +3,7 @@ import { useWeb3React } from '@web3-react/core'
import Web3Status from 'components/Web3Status' import Web3Status from 'components/Web3Status'
import { chainIdToBackendName } from 'graphql/data/util' import { chainIdToBackendName } from 'graphql/data/util'
import { useIsNftPage } from 'hooks/useIsNftPage' import { useIsNftPage } from 'hooks/useIsNftPage'
import { useIsPoolPage } from 'hooks/useIsPoolPage' import { useIsPoolsPage } from 'hooks/useIsPoolsPage'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Row } from 'nft/components/Flex' import { Row } from 'nft/components/Flex'
import { UniIcon } from 'nft/components/icons' import { UniIcon } from 'nft/components/icons'
...@@ -53,7 +53,7 @@ export const PageTabs = () => { ...@@ -53,7 +53,7 @@ export const PageTabs = () => {
const { chainId: connectedChainId } = useWeb3React() const { chainId: connectedChainId } = useWeb3React()
const chainName = chainIdToBackendName(connectedChainId) const chainName = chainIdToBackendName(connectedChainId)
const isPoolActive = useIsPoolPage() const isPoolActive = useIsPoolsPage()
const isNftPage = useIsNftPage() const isNftPage = useIsNftPage()
return ( return (
......
...@@ -6,7 +6,7 @@ import TaxServiceBanner from 'components/TaxServiceModal/TaxServiceBanner' ...@@ -6,7 +6,7 @@ import TaxServiceBanner from 'components/TaxServiceModal/TaxServiceBanner'
import { useTaxServiceBannerEnabled } from 'featureFlags/flags/taxServiceBanner' import { useTaxServiceBannerEnabled } from 'featureFlags/flags/taxServiceBanner'
import useAccountRiskCheck from 'hooks/useAccountRiskCheck' import useAccountRiskCheck from 'hooks/useAccountRiskCheck'
import { useIsNftPage } from 'hooks/useIsNftPage' import { useIsNftPage } from 'hooks/useIsNftPage'
import { useIsPoolPage } from 'hooks/useIsPoolPage' import { useIsPoolsPage } from 'hooks/useIsPoolsPage'
import { lazy } from 'react' import { lazy } from 'react'
import { useLocation } from 'react-router-dom' import { useLocation } from 'react-router-dom'
import { useModalIsOpen, useToggleModal } from 'state/application/hooks' import { useModalIsOpen, useToggleModal } from 'state/application/hooks'
...@@ -27,7 +27,7 @@ export default function TopLevelModals() { ...@@ -27,7 +27,7 @@ export default function TopLevelModals() {
const { pathname } = useLocation() const { pathname } = useLocation()
const isNftPage = useIsNftPage() const isNftPage = useIsNftPage()
const isPoolPage = useIsPoolPage() const isPoolPage = useIsPoolsPage()
const isTaxModalServicePage = isNftPage || isPoolPage || pathname.startsWith('/swap') const isTaxModalServicePage = isNftPage || isPoolPage || pathname.startsWith('/swap')
......
import { useLocation } from 'react-router-dom' import { useLocation } from 'react-router-dom'
export function useIsPoolPage() { export function useIsPoolsPage() {
const { pathname } = useLocation() const { pathname } = useLocation()
return ( return (
pathname.startsWith('/pools') || pathname.startsWith('/pools') ||
pathname.startsWith('/pool') ||
pathname.startsWith('/add') || pathname.startsWith('/add') ||
pathname.startsWith('/remove') || pathname.startsWith('/remove') ||
pathname.startsWith('/increase') pathname.startsWith('/increase')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment