Commit 70e9257c authored by Noah Zinsmeister's avatar Noah Zinsmeister

fix warnings + bugs

parent f2f960f6
...@@ -40,6 +40,8 @@ const Details = styled.div` ...@@ -40,6 +40,8 @@ const Details = styled.div`
const ErrorSpan = styled.span` const ErrorSpan = styled.span`
margin-right: 12px; margin-right: 12px;
font-size: 0.75rem;
line-height: 0.75rem;
color: ${({ isError, theme }) => isError && theme.salmonRed}; color: ${({ isError, theme }) => isError && theme.salmonRed};
${({ slippageWarning, highSlippageWarning, theme }) => ${({ slippageWarning, highSlippageWarning, theme }) =>
...@@ -56,7 +58,7 @@ const ErrorSpan = styled.span` ...@@ -56,7 +58,7 @@ const ErrorSpan = styled.span`
`} `}
` `
const WrappedDropup = ({ isError, ...rest }) => <Dropup {...rest} /> const WrappedDropup = ({ isError, highSlippageWarning, ...rest }) => <Dropup {...rest} />
const ColoredDropup = styled(WrappedDropup)` const ColoredDropup = styled(WrappedDropup)`
path { path {
stroke: ${({ isError, theme }) => isError && theme.salmonRed}; stroke: ${({ isError, theme }) => isError && theme.salmonRed};
...@@ -69,7 +71,7 @@ const ColoredDropup = styled(WrappedDropup)` ...@@ -69,7 +71,7 @@ const ColoredDropup = styled(WrappedDropup)`
} }
` `
const WrappedDropdown = ({ isError, ...rest }) => <Dropdown {...rest} /> const WrappedDropdown = ({ isError, highSlippageWarning, ...rest }) => <Dropdown {...rest} />
const ColoredDropdown = styled(WrappedDropdown)` const ColoredDropdown = styled(WrappedDropdown)`
path { path {
stroke: ${({ isError, theme }) => isError && theme.salmonRed}; stroke: ${({ isError, theme }) => isError && theme.salmonRed};
......
...@@ -212,12 +212,6 @@ export default function Web3Status() { ...@@ -212,12 +212,6 @@ export default function Web3Status() {
} }
}, [connectorName, setConnector]) }, [connectorName, setConnector])
useEffect(() => {
if (account) {
setError()
}
})
function onClick() { function onClick() {
if (walletModalError) { if (walletModalError) {
openWalletModal() openWalletModal()
......
...@@ -58,8 +58,9 @@ export function useENSName(address) { ...@@ -58,8 +58,9 @@ export function useENSName(address) {
useEffect(() => { useEffect(() => {
if (isAddress(address)) { if (isAddress(address)) {
let stale = false let stale = false
library
library.lookupAddress(address).then(name => { .lookupAddress(address)
.then(name => {
if (!stale) { if (!stale) {
if (name) { if (name) {
setENSNname(name) setENSNname(name)
...@@ -68,6 +69,11 @@ export function useENSName(address) { ...@@ -68,6 +69,11 @@ export function useENSName(address) {
} }
} }
}) })
.catch(() => {
if (!stale) {
setENSNname(null)
}
})
return () => { return () => {
stale = true stale = true
......
...@@ -599,8 +599,8 @@ export default function Swap() { ...@@ -599,8 +599,8 @@ export default function Swap() {
contextualInfo={contextualInfo ? contextualInfo : slippageWarningText} contextualInfo={contextualInfo ? contextualInfo : slippageWarningText}
allowExpand={!!(inputCurrency && outputCurrency && inputValueParsed && outputValueParsed)} allowExpand={!!(inputCurrency && outputCurrency && inputValueParsed && outputValueParsed)}
isError={isError} isError={isError}
slippageWarning={slippageWarning && slippageWarningText} slippageWarning={slippageWarning && !contextualInfo}
highSlippageWarning={highSlippageWarning && slippageWarningText} highSlippageWarning={highSlippageWarning && !contextualInfo}
renderTransactionDetails={renderTransactionDetails} renderTransactionDetails={renderTransactionDetails}
/> />
) )
......
import styled from 'styled-components' import styled from 'styled-components'
import { lighten, darken } from 'polished' import { lighten, darken } from 'polished'
export const Button = styled.button.attrs({ export const Button = styled.button.attrs(({ warning, theme }) => ({
backgroundColor: ({ warning, theme }) => (warning ? theme.salmonRed : theme.royalBlue) backgroundColor: warning ? theme.salmonRed : theme.royalBlue
})` }))`
padding: 1rem 2rem 1rem 2rem; padding: 1rem 2rem 1rem 2rem;
border-radius: 3rem; border-radius: 3rem;
cursor: pointer; cursor: pointer;
......
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