Skip to content

Commit

Permalink
cleanup (#276)
Browse files Browse the repository at this point in the history
* strk rewards new design implemented

* hardcode bug resolved

* button state handling and some iterations

* added allocation dependencies to numbers

* apr updated

* reward pair name fixes

* api url update for rewards

* added loader

* double currency logo handled

* commented code revert

* code revert
  • Loading branch information
vnaysngh-mudrex authored Mar 8, 2024
1 parent b2b6ddb commit 0387e39
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
18 changes: 9 additions & 9 deletions src/components/WalletModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ export default function WalletModal({
const previousAccount = usePrevious(account)

useEffect(() => {
// if (status === 'connected' && chainId) {
// if (
// (isProductionEnvironment() && !isProductionChainId(chainId)) ||
// (isTestnetEnvironment() && !isTestnetChainId(chainId)) ||
// !Object.values(ChainId).includes(chainId)
// ) {
// setChainError(true)
// }
// }
if (status === 'connected' && chainId) {
if (
(isProductionEnvironment() && !isProductionChainId(chainId)) ||
(isTestnetEnvironment() && !isTestnetChainId(chainId)) ||
!Object.values(ChainId).includes(chainId)
) {
setChainError(true)
}
}
}, [status])

useEffect(() => {
Expand Down
30 changes: 15 additions & 15 deletions src/components/Web3Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,21 @@ export default function Web3Status() {

const [domain, setDomain] = useState<string>('')

// useEffect(() => {
// const url = domainURL(chainId as ChainId)
// if (!address) {
// return
// }
// setDomain('')
// fetch(url + num.hexToDecimalString(address ?? ''))
// .then(response => response.json())
// .then((data: DomainToAddrData) => {
// setDomain(data.domain)
// })
// .catch(error => {
// console.error(error)
// })
// }, [address, chainId])
useEffect(() => {
const url = domainURL(chainId as ChainId)
if (!address) {
return
}
setDomain('')
fetch(url + num.hexToDecimalString(address ?? ''))
.then(response => response.json())
.then((data: DomainToAddrData) => {
setDomain(data.domain)
})
.catch(error => {
console.error(error)
})
}, [address, chainId])

const allTransactions = useAllTransactions()

Expand Down
2 changes: 1 addition & 1 deletion src/context/StarknetProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import React, { useMemo } from 'react'

import { goerli, mainnet, sepolia } from '@starknet-react/chains'
import { StarknetConfig, publicProvider } from '@starknet-react/core'
import { StarknetConfig } from '@starknet-react/core'
import { WebWalletConnector } from 'starknetkit/webwallet'
import { InjectedConnector } from 'starknetkit/injected'
import rpcProvider from '../utils/getLibrary'
Expand Down
20 changes: 10 additions & 10 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ export default function App() {
}, [fetchAllPairs])

useEffect(() => {
//Ensure that environment and chainId are compatible with one another.
// if (status === 'connected' && chainId) {
// if (
// (isProductionEnvironment() && !isProductionChainId(chainId)) ||
// (isTestnetEnvironment() && !isTestnetChainId(chainId)) ||
// !Object.values(ChainId).includes(chainId)
// ) {
// disconnect()
// }
// }
// Ensure that environment and chainId are compatible with one another.
if (status === 'connected' && chainId) {
if (
(isProductionEnvironment() && !isProductionChainId(chainId)) ||
(isTestnetEnvironment() && !isTestnetChainId(chainId)) ||
!Object.values(ChainId).includes(chainId)
) {
disconnect()
}
}
}, [status])

return (
Expand Down

0 comments on commit 0387e39

Please sign in to comment.