Skip to content

Commit

Permalink
sepolia based checks added to pause liquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaysngh-mudrex committed Apr 15, 2024
1 parent 441994b commit 29bebcb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/pages/AddLiquidity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import type { TransactionResponse } from '@ethersproject/providers'
import { Trans } from '@lingui/macro'
import { BrowserEvent, InterfaceElementName, InterfaceEventName, LiquidityEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent, validateAndParseAddress } from '@vnaysn/jediswap-sdk-core'
import { ChainId, Currency, CurrencyAmount, Percent, validateAndParseAddress } from '@vnaysn/jediswap-sdk-core'
import { FeeAmount, NonfungiblePositionManager, Position, toHex } from '@vnaysn/jediswap-sdk-v3'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { AlertTriangle } from 'react-feather'
Expand Down Expand Up @@ -213,6 +213,12 @@ function AddLiquidity() {
if (txData) console.log(txData, 'txData')
}, [txData])

useEffect(() => {
if (chainId) {
if (chainId === ChainId.GOERLI) setShowWarning(false)
}
}, [chainId])

useEffect(() => {
if (mintCallData) {
writeAsync()
Expand Down
8 changes: 8 additions & 0 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
UK_BANNER_HEIGHT_SM,
WarningBanner,
} from 'components/NavBar/WarningBanner'
import { ChainId } from '@vnaysn/jediswap-sdk-core'
// import Footer from 'components/Footer'

const BodyWrapper = styled.div<{ bannerIsVisible?: boolean }>`
Expand Down Expand Up @@ -104,6 +105,7 @@ export default function App() {
const [showWarning, setShowWarning] = useState(true)
const scrolledState = scrollY > 0
const routerConfig = useRouterConfig()
const { chainId } = useAccountDetails()

const isHeaderTransparent = !scrolledState

Expand All @@ -112,6 +114,12 @@ export default function App() {
setScrollY(0)
}, [pathname])

useEffect(() => {
if (chainId) {
if (chainId === ChainId.GOERLI) setShowWarning(false)
}
}, [chainId])

useEffect(() => {
const scrollListener = () => {
setScrollY(window.scrollY)
Expand Down
8 changes: 7 additions & 1 deletion src/pages/RemoveLiquidity/V3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import type { TransactionResponse } from '@ethersproject/providers'
import { Trans } from '@lingui/macro'
import { LiquidityEventName, LiquiditySource } from '@uniswap/analytics-events'
import { CurrencyAmount, Percent } from '@vnaysn/jediswap-sdk-core'
import { ChainId, CurrencyAmount, Percent } from '@vnaysn/jediswap-sdk-core'
import { NonfungiblePositionManager, Position } from '@vnaysn/jediswap-sdk-v3'
import { useAccountDetails } from 'hooks/starknet-react'
import { useCallback, useEffect, useMemo, useState } from 'react'
Expand Down Expand Up @@ -111,6 +111,12 @@ function Remove({ tokenId }: { tokenId: number }) {
calls: mintCallData,
})

useEffect(() => {
if (chainId) {
if (chainId === ChainId.GOERLI) setShowWarning(false)
}
}, [chainId])

useEffect(() => {
if (mintCallData) {
writeAsync()
Expand Down

0 comments on commit 29bebcb

Please sign in to comment.