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