diff --git a/components/Input/Address/AddressPicker/AddressWithIcon.tsx b/components/Input/Address/AddressPicker/AddressWithIcon.tsx index c49a596ce..58d748012 100644 --- a/components/Input/Address/AddressPicker/AddressWithIcon.tsx +++ b/components/Input/Address/AddressPicker/AddressWithIcon.tsx @@ -126,6 +126,8 @@ type ExtendedAddressProps = { children?: ReactNode shouldShowChevron?: boolean isNativeToken?: boolean; + onPopoverOpenChange?: (open: boolean) => void; + onTooltipOpenChange?: (open: boolean) => void; } const calculateMaxWidth = (balance: string | undefined) => { @@ -140,10 +142,15 @@ const calculateMaxWidth = (balance: string | undefined) => { } }; -export const ExtendedAddress: FC = ({ address, network, isForCurrency, children, onDisconnect, showDetails = false, title, description, logo: Logo, shouldShowChevron = true, isNativeToken = false }) => { +export const ExtendedAddress: FC = ({ address, network, isForCurrency, children, onDisconnect, showDetails = false, title, description, logo: Logo, shouldShowChevron = true, isNativeToken = false, onPopoverOpenChange, onTooltipOpenChange }) => { const [isCopied, setCopied] = useCopyClipboard() const [isPopoverOpen, setPopoverOpen] = useState(false) + const handlePopoverChange = (open: boolean) => { + setPopoverOpen(open) + onPopoverOpenChange?.(open) + } + // Resolver for action buttons const getActionButtons = () => { if (isNativeToken) return { buttons: [], showTitles: false }; @@ -176,10 +183,10 @@ export const ExtendedAddress: FC = ({ address, network, is return (
e.stopPropagation()}> - setPopoverOpen(!isPopoverOpen)} modal={true}> +
- + { children ?? @@ -194,7 +201,7 @@ export const ExtendedAddress: FC = ({ address, network, is
} - +

{isForCurrency ? "View token details" : "View address details"}

diff --git a/components/Input/RoutePicker/Routes.tsx b/components/Input/RoutePicker/Routes.tsx index 8404c9260..f7ad71155 100644 --- a/components/Input/RoutePicker/Routes.tsx +++ b/components/Input/RoutePicker/Routes.tsx @@ -43,7 +43,7 @@ type NetworkTokenItemProps = { } export const NetworkTokenTitle = (props: NetworkTokenItemProps) => { - const { item, route, direction, type } = props + const { item, route, direction } = props const swapAccounts = useSwapAccounts(direction) const selectedAccount = swapAccounts?.find(w => (direction == 'from' ? w.provider?.withdrawalSupportedNetworks : w.provider?.autofillSupportedNetworks)?.includes(route.name)); @@ -68,7 +68,7 @@ export const NetworkTokenTitle = (props: NetworkTokenItemProps) => {
} diff --git a/components/Input/RoutePicker/Rows/index.tsx b/components/Input/RoutePicker/Rows/index.tsx index edff1d14f..e1009a41a 100644 --- a/components/Input/RoutePicker/Rows/index.tsx +++ b/components/Input/RoutePicker/Rows/index.tsx @@ -58,7 +58,7 @@ export default function Row({ const isSelected = selectedRoute === route.name && selectedToken === token.symbol; return ( -
onSelect(route, token)} > +
onSelect(route, token)} > ( -
- -
- {!iconOnly && ( -

- {item.display_asset || item.symbol} -

- )} - -
-
-
-); +export const TokenInfoIcon = ({ item, route, className, iconOnly = false }: { item: NetworkRouteToken, route: NetworkRoute, className?: string, iconOnly?: boolean }) => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const [isTooltipOpen, setIsTooltipOpen] = useState(false); + + return ( +
+ +
+ {!iconOnly && ( +

+ {item.display_asset || item.symbol} +

+ )} + +
+
+
+ ); +}; export const TokenTitleWithBalance = ({ item, route, tokenbalance, usdAmount }: TokenTitleWithBalanceProps) => { return ( @@ -45,7 +55,7 @@ export const TokenTitleWithBalance = ({ item, route, tokenbalance, usdAmount }: item={item} route={route} iconOnly - className="hidden xs:block transition-all duration-300 opacity-0 group-hover:opacity-100 group-hover:delay-400 click-delay-on-hover" + className="hidden xs:block transition-all duration-300 opacity-0 group-hover:opacity-100 data-[popover-open=true]:opacity-100 data-[tooltip-open=true]:opacity-100 data-[popover-open=true]:delay-0 data-[tooltip-open=true]:delay-0 group-hover:delay-400 click-delay-on-hover pointer-events-none group-hover:pointer-events-auto data-[popover-open=true]:pointer-events-auto data-[tooltip-open=true]:pointer-events-auto" />
{(tokenbalance && Number(tokenbalance?.amount) > 0 && Number(usdAmount) > 0) && (