Commit 1c8b3f03 authored by Jack Short's avatar Jack Short Committed by GitHub

fix: currency select modal when chain is not supported (#6759)

* fix: currency select modal when chain is not supported

* removing pay with if on unsupported network

* refactor
parent fc836590
......@@ -13,7 +13,7 @@ import Row from 'components/Row'
import CurrencySearchModal from 'components/SearchModal/CurrencySearchModal'
import { LoadingBubble } from 'components/Tokens/loading'
import { MouseoverTooltip } from 'components/Tooltip'
import { SupportedChainId } from 'constants/chains'
import { isSupportedChain, SupportedChainId } from 'constants/chains'
import { useNftUniversalRouterAddress } from 'graphql/data/nft/NftUniversalRouterAddress'
import { useCurrency } from 'hooks/Tokens'
import { AllowanceState } from 'hooks/usePermit2Allowance'
......@@ -461,23 +461,27 @@ export const BagFooter = ({ setModalIsOpen, eventProperties }: BagFooterProps) =
<FooterHeader gap="xs">
<CurrencyRow>
<Column gap="xs">
<ThemedText.SubHeaderSmall>
<Trans>Pay with</Trans>
</ThemedText.SubHeaderSmall>
<CurrencyInput
onClick={() => {
if (!bagIsLocked) {
setTokenSelectorOpen(true)
sendAnalyticsEvent(NFTEventName.NFT_BUY_TOKEN_SELECTOR_CLICKED)
}
}}
>
<CurrencyLogo currency={activeCurrency} size="24px" />
<ThemedText.HeadlineSmall fontWeight={500} lineHeight="24px">
{activeCurrency?.symbol}
</ThemedText.HeadlineSmall>
<ChevronDown size={20} color={theme.textSecondary} />
</CurrencyInput>
{isSupportedChain(chainId) && (
<>
<ThemedText.SubHeaderSmall>
<Trans>Pay with</Trans>
</ThemedText.SubHeaderSmall>
<CurrencyInput
onClick={() => {
if (!bagIsLocked) {
setTokenSelectorOpen(true)
sendAnalyticsEvent(NFTEventName.NFT_BUY_TOKEN_SELECTOR_CLICKED)
}
}}
>
<CurrencyLogo currency={activeCurrency} size="24px" />
<ThemedText.HeadlineSmall fontWeight={500} lineHeight="24px">
{activeCurrency?.symbol}
</ThemedText.HeadlineSmall>
<ChevronDown size={20} color={theme.textSecondary} />
</CurrencyInput>
</>
)}
</Column>
<TotalColumn gap="xs">
<ThemedText.SubHeaderSmall marginBottom="4px">
......
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