Commit f10ba735 authored by Saro Vindigni's avatar Saro Vindigni Committed by GitHub

fix: <a> cannot appear as a descendant of <a> (#6737)

* fix: <a> cannot appear as a descendant of <a>

* refact: change render logic to SwitchLocaleLink
parent c2a83cab
......@@ -31,7 +31,7 @@ import JSBI from 'jsbi'
import { formatSwapQuoteReceivedEventProperties } from 'lib/utils/analytics'
import { ReactNode, useCallback, useEffect, useMemo, useReducer, useState } from 'react'
import { ArrowDown } from 'react-feather'
import { useNavigate } from 'react-router-dom'
import { useLocation, useNavigate } from 'react-router-dom'
import { Text } from 'rebass'
import { InterfaceTrade, TradeState } from 'state/routing/types'
import styled, { useTheme } from 'styled-components/macro'
......@@ -135,6 +135,9 @@ const TRADE_STRING = 'SwapRouter'
export default function SwapPage({ className }: { className?: string }) {
const { chainId: connectedChainId } = useWeb3React()
const loadedUrlParams = useDefaultsFromURLSearch()
const location = useLocation()
return (
<Trace page={InterfacePageName.SWAP_PAGE} shouldLogImpression>
<PageWrapper>
......@@ -148,7 +151,7 @@ export default function SwapPage({ className }: { className?: string }) {
/>
<NetworkAlert />
</PageWrapper>
<SwitchLocaleLink />
{location.pathname === '/swap' && <SwitchLocaleLink />}
</Trace>
)
}
......
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