From e9fbf613758f31620bf4b71aa3b158c17eb7790e Mon Sep 17 00:00:00 2001 From: eddie <66155195+just-toby@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:20:10 -0700 Subject: [PATCH] fix: position X opt in tooltip on TDP (#7465) --- src/pages/Swap/UniswapXOptIn.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/Swap/UniswapXOptIn.tsx b/src/pages/Swap/UniswapXOptIn.tsx index 4d2b548a05..0ea44934d4 100644 --- a/src/pages/Swap/UniswapXOptIn.tsx +++ b/src/pages/Swap/UniswapXOptIn.tsx @@ -17,6 +17,7 @@ import { import { formatCommonPropertiesForTrade } from 'lib/utils/analytics' import { PropsWithChildren, useEffect, useRef, useState } from 'react' import { X } from 'react-feather' +import { useLocation } from 'react-router-dom' import { Text } from 'rebass' import { useAppDispatch } from 'state/hooks' import { RouterPreference } from 'state/routing/types' @@ -73,6 +74,7 @@ const OptInContents = ({ const dispatch = useAppDispatch() const [showYoureIn, setShowYoureIn] = useState(false) const isVisible = isOnClassic + const location = useLocation() // adding this as we need to mount and then set shouldAnimate = true after it mounts to avoid a flicker on initial mount const [shouldAnimate, setShouldAnimate] = useState(false) @@ -115,7 +117,7 @@ const OptInContents = ({ const containerRef = useRef() - if (isSmall) { + if (isSmall || location.pathname.includes('/tokens/')) { return (