import React from 'react' import { Text } from 'rebass' import { ChainId, Currency, currencyEquals, DEV, Token } from 'moonbeamswap' import styled from 'styled-components' import { SUGGESTED_BASES } from '../../constants' import { AutoColumn } from '../Column' import QuestionHelper from '../QuestionHelper' import { AutoRow } from '../Row' import CurrencyLogo from '../CurrencyLogo' const BaseWrapper = styled.div<{ disable?: boolean }>` border: 1px solid ${({ theme, disable }) => (disable ? 'transparent' : theme.bg3)}; border-radius: 10px; display: flex; padding: 6px; align-items: center; :hover { cursor: ${({ disable }) => !disable && 'pointer'}; background-color: ${({ theme, disable }) => !disable && theme.bg2}; } background-color: ${({ theme, disable }) => disable && theme.bg3}; opacity: ${({ disable }) => disable && '0.4'}; ` export default function CommonBases({ chainId, onSelect, selectedCurrency }: { chainId?: ChainId selectedCurrency?: Currency | null onSelect: (currency: Currency) => void }) { return ( Common bases { if (!selectedCurrency || !currencyEquals(selectedCurrency, DEV)) { onSelect(DEV) } }} disable={selectedCurrency === DEV} > ETH {(chainId ? SUGGESTED_BASES[chainId] : []).map((token: Token) => { const selected = selectedCurrency instanceof Token && selectedCurrency.address === token.address return ( !selected && onSelect(token)} disable={selected} key={token.address}> {token.symbol} ) })} ) }