Skip to content

Commit

Permalink
fix minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Aug 15, 2023
1 parent 0c0b5b5 commit 78ca7b8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 36 deletions.
13 changes: 0 additions & 13 deletions src/components/Header/web3/NetworkModal/Networks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ChainId, getChainType } from '@kyberswap/ks-sdk-core'
import { Trans } from '@lingui/macro'
import { darken, rgba } from 'polished'
import { stringify } from 'querystring'
import React from 'react'
Expand All @@ -18,13 +17,6 @@ import useTheme from 'hooks/useTheme'
import { useChangeNetwork } from 'hooks/web3/useChangeNetwork'
import { useIsDarkMode } from 'state/user/hooks'

const NewLabel = styled.span`
font-size: 12px;
color: ${({ theme }) => theme.red};
margin-left: 2px;
margin-top: -10px;
`

const ListItem = styled.div<{ selected?: boolean }>`
width: 100%;
display: flex;
Expand Down Expand Up @@ -197,11 +189,6 @@ const Networks = ({
{name}
</Text>
</Flex>
{key === ChainId.LINEA && (
<NewLabel>
<Trans>New</Trans>
</NewLabel>
)}
{selected && !walletKey && <CircleGreen />}
{walletKey && (
<WalletWrapper>
Expand Down
16 changes: 8 additions & 8 deletions src/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ export const SUPPORTED_NETWORKS = Object.keys(NETWORKS_INFO).map(Number).filter(

export const MAINNET_NETWORKS = [
ChainId.MAINNET,
ChainId.BSCMAINNET,
ChainId.MATIC,
ChainId.AVAXMAINNET,
ChainId.ARBITRUM,
ChainId.OPTIMISM,
ChainId.LINEA,
ChainId.MATIC,
ChainId.ZKEVM,
ChainId.ZKSYNC,
ChainId.BSCMAINNET,
ChainId.AVAXMAINNET,
// ChainId.SOLANA,
ChainId.BTTC,
ChainId.OASIS,
ChainId.FANTOM,
ChainId.BTTC,
ChainId.CRONOS,
ChainId.VELAS,
ChainId.OASIS,
ChainId.AURORA,
ChainId.ZKSYNC,
ChainId.LINEA,
ChainId.ZKEVM,
] as const

export const EVM_NETWORKS = SUPPORTED_NETWORKS.filter(chainId => getChainType(chainId) === ChainType.EVM) as Exclude<
Expand Down
4 changes: 2 additions & 2 deletions src/constants/networks/matic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const maticInfo: EVMNetworkInfo = {
priceRoute: 'polygon',
poolFarmRoute: 'polygon',
aggregatorRoute: 'polygon',
name: 'Polygon',
icon: Polygon,
name: 'Polygon PoS',
icon: 'https://wallet.polygon.technology/assets/img/polygon-pos.svg',
iconDark: NOT_SUPPORT,
iconSelected: NOT_SUPPORT,
iconDarkSelected: NOT_SUPPORT,
Expand Down
6 changes: 3 additions & 3 deletions src/constants/networks/zkevm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const zkEvm: EVMNetworkInfo = {
iconDarkSelected: NOT_SUPPORT,
defaultBlockSubgraph:
'https://polygon-zkevm-graph.kyberengineering.io/subgraphs/name/kybernetwork/polygon-zkevm-blocks',
etherscanUrl: 'https://zkevm.polygonscan.com/',
etherscanUrl: 'https://zkevm.polygonscan.com',
etherscanName: 'Polygon zkEVM Explorer',
tokenListUrl: `${KS_SETTING_API}/v1/tokens?chainIds=${ChainId.ZKEVM}&isWhitelisted=${true}`,
bridgeURL: EMPTY,
Expand Down Expand Up @@ -68,8 +68,8 @@ const zkEvm: EVMNetworkInfo = {
development: NOT_SUPPORT,
},
averageBlockTimeInSeconds: 2, // TODO: check these info
coingeckoNetworkId: NOT_SUPPORT,
coingeckoNativeTokenId: NOT_SUPPORT,
coingeckoNetworkId: 'polygon-zkevm',
coingeckoNativeTokenId: 'ethereum',
deBankSlug: EMPTY,
dexToCompare: NOT_SUPPORT,
geckoTermialId: NOT_SUPPORT,
Expand Down
14 changes: 4 additions & 10 deletions src/utils/aggregationRouting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,12 @@ export function getTradeComposition(
})

if (index === 0) {
const token = tokens[hop.tokenIn] || defaultToken
path.push(
allTokens?.[isAddressString(chainId, token.address)] ||
new Token(chainId, token.address, token.decimals, token.symbol, token.name),
)
const token = getTokenFromAddress(hop.tokenIn)
path.push(token)
}

const token = allTokens?.[isAddressString(chainId, hop.tokenOut)] || tokens[hop.tokenOut] || defaultToken
path.push(
allTokens?.[isAddressString(chainId, token.address)] ||
new Token(chainId, token.address, token.decimals, token.symbol, token.name),
)
const token = getTokenFromAddress(hop.tokenOut)
path.push(token)
})
routes.push({
slug: path
Expand Down

0 comments on commit 78ca7b8

Please sign in to comment.