Skip to content

Commit

Permalink
Merge pull request #131 from HaloDAO/develop
Browse files Browse the repository at this point in the history
Arbitrum support
  • Loading branch information
schystz authored Dec 14, 2021
2 parents 5dd11b7 + f39227a commit f2cf53c
Show file tree
Hide file tree
Showing 169 changed files with 604 additions and 277 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
REACT_APP_LIQUIDITY_POOL_ADDRESSES: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_MATIC: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_MATIC }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_KOVAN: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_KOVAN }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB_RINKEBY: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB_RINKEBY }}
REACT_APP_INACTIVE_POOLS: ${{ secrets.REACT_APP_INACTIVE_POOLS }}
REACT_APP_INACTIVE_POOLS_MATIC: ${{ secrets.REACT_APP_INACTIVE_POOLS_MATIC }}
REACT_APP_INACTIVE_POOLS_KOVAN: ${{ secrets.REACT_APP_INACTIVE_POOLS_KOVAN }}
Expand All @@ -46,6 +48,8 @@ jobs:
REACT_APP_HALO_REWARDS_V1_ADDRESS_MAINNET: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_MAINNET }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_KOVAN: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_KOVAN }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_MATIC: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_MATIC }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB_RINKEBY: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB_RINKEBY }}
REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MAINNET: ${{ secrets.REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MAINNET }}
REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MATIC: ${{ secrets.REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MATIC }}
REACT_APP_HALO_REWARDS_V1_1_ADDRESS_KOVAN: ${{ secrets.REACT_APP_HALO_REWARDS_V1_1_ADDRESS_KOVAN }}
Expand All @@ -55,6 +59,8 @@ jobs:
REACT_APP_AMM_ZAP_ADDRESS_MAINNET: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_MAINNET }}
REACT_APP_AMM_ZAP_ADDRESS_KOVAN: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_KOVAN }}
REACT_APP_AMM_ZAP_ADDRESS_MATIC: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_MATIC }}
REACT_APP_AMM_ZAP_ADDRESS_ARB: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_ARB }}
REACT_APP_AMM_ZAP_ADDRESS_ARB_RINKEBY: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_ARB_RINKEBY }}
REACT_APP_HALO_TOKEN_ADDRESS_RINKEBY: ${{ secrets.REACT_APP_HALO_TOKEN_ADDRESS_RINKEBY }}
REACT_APP_HALO_REWARDS_ADDRESS_RINKEBY: ${{ secrets.REACT_APP_HALO_REWARDS_ADDRESS_RINKEBY }}
REACT_APP_HALOHALO_ADDRESS_RINKEBY: ${{ secrets.REACT_APP_HALOHALO_ADDRESS_RINKEBY }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
REACT_APP_LIQUIDITY_POOL_ADDRESSES: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_MATIC: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_MATIC }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_KOVAN: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_KOVAN }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB }}
REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB_RINKEBY: ${{ secrets.REACT_APP_LIQUIDITY_POOL_ADDRESSES_ARB_RINKEBY }}
REACT_APP_INACTIVE_POOLS: ${{ secrets.REACT_APP_INACTIVE_POOLS }}
REACT_APP_INACTIVE_POOLS_MATIC: ${{ secrets.REACT_APP_INACTIVE_POOLS_MATIC }}
REACT_APP_INACTIVE_POOLS_KOVAN: ${{ secrets.REACT_APP_INACTIVE_POOLS_KOVAN }}
Expand All @@ -44,6 +46,8 @@ jobs:
REACT_APP_HALO_REWARDS_V1_ADDRESS_MAINNET: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_MAINNET }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_KOVAN: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_KOVAN }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_MATIC: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_MATIC }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB }}
REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB_RINKEBY: ${{ secrets.REACT_APP_HALO_REWARDS_V1_ADDRESS_ARB_RINKEBY }}
REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MAINNET: ${{ secrets.REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MAINNET }}
REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MATIC: ${{ secrets.REACT_APP_HALO_REWARDS_V1_1_ADDRESS_MATIC }}
REACT_APP_HALO_REWARDS_V1_1_ADDRESS_KOVAN: ${{ secrets.REACT_APP_HALO_REWARDS_V1_1_ADDRESS_KOVAN }}
Expand All @@ -53,6 +57,8 @@ jobs:
REACT_APP_AMM_ZAP_ADDRESS_MAINNET: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_MAINNET }}
REACT_APP_AMM_ZAP_ADDRESS_KOVAN: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_KOVAN }}
REACT_APP_AMM_ZAP_ADDRESS_MATIC: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_MATIC }}
REACT_APP_AMM_ZAP_ADDRESS_ARB: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_ARB }}
REACT_APP_AMM_ZAP_ADDRESS_ARB_RINKEBY: ${{ secrets.REACT_APP_AMM_ZAP_ADDRESS_ARB_RINKEBY }}
REACT_APP_HALO_TOKEN_ADDRESS_RINKEBY: ${{ secrets.REACT_APP_HALO_TOKEN_ADDRESS_RINKEBY }}
REACT_APP_HALO_REWARDS_ADDRESS_RINKEBY: ${{ secrets.REACT_APP_HALO_REWARDS_ADDRESS_RINKEBY }}
REACT_APP_HALOHALO_ADDRESS_RINKEBY: ${{ secrets.REACT_APP_HALOHALO_ADDRESS_RINKEBY }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@reduxjs/toolkit": "^1.3.5",
"@sushiswap/core": "^1.4.2",
"@sushiswap/default-token-list": "3.3.0",
"@sushiswap/sdk": "5.0.0-canary.2",
"@halodao/sdk": "5.0.0-canary.2-b",
"@types/jest": "^25.2.1",
"@types/lodash.flatmap": "^4.5.6",
"@types/luxon": "^1.24.4",
Expand Down
2 changes: 1 addition & 1 deletion src/components/CurrencyInputPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Currency, Pair } from '@sushiswap/sdk'
import { Currency, Pair } from '@halodao/sdk'
import React, { useState, useCallback } from 'react'
import styled from 'styled-components'
import { darken } from 'polished'
Expand Down
4 changes: 3 additions & 1 deletion src/components/CurrencyLogo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Currency, ETHER, Token, ChainId } from '@sushiswap/sdk'
import { Currency, ETHER, Token, ChainId } from '@halodao/sdk'
import React, { useMemo } from 'react'
import styled from 'styled-components'

Expand All @@ -17,6 +17,8 @@ const getTokenLogoURL = (address: string, chainId: ChainId | undefined) => {
let chain = 'ethereum'
if (chainId === ChainId.MATIC) {
chain = 'polygon'
} else if (chainId === ChainId.ARBITRUM) {
chain = 'arbitrum'
}

return `https://raw.githubusercontent.com/HaloDAO/assets/master/blockchains/${chain}/assets/${address}/logo.png`
Expand Down
2 changes: 1 addition & 1 deletion src/components/DoubleLogo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Currency } from '@sushiswap/sdk'
import { Currency } from '@halodao/sdk'
import React from 'react'
import styled from 'styled-components'
import CurrencyLogo from '../CurrencyLogo'
Expand Down
9 changes: 5 additions & 4 deletions src/components/Farm/FarmPoolCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import { getPoolLiquidity } from 'utils/poolInfo'
import { useTotalSupply } from 'data/TotalSupply'
import { formatNumber, NumberFormat, toFixed } from 'utils/formatNumber'
import { monthlyReward, apy } from 'utils/poolAPY'
import { useApproveCallback, ApprovalState } from '../../hooks/useApproveCallback'
import { JSBI, TokenAmount } from '@sushiswap/sdk'
import { ApprovalState } from '../../hooks/useApproveCallback'
import { JSBI, TokenAmount } from '@halodao/sdk'
import {
useDepositWithdrawHarvestCallback,
useStakedBPTPerPool,
Expand All @@ -59,6 +59,7 @@ import { MetamaskError } from 'constants/errors'
import { BigNumber } from '@ethersproject/bignumber'
import { addPendingRewards, didAlreadyMigrate } from 'utils/firebaseHelper'
import { Check, GitPullRequest } from 'react-feather'
import useTokenAllowance from 'halo-hooks/tokens/useTokenAllowance'

const StyledFixedHeightRowCustom = styled(FixedHeightRow)`
padding: 1rem;
Expand Down Expand Up @@ -481,13 +482,13 @@ export default function FarmPoolCard({
unclaimedPoolRewards = hasPendingRewardTokenError ? 0 : unclaimedPoolRewards
const unclaimedHALO = unclaimedPoolRewards

// Make use of `useApproveCallback` for checking & setting allowance
// Make use of `useTokenAllowance` for checking & setting allowance
const rewardsContractAddress = getAmmRewardsContractAddress(chainId, rewardsVersion)
// Change this when migrating to a new AMM Rewards Version
const rewardsContractV1_1_ContractAddress = getAmmRewardsContractAddress(chainId, AmmRewardsVersion.Latest) // eslint-disable-line

const tokenAmount = new TokenAmount(poolInfo.asToken, JSBI.BigInt(parseEther(`${parseFloat(stakeAmount) || 0}`)))
const [approveState, approveCallback] = useApproveCallback(tokenAmount, rewardsContractAddress)
const [approveState, approveCallback] = useTokenAllowance(tokenAmount, rewardsContractAddress)
const lpTokenContract = useTokenContract(poolInfo.address)

// Make use of `useDepositWithdrawPoolTokensCallback` for deposit & withdraw poolTokens methods
Expand Down
2 changes: 1 addition & 1 deletion src/components/FormattedCurrencyAmount/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { CurrencyAmount, Fraction, JSBI } from '@sushiswap/sdk'
import { CurrencyAmount, Fraction, JSBI } from '@halodao/sdk'

const CURRENCY_AMOUNT_MIN = new Fraction(JSBI.BigInt(1), JSBI.BigInt(1000000))

Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/UniBalanceContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId, TokenAmount } from '@sushiswap/sdk'
import { ChainId, TokenAmount } from '@halodao/sdk'
import React, { useEffect, useState } from 'react'
import { X } from 'react-feather'
import styled from 'styled-components'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TokenAmount, Currency } from '@sushiswap/sdk'
import { TokenAmount, Currency } from '@halodao/sdk'
import React, { useState } from 'react'
import { Text } from 'rebass'
import { NavLink } from 'react-router-dom'
Expand Down
17 changes: 4 additions & 13 deletions src/components/NetworkModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NETWORK_ICON, NETWORK_LABEL } from '../../constants/networks'
import { useModalOpen, useNetworkModalToggle } from '../../state/application/hooks'
import { ApplicationModal } from '../../state/application/actions'
import { ChainId } from '@sushiswap/sdk'
import { ChainId } from '@halodao/sdk'
import React from 'react'
import { useActiveWeb3React } from 'hooks/useActiveWeb3React'
import { Box } from 'rebass'
Expand Down Expand Up @@ -59,25 +59,16 @@ export default function NetworkModal(): JSX.Element | null {

if (!chainId) return null

const chainOptions = [ChainId.MAINNET, ChainId.MATIC, ChainId.ARBITRUM]

return (
<HaloModal isOpen={networkModalOpen} onDismiss={toggleNetworkModal} title="Select a Network">
<>
<StyledDescription>
You are currently browsing <span className="halodao">HALODAO</span> on the{' '}
<span className="current-network">{NETWORK_LABEL[chainId]}</span> network
</StyledDescription>
{[
ChainId.MAINNET,
//ChainId.FANTOM,
ChainId.BSC,
ChainId.MATIC
//ChainId.HECO,
//ChainId.XDAI,
//ChainId.HARMONY,
//ChainId.AVALANCHE,
//ChainId.OKEX
//ChainId.MOONBASE
].map((key: ChainId, i: number) => {
{chainOptions.map((key: ChainId, i: number) => {
if (chainId === key) {
return (
<NetworkButton key={i}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Popups/ClaimPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TokenAmount } from '@sushiswap/sdk'
import { TokenAmount } from '@halodao/sdk'
import React, { useEffect } from 'react'
import { X } from 'react-feather'
import styled, { keyframes } from 'styled-components'
Expand Down
2 changes: 1 addition & 1 deletion src/components/PositionCard/V1.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext } from 'react'
import { Link, RouteComponentProps, withRouter } from 'react-router-dom'
import { Token, TokenAmount, WETH } from '@sushiswap/sdk'
import { Token, TokenAmount, WETH } from '@halodao/sdk'

import { Text } from 'rebass'
import { AutoColumn } from '../Column'
Expand Down
2 changes: 1 addition & 1 deletion src/components/PositionCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSBI, Pair, Percent, TokenAmount } from '@sushiswap/sdk'
import { JSBI, Pair, Percent, TokenAmount } from '@halodao/sdk'
import { darken } from 'polished'
import React, { useState } from 'react'
import { ChevronDown, ChevronUp } from 'react-feather'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/CommonBases.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from 'rebass'
import { ChainId, Currency, currencyEquals, ETHER, Token } from '@sushiswap/sdk'
import { ChainId, Currency, currencyEquals, ETHER, Token } from '@halodao/sdk'
import styled from 'styled-components'

import { SUGGESTED_BASES } from '../../constants'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/CurrencyList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Currency, CurrencyAmount, currencyEquals, ETHER, Token } from '@sushiswap/sdk'
import { Currency, CurrencyAmount, currencyEquals, ETHER, Token } from '@halodao/sdk'
import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'
import { FixedSizeList } from 'react-window'
import { Text } from 'rebass'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/CurrencySearch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Currency, ETHER, Token } from '@sushiswap/sdk'
import { Currency, ETHER, Token } from '@halodao/sdk'
import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import ReactGA from 'react-ga'
import { useTranslation } from 'react-i18next'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/CurrencySearchModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Currency, Token } from '@sushiswap/sdk'
import { Currency, Token } from '@halodao/sdk'
import React, { useCallback, useEffect, useState } from 'react'
import useLast from '../../hooks/useLast'
import Modal from '../Modal'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/ImportRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { CSSProperties } from 'react'
import { Token } from '@sushiswap/sdk'
import { Token } from '@halodao/sdk'
import { AutoRow, RowFixed } from 'components/Row'
import { AutoColumn } from 'components/Column'
import CurrencyLogo from 'components/CurrencyLogo'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/ImportToken.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { Token, Currency } from '@sushiswap/sdk'
import { Token, Currency } from '@halodao/sdk'
import styled from 'styled-components'
import { TYPE, CloseIcon } from 'theme'
import Card from 'components/Card'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/Manage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ArrowLeft } from 'react-feather'
import { Text } from 'rebass'
import { CloseIcon } from 'theme'
import styled from 'styled-components'
import { Token } from '@sushiswap/sdk'
import { Token } from '@halodao/sdk'
import { ManageLists } from './ManageLists'
import ManageTokens from './ManageTokens'
import { TokenList } from '@uniswap/token-lists'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/ManageTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TYPE, ExternalLinkIcon, TrashIcon, ButtonText, ExternalLink } from 'the
import { useToken } from 'hooks/Tokens'
import styled from 'styled-components'
import { useUserAddedTokens, useRemoveUserAddedToken } from 'state/user/hooks'
import { Token } from '@sushiswap/sdk'
import { Token } from '@halodao/sdk'
import CurrencyLogo from 'components/CurrencyLogo'
import { getExplorerLink, isAddress } from 'utils'
import { useActiveWeb3React } from 'hooks'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/filtering.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react'
import { isAddress } from '../../utils'
import { Token } from '@sushiswap/sdk'
import { Token } from '@halodao/sdk'

export function filterTokens(tokens: Token[], search: string): Token[] {
if (search.length === 0) return tokens
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal/sorting.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Token, TokenAmount } from '@sushiswap/sdk'
import { Token, TokenAmount } from '@halodao/sdk'
import { useMemo } from 'react'
import { useAllTokenBalances } from '../../state/wallet/hooks'

Expand Down
3 changes: 1 addition & 2 deletions src/components/Tailwind/InputFields/CurrencyInput.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { Currency, Token } from '@sushiswap/sdk'
import { Currency, Token } from '@halodao/sdk'
import CurrencyLogo from 'components/CurrencyLogo'
import MaxButton from '../Buttons/MaxButton'
import SelectButton from '../Buttons/SelectButton'
Expand Down Expand Up @@ -30,7 +30,6 @@ const TokenInput = ({
showMax,
onSelectToken,
tokenList,

balance
}: TokenInputProps) => {
const [showModal, setShowModal] = useState(false)
Expand Down
11 changes: 2 additions & 9 deletions src/components/Tailwind/Modals/NetworkModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { ChainId } from '@sushiswap/sdk'
import { ChainId } from '@halodao/sdk'
import { ORIGINAL_TOKEN_CHAIN_ID } from 'constants/bridge'
import { NETWORK_ICON, NETWORK_LABEL, NETWORK_PARAMS } from '../../../constants/networks'
import BaseModal from 'components/Tailwind/Modals/BaseModal'
Expand Down Expand Up @@ -101,16 +101,9 @@ const NetworkModal = ({ isVisible, mode, onDismiss, onChangeNetwork, tokenAddres
<div className="flex flex-col mb-4">
{[
ChainId.MAINNET,
//ChainId.FANTOM,
// ChainId.BSC,
ChainId.MATIC,
ChainId.ARBITRUM,
...(process.env.REACT_APP_MOCK_TOKEN_MAINNET ? [ChainId.XDAI] : [])
//ChainId.HECO,
// ChainId.XDAI
//ChainId.HARMONY,
//ChainId.AVALANCHE,
//ChainId.OKEX
//ChainId.MOONBASE
].map((key: ChainId, i: number) => {
if (chainId === key && mode !== NetworkModalMode.PrimaryBridge) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tailwind/Modals/TokenSelectModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'
import { Token } from '@sushiswap/sdk'
import { Token } from '@halodao/sdk'
import { HALO, HALOHALO, TRUE_AUD, TRUE_CAD, TRUE_GBP } from '../../../constants'
import BaseModal from 'components/Tailwind/Modals/BaseModal'
import CurrencyLogo from 'components/CurrencyLogo'
Expand Down
30 changes: 30 additions & 0 deletions src/components/Tailwind/Panels/FeatureNotSupported.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ChainId } from '@halodao/sdk'
import { NETWORK_LABEL } from 'constants/networks'
import { useActiveWeb3React } from 'hooks'
import React from 'react'
import PageWarning from '../Layout/PageWarning'

interface FeatureNotSupportedProps {
isIsolated: boolean
}

const FeatureNotSupported = ({ isIsolated }: FeatureNotSupportedProps) => {
const { chainId } = useActiveWeb3React()

const caption = `Ooops! Sorry this feature is not supported in ${NETWORK_LABEL[chainId as ChainId]}.`

return (
<div
className={`
flex items-center
${isIsolated ? 'py-6 px-8 border border-primary-hover shadow-md rounded-card bg-white' : ''}
`}
>
<div className="w-full">
<PageWarning caption={caption} />
</div>
</div>
)
}

export default FeatureNotSupported
2 changes: 1 addition & 1 deletion src/components/Tailwind/Panels/SelectedNetworkPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { ChainId } from '@sushiswap/sdk'
import { ChainId } from '@halodao/sdk'
import { NETWORK_ICON, NETWORK_LABEL } from '../../../constants/networks'
import NetworkModal, { NetworkModalMode } from 'components/Tailwind/Modals/NetworkModal'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Tailwind/Templates/ExpandablePoolRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { ChainId } from '@sushiswap/sdk'
import { ChainId } from '@halodao/sdk'
import DoubleCurrencyLogo from 'components/DoubleLogo'
import { HALO, USDC } from '../../../constants'
import { formatNumber } from 'utils/formatNumber'
Expand Down
2 changes: 1 addition & 1 deletion src/components/TokenWarningModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Token } from '@sushiswap/sdk'
import { Token } from '@halodao/sdk'
import React, { useCallback } from 'react'
import Modal from '../Modal'
import { ImportToken } from 'components/SearchModal/ImportToken'
Expand Down
2 changes: 1 addition & 1 deletion src/components/TransactionConfirmationModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId } from '@sushiswap/sdk'
import { ChainId } from '@halodao/sdk'
import React, { useContext } from 'react'
import styled, { ThemeContext } from 'styled-components'
import Modal from '../Modal'
Expand Down
2 changes: 1 addition & 1 deletion src/components/VestingModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { PoolVestingInfo } from 'state/user/actions'
import { NETWORK_SUPPORTED_FEATURES } from '../../constants/networks'
import { useActiveWeb3React } from '../../hooks'
import { ExternalLink as ExternalLinkIcon } from 'react-feather'
import { ChainId } from '@sushiswap/sdk'
import { ChainId } from '@halodao/sdk'

const StyledWrapper = styled.div`
${({ theme }) => theme.flexColumnNoWrap}
Expand Down
Loading

0 comments on commit f2cf53c

Please sign in to comment.